Releases: StemSplit/stemsplit-python
Releases · StemSplit/stemsplit-python
v0.1.0 - initial release
stemsplit-python v0.1.0 — initial release
First public release of the official Python SDK for the StemSplit hosted stem-separation API.
pip install stemsplit-pythonfrom pathlib import Path
from stemsplit_python import StemSplit
client = StemSplit(api_key="sk_live_...") # or set STEMSPLIT_API_KEY
job = client.jobs.create(audio=Path("song.mp3"), output_type="BOTH").wait()
job.download_all("./out/")What ships in v0.1.0
- Sync
StemSplitclient with sub-resources for every public endpoint:jobs,youtube_jobs,uploads,account,webhooks. - Killer ergonomics for the job lifecycle:
JobHandle.wait(),.iter_progress(),.refresh(),.download_all(). Pass aPath/bytes/ file-like tojobs.create(audio=...)and the SDK runs the presigned-URL upload dance for you. - YouTube jobs —
client.youtube_jobs.create(url=...), same lifecycle helpers, surfacesvideo_title,video_duration,channel_name, and thefull_audiooutput. - BPM and key detection typed on
Job.audio_metadataandYouTubeJob.audio_metadata. - Webhook signature verification in
stemsplit_python.webhooks—verify_and_parse(payload=..., signature=..., secret=...)returns a typedWebhookEventand raisesSignatureVerificationErroron mismatch. Constant-time HMAC-SHA256. - Stripe-style error hierarchy mapping the API's documented error codes 1:1:
BadRequestError(400),AuthenticationError(401),InsufficientCreditsError(402, with.required_seconds/.purchase_url),PermissionDeniedError(403),NotFoundError(404),RateLimitError(429, with.retry_after/.limit/.remaining/.reset_at),InternalServerError(5xx), plus logicalJobFailedError/JobExpiredError/SignatureVerificationError. - Retries with
Retry-After-aware backoff on429/5xxfor safe-to-replay verbs (defaultmax_retries=3). - Rate-limit awareness — every response's
X-RateLimit-*headers parsed and exposed viaclient.last_rate_limit. Idempotency-Keypassthrough onjobs.create,youtube_jobs.create,webhooks.create(lights up automatically once the server ships support).- pydantic v2 models — frozen, snake_case attrs aliased to camelCase wire fields,
Literalunions for status / quality / format,extra="allow"so unknown server fields don't crash callers. - Three runtime dependencies only:
httpx,pydantic,typing-extensions(Python 3.10 backport only). No PyTorch, no numpy, no native code. - Fully typed:
py.typedshipped,mypy --strictclean. - 62 tests, ~92% line coverage, all
respx-backed mocks.
Deferred
AsyncStemSplit— lands in v0.2 (the placeholder raisesNotImplementedErrorwith a pointer to the tracking issue).job.cancel()— the API does not yet exposeDELETE /jobs/{id}; honest omission, not a stub. Will land alongside the endpoint.- CLI — a separate
stemsplit-cliadd-on is planned for v0.2 so the SDK stays dependency-light.
Companion
Want to run inference locally without an API key? Install demucs-onnx — same model family, runs in pure ONNX Runtime.
Links
- PyPI: https://pypi.org/project/stemsplit-python/0.1.0/
- Developer guide: https://stemsplit.io/developers/docs
- API reference: https://stemsplit.io/developers/reference
- Changelog: https://github.com/StemSplit/stemsplit-python/blob/main/CHANGELOG.md