semvec/pypi-packages huggingface dataset:
image-to-cpp 0.1.0
Convert an image into a c++ header file containing a bytes array. Useful for electronic projects using a thermal printer or a LCD display.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: image,thermal-printer,lcd,arduino,esp32

# Image to cpp

Convert an image into a c++ header file containing a bytes array. Useful for electronic projects using a thermal printer or a LCD display.

## Usage

```
> image-to-cpp --help
usage: main.py [-h] [-r RESIZE] [-s] [-o OUTPUT] [-v] [-d] [-t THRESHOLD] image_path

Convert an image into a byte array c++ code.

positional arguments:
  image_path            Path of image to convert, use `--` to read from stdin.

optional arguments:
  -h, --help            show this help message and exit
  -r RESIZE, --resize RESIZE
                        Resize image to specified width, keeping aspect ratio.
  -s, --show            Only show converted image.
  -o OUTPUT, --output OUTPUT
                        Store to specified file (default: image_name.h), use `--` to output on stdout.
  -v, --verbose         Deactivate information messages.
  -d, --dither          Activate dithering.
  -t THRESHOLD, --threshold THRESHOLD
                        Threshold level when converting to black and white, from 0 to 255 (default: 128).
```

## License

MIT
s3-endpoint-parse 1.1.1
Flexibly extract information from S3 endpoint URL/URI strings
License: MIT
Requires Python: >=3.6

# s3-endpoint-parse
[![PyPI version](https://badge.fury.io/py/s3_endpoint_parse.svg)](https://pypi.org/project/s3-endpoint-parse/)
[![Supported Version](https://img.shields.io/pypi/pyversions/s3-endpoint-parse.svg)](https://pypi.org/project/s3-endpoint-parse)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
![Tests](https://github.com/pckilgore/s3_endpoint_parse/actions/workflows/test.yml/badge.svg)

Flexibly parses well-formed S3 URL/URIs, including legacy formats and new
fips / dualstack formats, and for Chinese (中国) regions.

Returns a dictionary describing the endpoint:

```python
{
    "match": bool,  # True if library matched
    "protocol": string,  # May be empty
    "bucket": string,  # Set if match is True
    "key": string,  # May be empty
    "region": string,  # May be empty
}
```

## API

```python
def parse(url: string) -> dict
```

Primary export, parses input and returns documented dictionary.


## Examples

```python
from s3_endpoint_parse import parse

# All below:  s3["match"] is True
s3 = parse("https://s3.amazonaws.com/my-bucket/my/cool/file.png")

assert s3["protocol"] == "https"
assert s3["bucket"] == "my-bucket"
assert s3["region"] == ""
assert s3["key"] == "my/cool/file.png"


s3 = parse("s3://my-bucket.s3.us-east-1.amazonaws.com.cn/my/cool/file.png")

assert s3["protocol"] == "s3"
assert s3["bucket"] == "my-bucket"
assert s3["region"] == "us-east-1"
assert s3["key"] == "my/cool/file.png"


s3 = parse("http://my-bucket.s3-us-east-1.amazonaws.com/my/cool/file.png")

assert s3["protocol"] == "http"
assert s3["bucket"] == "my-bucket"
assert s3["region"] == "us-east-1"
assert s3["key"] == "my/cool/file.png"


s3 = parse(
    "https://my-bucket.s3-fips.dualstack.us-east-1.amazonaws.com/my/cool/file.png"
)

assert s3["protocol"] == "https"
assert s3["bucket"] == "my-bucket"
assert s3["region"] == "us-east-1"
assert s3["key"] == "my/cool/file.png"
```

See many more examples in the [`/tests/`](https://github.com/pckilgore/s3_endpoint_parse/blob/trunk/tests/test_s3_parse_url.py) folder