# 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
```Python
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')
]
}
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/GetmeUK/h51-python",
"name": "H51",
"maintainer": "Anthony Blackshaw",
"docs_url": null,
"requires_python": null,
"maintainer_email": "ant@getme.co.uk",
"keywords": "api h51",
"author": "Anthony Blackshaw",
"author_email": "ant@getme.co.uk",
"download_url": "https://files.pythonhosted.org/packages/5a/0d/279e353a1f1da698978b555f7e180500cc4e318d9cb8d411b825a52c0ca8/H51-0.0.10.tar.gz",
"platform": null,
"description": "# H51 Python Library\n\nThe 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.\n\n\n## Installation\n\n```\npip install h51\n```\n\n## Requirements\n\n- Python 3.7+\n\n\n# Usage\n\n```Python\n\nimport h51\n\n\nclient = h51.Client('your_api_key...')\n\n# Create an asset\nwith open('image.bmp') as f:\n asset = h51.resources.Asset.create(client, f)\n\n# Analyze the image asset to find its dominant colours and focal point\nasset.analyze([\n h51.analyzers.images.DominantColors(),\n h51.analyzers.images.FocalPoint()\n])\n\n# Create web optimized variations of the image\nh51.resources.Variation.create(\n asset,\n {\n 'x1': [\n h51.transforms.images.AutoOrient(),\n h51.transforms.images.FocalPointCrop(aspect_ratio=0.5),\n h51.transforms.images.Fit(640, 640),\n h51.transforms.images.Output('WebP')\n ],\n 'x2': [\n h51.transforms.images.AutoOrient(),\n h51.transforms.images.FocalPointCrop(aspect_ratio=0.5),\n h51.transforms.images.Fit(1280, 1280),\n h51.transforms.images.Output('WebP')\n ]\n }\n)\n\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The H51 Python library provides a pythonic interface to the H51 API.",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://github.com/GetmeUK/h51-python"
},
"split_keywords": [
"api",
"h51"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a0d279e353a1f1da698978b555f7e180500cc4e318d9cb8d411b825a52c0ca8",
"md5": "2453e5cf694ca2e71d49ca6bf53fc522",
"sha256": "249c9f6daf3999d84c4ed4a3100443c2d03b80bf7b47bd99d1dded7cb593c33c"
},
"downloads": -1,
"filename": "H51-0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "2453e5cf694ca2e71d49ca6bf53fc522",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10450,
"upload_time": "2024-09-12T00:31:54",
"upload_time_iso_8601": "2024-09-12T00:31:54.926092Z",
"url": "https://files.pythonhosted.org/packages/5a/0d/279e353a1f1da698978b555f7e180500cc4e318d9cb8d411b825a52c0ca8/H51-0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-12 00:31:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GetmeUK",
"github_project": "h51-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "h51"
}