# vectorizer-ai
Python SDK for [vectorizer.ai](https://vectorizer.ai/).
## What is it?
Convert JPEG and PNG bitmaps to SVG vectors.
## Install
```bash
$ pip install vectorizer-ai
```
## Usage
### Basic
```python
from vectorizer_ai import VectorizerAI
client = VectorizerAI(
api_id="VECTORIZER-AI-API-ID",
api_secret="VECTORIZER-AI-API-SECRET",
mode="production"
)
svg = client.vectorize("/path/to/input.png")
svg.save("/path/to/output.svg")
```
You can also use:
```python
client.vectorize(image_base64="base64encodedimage==")
# or
client.vectorize(image_url="https://imageurl.com/test.png")
```
### Advanced
```python
client.vectorize(
image_path="/path/to/image",
input_max_pixels=100,
processing_max_colors=256
...
)
```
Reference: [https://vectorizer.ai/api](https://vectorizer.ai/api#:~:text=Options%20Documentation.-,Parameters,-The%20input%20image)
All parameters described in the API spec above replace period (`.`) with underscore (`_`). For example, if the parameter is `input.max_pixels`, the SDK will use `input_max_pixels`.
## Contributing
Feel free to open a PR for any changes!
## Testing
```bash
$ python -m unittest discover -s tests -p 'test_*.py'
```
Made with ❤️ by [@mitchbregs](https://twitter.com/mitchbregs)
Raw data
{
"_id": null,
"home_page": "https://github.com/mitchbregs/vectorizer-ai",
"name": "vectorizer-ai",
"maintainer": "",
"docs_url": null,
"requires_python": ">3.6",
"maintainer_email": "",
"keywords": "vectorizer.ai svg vectorize image",
"author": "Mitchell Bregman",
"author_email": "mitch@mitchbregs.com",
"download_url": "https://files.pythonhosted.org/packages/c2/9a/4ae317b8dfe95f8c0e61f0019bdf8e5044f1e8748a40bf4f59d5c8ddfca8/vectorizer_ai-2.0.2.tar.gz",
"platform": null,
"description": "# vectorizer-ai\n\nPython SDK for [vectorizer.ai](https://vectorizer.ai/).\n\n## What is it?\n\nConvert JPEG and PNG bitmaps to SVG vectors.\n\n## Install\n\n```bash\n$ pip install vectorizer-ai\n```\n\n## Usage\n\n### Basic\n\n```python\nfrom vectorizer_ai import VectorizerAI\n\nclient = VectorizerAI(\n api_id=\"VECTORIZER-AI-API-ID\",\n api_secret=\"VECTORIZER-AI-API-SECRET\",\n mode=\"production\"\n)\nsvg = client.vectorize(\"/path/to/input.png\")\n\nsvg.save(\"/path/to/output.svg\")\n```\n\nYou can also use:\n\n```python\nclient.vectorize(image_base64=\"base64encodedimage==\")\n\n# or\n\nclient.vectorize(image_url=\"https://imageurl.com/test.png\")\n```\n\n### Advanced\n\n```python\nclient.vectorize(\n image_path=\"/path/to/image\",\n input_max_pixels=100,\n processing_max_colors=256\n ...\n)\n```\n\nReference: [https://vectorizer.ai/api](https://vectorizer.ai/api#:~:text=Options%20Documentation.-,Parameters,-The%20input%20image)\n\nAll parameters described in the API spec above replace period (`.`) with underscore (`_`). For example, if the parameter is `input.max_pixels`, the SDK will use `input_max_pixels`.\n\n## Contributing\n\nFeel free to open a PR for any changes!\n\n## Testing\n\n```bash\n$ python -m unittest discover -s tests -p 'test_*.py'\n```\n\nMade with \u2764\ufe0f by [@mitchbregs](https://twitter.com/mitchbregs)\n",
"bugtrack_url": null,
"license": "",
"summary": "Python SDK for vectorizer.ai",
"version": "2.0.2",
"project_urls": {
"Homepage": "https://github.com/mitchbregs/vectorizer-ai"
},
"split_keywords": [
"vectorizer.ai",
"svg",
"vectorize",
"image"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "94ed02d17f03b324b101b9773d1e2fe726adaa2bd84fbd0211da4b4353042975",
"md5": "b7ed6b90c1ac11df2bc6c63fc676c64b",
"sha256": "26913f0ebe09832211e4219b95378153deb3cf2306f7a813388971b9320381a7"
},
"downloads": -1,
"filename": "vectorizer_ai-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b7ed6b90c1ac11df2bc6c63fc676c64b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3.6",
"size": 6749,
"upload_time": "2023-11-07T06:14:49",
"upload_time_iso_8601": "2023-11-07T06:14:49.802919Z",
"url": "https://files.pythonhosted.org/packages/94/ed/02d17f03b324b101b9773d1e2fe726adaa2bd84fbd0211da4b4353042975/vectorizer_ai-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c29a4ae317b8dfe95f8c0e61f0019bdf8e5044f1e8748a40bf4f59d5c8ddfca8",
"md5": "56567a9af1347f85e58ef5e22c7fb462",
"sha256": "a56e32dcc281f12d5012eaaf3dcef2f78c1ae8a1174d3d625d80dfb30f2894f7"
},
"downloads": -1,
"filename": "vectorizer_ai-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "56567a9af1347f85e58ef5e22c7fb462",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.6",
"size": 8310,
"upload_time": "2023-11-07T06:14:51",
"upload_time_iso_8601": "2023-11-07T06:14:51.184969Z",
"url": "https://files.pythonhosted.org/packages/c2/9a/4ae317b8dfe95f8c0e61f0019bdf8e5044f1e8748a40bf4f59d5c8ddfca8/vectorizer_ai-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-07 06:14:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mitchbregs",
"github_project": "vectorizer-ai",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "vectorizer-ai"
}