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 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 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.2.tar.gz (290.6 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.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for viscribe-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f51a170e7c352e80b0ae7403af991b1d25e4ede37ba10b5537ddb15b6efd9332
MD5 cd6891ef4ac876a3d5572101f00737ab
BLAKE2b-256 77f32062cb7bb9d2840b0dda8e47d33699dbcaf4856734728bc1b465a171c6c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viscribe-1.0.2-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.12

File hashes

Hashes for viscribe-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b5994875b55580dc0ecfdcb76a510e9a38296c6894c3b48da2624ddda6b813f
MD5 102b6f464954b0e87b8b2cce5d1dcb1d
BLAKE2b-256 69253c2a44297e3dabb4678ce867fdc8f9d9550dc5200b115cf84724e56c69ca

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