Skip to main content

Python SDK for vectorizer.ai

Project description

vectorizer-ai

Python SDK for vectorizer.ai.

What is it?

Convert JPEG and PNG bitmaps to SVG vectors.

Install

$ pip install vectorizer-ai

Usage

Basic

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:

client.vectorize(image_base64="base64encodedimage==")

# or

client.vectorize(image_url="https://imageurl.com/test.png")

Advanced

client.vectorize(
    image_path="/path/to/image",
    input_max_pixels=100,
    processing_max_colors=256
    ...
)

Reference: https://vectorizer.ai/api

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

$ python -m unittest discover -s tests -p 'test_*.py'

Made with ❤️ by @mitchbregs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vectorizer_ai-2.0.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectorizer_ai-2.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file vectorizer_ai-2.0.2.tar.gz.

File metadata

  • Download URL: vectorizer_ai-2.0.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vectorizer_ai-2.0.2.tar.gz
Algorithm Hash digest
SHA256 a56e32dcc281f12d5012eaaf3dcef2f78c1ae8a1174d3d625d80dfb30f2894f7
MD5 56567a9af1347f85e58ef5e22c7fb462
BLAKE2b-256 c29a4ae317b8dfe95f8c0e61f0019bdf8e5044f1e8748a40bf4f59d5c8ddfca8

See more details on using hashes here.

File details

Details for the file vectorizer_ai-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: vectorizer_ai-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vectorizer_ai-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26913f0ebe09832211e4219b95378153deb3cf2306f7a813388971b9320381a7
MD5 b7ed6b90c1ac11df2bc6c63fc676c64b
BLAKE2b-256 94ed02d17f03b324b101b9773d1e2fe726adaa2bd84fbd0211da4b4353042975

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page