Skip to main content

ViscribeAI SDK

Project description

Viscribe Logo

🌐 ViscribeAI - Python SDK

PyPI version Python Support License Code style: black Documentation Status

Official Python SDK for ViscribeAI - AI-powered image understanding and analysis.

🎁 Get started with free credits! Visit dashboard.viscribe.ai to sign up and get your API key.

📦 Installation

pip install viscribe

🚀 Features

  • 🖼️ AI-powered image description, extraction, classification, VQA (Visual Question Answering), and comparison
  • 🔄 Both sync and async clients
  • 📊 Structured output with Pydantic schemas
  • 🔍 Detailed logging
  • ⚡ Automatic retries
  • 🔐 Secure authentication

🎯 Quick Start

from viscribe import Client

client = Client(api_key="your-api-key-here")

Note: You can set the VISCRIBE_API_KEY environment variable and initialize the client without parameters: client = Client()

📚 Image Endpoints

1. Describe Image

Generate a natural language description of an image, optionally with tags.

from viscribe.client import Client
client = Client(api_key="your-api-key-here")

resp = client.describe_image(
    image_url="https://img.com/cat.jpg",
    generate_tags=True
)
print(resp)

2. Classify Image

Classify an image into one or more categories.

resp = client.classify_image(
    image_url="https://img.com/cat.jpg",
    classes=["cat", "dog"]
)
print(resp)

3. Visual Question Answering (VQA)

Ask a question about the content of an image and get an answer.

resp = client.ask_image(
    image_url="https://img.com/car.jpg",
    question="What color is the car?"
)
print(resp)

4. Extract Structured Data from Image

Extract structured data from an image using either simple fields or an advanced schema.

Simple Fields (Recommended for basic extraction)

Use simple fields for straightforward data extraction (max 10 fields):

resp = client.extract_image(
    image_url="https://img.com/prod.jpg",
    fields=[
        {"name": "product_name", "type": "text", "description": "Name of the product"},
        {"name": "price", "type": "number", "description": "Product price"},
        {"name": "tags", "type": "array_text", "description": "Product tags"},
    ]
)
print(resp.extracted_data)

Field Types:

  • text: Single text value
  • number: Single numeric value
  • array_text: Array of text values (max 5 items)
  • array_number: Array of numeric values (max 5 items)

Advanced Schema (For complex/nested structures)

Use advanced schema for complex nested structures or when you need more control:

from pydantic import BaseModel

class Product(BaseModel):
    product_name: str
    price: float
    specifications: dict

resp = client.extract_image(
    image_url="https://img.com/prod.jpg",
    advanced_schema=Product  # Pass the class directly
)
print(resp.extracted_data)

Note: Either fields or advanced_schema must be provided, not both.

5. Compare Images

Compare two images and get a description of their similarities and differences.

resp = client.compare_images(
    image1_url="https://img.com/cat1.jpg",
    image2_url="https://img.com/cat2.jpg"
)
print(resp)

👤 User Endpoints

Check credits and submit feedback.

Get Credits

credits = client.get_credits()
print(credits)

Submit Feedback

feedback_response = client.submit_feedback(
    request_id="your-request-id",
    rating=5,  # Rating from 1-5
    feedback_text="Perfect image description!",
)
print(feedback_response)

⚡ Async Usage

All endpoints support async operations:

import asyncio
from viscribe.async_client import AsyncClient

async def main():
    client = AsyncClient(api_key="your-api-key-here")
    resp = await client.describe_image({"image_url": "https://img.com/cat.jpg"})
    print(resp)
    # ... use other endpoints as above

asyncio.run(main())

📖 Documentation

For detailed documentation, visit docs.viscribe.ai

🛠️ Development

For information about setting up the development environment and contributing to the project, see our Contributing Guide.

💬 Support & Feedback

  • 📧 Email: support@viscribe.ai
  • 💻 GitHub Issues: Create an issue
  • 🌟 Feature Requests: Request a feature
  • ⭐ API Feedback: You can also submit feedback programmatically using the feedback endpoint:
    from viscribe import Client
    
    client = Client(api_key="your-api-key-here")
    
    client.submit_feedback(
        request_id="your-request-id",
        rating=5,
        feedback_text="Great results!"
    )
    

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links


🎁 Get started with free credits! Visit dashboard.viscribe.ai to sign up and get your API key.

Made with ❤️ by ViscribeAI

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

viscribe-1.0.1.tar.gz (290.5 kB view details)

Uploaded Source

Built Distribution

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

viscribe-1.0.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file viscribe-1.0.1.tar.gz.

File metadata

  • Download URL: viscribe-1.0.1.tar.gz
  • Upload date:
  • Size: 290.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for viscribe-1.0.1.tar.gz
Algorithm Hash digest
SHA256 43d4802188a2f4b1bef448175e89ab64b9b0e5f7e3ec3cf473d4df09ffe79428
MD5 d97918eb5afb42d5819895bbc326b849
BLAKE2b-256 009cac42849c7136c9d0f3536e71e6736f621771e9d9cc55c74bb66d356b05b3

See more details on using hashes here.

File details

Details for the file viscribe-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: viscribe-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for viscribe-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0700c5de753d4bc4dcf41e1c84c53c35bd058c43bb85e610935fa5e8e2bfe5
MD5 c02d1d48665b24ed158f669dfea1d89e
BLAKE2b-256 7d6dca31706ab8ef665d32004c06f6b03ce28491b9b696e84a3225ee85882c56

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