Skip to main content

SoManyLemons Python SDK

Typed Python client for the SoManyLemons Public API. Submit recordings, render branded reels and image quotes, manage brands and drafts — from any Python app, no MCP required.

Install

pip install somanylemons

Quickstart

from somanylemons import SMLClient

client = SMLClient(api_key="sml_your_key_here")

# List recent recordings (compact metadata — no URLs)
for job in client.jobs.list(limit=5):
    print(f"{job.id} · {job.title} · {job.clip_count} clips")

# Submit a video and wait for rendered clips
job = client.reels.create_and_wait(
    url="https://example.com/recording.mp4",
    brand_profile_id=1,
    asset_types=["videogram"],  # default; add "audiogram" or "image_quote" when needed
    caption_style="LEMON",
    timeout=600,
)
for clip in job.clips:
    print(clip.url)

# Render an image quote with a pinned template (deterministic output)
result = client.image_quotes.create(
    quote_text="Labor productivity is the story of the next five years.",
    brand_profile_id=1,
    template_id=42,
)
print(result.image_url)

Configuration

Arg / env var Default Notes
api_key / SML_API_KEY — (required) Your sml_xxx key
base_url / SML_API_URL https://api.somanylemons.com Override for QAS / local
timeout 30.0 Seconds per request
max_retries 3 Retries on 5xx and 429
client = SMLClient(api_key="sml_xxx", base_url="https://api.qas.somanylemons.com")

Resources

Attribute Endpoints
client.jobs List, get, poll recordings
client.reels Create reels (sync or blocking)
client.transcribe Transcribe URL or file
client.image_quotes Render branded quote images
client.brands Manage brand profiles
client.drafts Content queue
client.content Generate / score / rewrite posts, extract quotes, usage

Error handling

from somanylemons import QuotaError, RateLimitError, JobFailedError, SMLClient

client = SMLClient(api_key="sml_xxx")

try:
    job = client.reels.create_and_wait(url="...")
except QuotaError as exc:
    print(f"Over quota: {exc.renders_used}/{exc.render_limit}")
except RateLimitError as exc:
    print(f"Rate limited, retry after {exc.retry_after}s")
except JobFailedError as exc:
    print(f"Render failed: {exc.message}")

Async

The async client (AsyncSMLClient) lands in 0.2.0. For now, wrap sync calls in asyncio.to_thread.

Security

The SDK is built so that common mistakes cannot leak your API key:

  • Keys never appear in repr or logs. The client masks the key in its __repr__ and stores it in a _SecretStr wrapper. Explicit access requires .get().
  • HTTPS enforced by default. Passing an http:// URL raises SMLError unless you opt in with allow_insecure_http=True (e.g. for local dev against localhost:8000).
  • Foreign hosts rejected by default. Your base_url must be a SoManyLemons domain. If you need to point at a different host (a staging environment, a proxy), pass allow_foreign_host=True so the decision is explicit.
  • Sensible retries only. 5xx and 429 responses retry with exponential backoff; 4xx errors (auth, permissions, validation) fail fast without retry so bad keys don't hammer the server.

If you're integrating the SDK in a shared / multi-tenant app, create one SMLClient per tenant so a per-request key override is never necessary.

Contributing

The project follows PEP 517/621 so any Python toolchain works (pip, uv, poetry, rye, pixi). No lockfile is published — consumers use their own.

# Clone and install in editable mode with dev dependencies
git clone https://github.com/NoMiddleInc/somanylemons-sdk.git
cd somanylemons-sdk
pip install -e ".[dev]"

# Run the test suite (pytest + respx for HTTP mocking)
pytest

# Lint and type-check
ruff check src tests
mypy src

Publish flow (maintainers):

pip install build twine
python -m build
twine upload dist/*

License

MIT

Metadata

Release files for somanylemons 0.1.3

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

Source distribution (sdist)

Source distribution for somanylemons 0.1.3
File Size Uploaded Provenance
somanylemons-0.1.3.tar.gz 23.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 51.5 kB

Release files / somanylemons-0.1.3.tar.gz

Download URL somanylemons-0.1.3.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
312a59fd522a23543a25b98e7413230295b02dac211f6e54d6ec1ca4b89d8c5e
BLAKE2b-256 checksum
How to use checksums
8709fc1d73d6bc6df9caf010ae35527da8680939ab401783913548adc34b2512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2026.

Transparency log

Release files / somanylemons-0.1.3-py3-none-any.whl

Download URL somanylemons-0.1.3-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa4d583241f759279f6fa50ac0fd3e86f43f0c0cb25b0101d902fdad02d3c18
BLAKE2b-256 checksum
How to use checksums
b65e9e053961b7033cee0fe88d9498ed8f98bc7f1560b0a2069f846c5019151c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2026.

Transparency log

Security for somanylemons 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for somanylemons-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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