Skip to main content

Official Python SDK for the HeroShots / StudioHero platform (JWT auth).

Project description

heroshots (Python SDK)

High-level Python client for the HeroShots / StudioHero platform, authenticated with a portal JWT. Covers the full JWT-reachable API surface.

Install

pip install heroshots          # from a registry
pip install -e ".[dev]"        # local dev (runs the test suite)

Requires Python 3.9+. Only runtime dependency: requests.

Authenticate

from heroshots import Client

# Email/password login (recommended): stores the JWT, auto re-logins on expiry.
# Base URL defaults to https://app.heroshots.ai.
client = Client.from_login("dev@partner.com", "secret")

# Or reuse an existing token.
client = Client(token="eyJ...")

Usage

# Local file paths are auto-uploaded to hosted URLs.
briefs = client.storyboard.brief_suggestions(
    product_image_url="product.jpg", subject_image_url="model.jpg",
    duration_seconds=30, language_code="it",
)

candidates = client.storyboard.candidates(
    custom_prompt=briefs[0], duration_seconds=30,
    product_image_url="product.jpg", subject_image_url="model.jpg",
)

job = client.storyboard.generate(
    custom_prompt=briefs[0], duration_seconds=30, selected_candidate=candidates[0],
    product_image_url="product.jpg", subject_image_url="model.jpg",
)
sb = client.storyboard.wait(job["job_id"])           # polls until done/failed

vjob = client.longvideo.start(image_url="product.jpg", storyboard=sb["storyboard"])
final = client.longvideo.wait(vjob["job_id"])
print(final["final_video_url"])                       # also: final.final_video_url

Responses support both result["key"] and result.key access. /api/v1 billing metadata is under result["_meta"].

Guide

For step-by-step examples organized by use case, read the full guide: GUIDE.md.

Resources

uploads · images · videos · longvideo · stilllife · storyboard · avatars

Plus on the client: login(), me(), balance(), stats().

Every method maps 1:1 to an endpoint; pass extra backend fields as keyword arguments (they are forwarded verbatim).

Errors

from heroshots import ValidationError, TokenExpiredError, RateLimitError

try:
    client.storyboard.candidates(custom_prompt="", duration_seconds=30,
                                 product_image_url="p.jpg")
except ValidationError as e:
    print(e.code, e.message, e.details)

Test

pytest          # offline, mocked HTTP

Billing

Generations cost credits. Check remaining credits with client.balance() (hs_credits + wallet_balance). Use client.stats() for the full raw /api/auth/stats payload, including recent generations and offered plans. See examples/full_storyboard_flow.py.

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

heroshots-0.2.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

heroshots-0.2.4-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file heroshots-0.2.4.tar.gz.

File metadata

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

File hashes

Hashes for heroshots-0.2.4.tar.gz
Algorithm Hash digest
SHA256 9dac9768f9d92d2b514522791192b894f7d0c7b4ee724ccd47a1e5353bd53846
MD5 749990f34e44b9ecb110b52a628a0e4b
BLAKE2b-256 c193e5f89c36692d30d52d22c22c5223862a1b3133c607b496856997dc1b4c0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for heroshots-0.2.4.tar.gz:

Publisher: publish.yml on JasonPriore/HeroShotsSDK-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file heroshots-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: heroshots-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for heroshots-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f25938cec86f3f07b1129d65308103afb9a3e7413bf9d8b7ab21fb69384395d
MD5 046797e8ad191a48c9fb7438b5234621
BLAKE2b-256 a666e78484495c753360d4b3ac52ed0d131269634bd5efd57db803b04141b288

See more details on using hashes here.

Provenance

The following attestation bundles were made for heroshots-0.2.4-py3-none-any.whl:

Publisher: publish.yml on JasonPriore/HeroShotsSDK-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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