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().

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 + plan.wallet_balance). 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.3.tar.gz (15.0 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.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heroshots-0.2.3.tar.gz
  • Upload date:
  • Size: 15.0 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.3.tar.gz
Algorithm Hash digest
SHA256 dbb1102f68aee6d714b00a89c8eeb49c25850fcd913e503ea1cacaabcd4abc5a
MD5 e163a5a268e5ae8e50556fac8c1f193b
BLAKE2b-256 32f5a31a73c20738aee2bba2bd78e8e8bd2be65ab78be791de37511846639a6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for heroshots-0.2.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: heroshots-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 761da531e056e03e0f36201550c2bc375f6ce84bb325ca62112c1eb53454bc87
MD5 306839c0b3af059f84d2d1f42b957129
BLAKE2b-256 2f25c10094ef592bd13b381577b882f6832ec36499769057eb60343206960333

See more details on using hashes here.

Provenance

The following attestation bundles were made for heroshots-0.2.3-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