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.3.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.3-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viscribe-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1178a7bdca3359b7133024722f1967b9bbed69a8ea03b64f94bf76e6ce88f932
MD5 ef19ff8b00c01999d1e3545e1cf99488
BLAKE2b-256 d002611d84b3f7c157ee3376e67e0856df47fac4013b6c212b94591ed9c77f2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viscribe-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c04e8c927885f1955591398c7a39f4a4c2ba0ba82ebb86fca8a6893221719d7
MD5 2eaf38a2d103a23461f8df0791299014
BLAKE2b-256 605c2344cdaa1ec5be7f37c1c619a5003abcbcb6994f02520af3561a444070f7

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