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"].

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: heroshots-0.2.2.tar.gz
  • Upload date:
  • Size: 14.9 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.2.tar.gz
Algorithm Hash digest
SHA256 365c4c1dcbbc8c50c876479b63b7181833e51afba156b178d3ede87611136c89
MD5 877ffdcf6a01fac95178314e304e973a
BLAKE2b-256 92fffe165fde4e2de5c3b7e42e93492e3d6ae597e854746e1b845876403c7da5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: heroshots-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d102d9ce367d18075d1c467f16836f567ddd3ef0c5bda67d01be31716138582
MD5 5573e1c41b030ee61e7f86f07eceea77
BLAKE2b-256 3d079022d5281dd912dfcc5f4001c8598198598773baead1ce12a0a51bf2158e

See more details on using hashes here.

Provenance

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