Skip to main content

openavaban

Python SDK for openavaban-api — image gallery and profile management.

No API keys or database credentials needed. Just install and use.

Installation

pip install openavaban

Quick Start

from openavaban import OpenavaBan

client = OpenavaBan()

# Upload an image
result = client.upload("photo.jpg", name="Profile Photo", class_type="avatar")
print(result["url"])

# Search images
results = client.search(class_type="avatar", category="profile")
for img in results["results"]:
    print(img["name"], img["url"])

# Get random images
random_imgs = client.random(category="profile", count=5)

# Get image by ID
image = client.get("image_id_here")

# Update image
client.update("image_id_here", name="New Name", tags=["new", "tag"])

# Delete image
client.delete("image_id_here")

# Bulk upload from CSV
result = client.bulk_upload("images.csv")
print(f"Uploaded {result['success']}/{result['total']}")

API Reference

OpenavaBan(base_url=None)

Create a client. Defaults to the hosted API at https://openavaban-api.giripratik.com.np.

client = OpenavaBan()  # uses hosted API
client = OpenavaBan(base_url="http://localhost:3000")  # local dev

Methods

Method Description
upload(file, name, class_type, category="", tags=None, metadata=None) Upload an image file
bulk_upload(csv_path) Bulk upload from CSV
search(q=None, class_type=None, category=None, tags=None, mime_type=None, limit=30, offset=0) Search images
random(category=None, count=1) Get random images
get(image_id) Get image by ID
update(image_id, **kwargs) Update image fields
delete(image_id) Delete an image

Parameters

  • file: File path string or file-like object
  • class_type: "avatar" or "banner"
  • category: Free-text category string
  • tags: List of strings or comma-separated string
  • mime_type: Filter by "image" or "gif"
  • limit/max results: Capped at 100 for search, 20 for random

CSV Format (for bulk upload)

file_url,name,class_type,category,tags
https://example.com/photo1.jpg,Profile Photo,avatar,profile,"main,profile"
https://example.com/banner1.png,Social Banner,banner,social,"banner,v2"

Exceptions

Exception Description
APIError API request failed
InvalidClassError Invalid class_type (must be "avatar" or "banner")
NotFoundError Image not found
ValidationError Invalid file type, file too large, or missing fields

License

MIT

Metadata

Release files for openavaban 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openavaban 1.0.0
File Size Uploaded
openavaban-1.0.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openavaban 1.0.0
File Interpreter ABI Platform
openavaban-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / openavaban-1.0.0.tar.gz

Download URL openavaban-1.0.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
62481a71200ffbf317c661698c3cdf1ef16cf539ed817a55bd5b4f4d8dd8a829
BLAKE2b-256 checksum
How to use checksums
ae3b1a376f23b11342989f8abf74a1284a4aaac6c7855e94790b6c2854fb14d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / openavaban-1.0.0-py3-none-any.whl

Download URL openavaban-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27c2fa6990bfc1429ec5095046455a13e49cdc6ae6dd5f64e05b1aa5bcd160da
BLAKE2b-256 checksum
How to use checksums
b596dc7748bef3e4116150df6f7fe7511674a56354242fb26753cd8c2735813c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page