H51 Python Library
The H51 Python library provides a pythonic interface to the H51 API. It includes an API client class, a set of resource classes and classes for configuring core analyzers and transforms.
Installation
pip install h51
Requirements
- Python 3.7+
Usage
import h51
client = h51.Client('your_api_key...')
# Create an asset
with open('image.bmp') as f:
asset = h51.resources.Asset.create(client, f)
# Analyze the image asset to find its dominant colours and focal point
asset.analyze([
h51.analyzers.images.DominantColors(),
h51.analyzers.images.FocalPoint()
])
# Create web optimized variations of the image
h51.resources.Variation.create(
asset,
{
'x1': [
h51.transforms.images.AutoOrient(),
h51.transforms.images.FocalPointCrop(aspect_ratio=0.5),
h51.transforms.images.Fit(640, 640),
h51.transforms.images.Output('WebP')
],
'x2': [
h51.transforms.images.AutoOrient(),
h51.transforms.images.FocalPointCrop(aspect_ratio=0.5),
h51.transforms.images.Fit(1280, 1280),
h51.transforms.images.Output('WebP')
]
}
)
Metadata
Release files for H51 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| H51-0.0.10.tar.gz | 10.4 kB | Without provenance | Details for H51-0.0.10.tar.gz |
Release files / H51-0.0.10.tar.gz
| Download URL | H51-0.0.10.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
249c9f6daf3999d84c4ed4a3100443c2d03b80bf7b47bd99d1dded7cb593c33c
|
|
BLAKE2b-256 checksum How to use checksums |
5a0d279e353a1f1da698978b555f7e180500cc4e318d9cb8d411b825a52c0ca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for H51 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.