PYPI PACKAGE AUDIT v0.6.0 Healthy Package

scriptivox

Official Python SDK for the Scriptivox transcription API: upload, transcribe, wait, export SRT/VTT/text, list, and verify webhooks.

PyPkgScore scriptivox
Methodology & Criteria ♥ Donate
655 / 1000
Quick Install
pip install scriptivox
1. Governance
50/200
2. PEP Metadata
200/200
3. Security
150/200
4. Docs & SEO
155/200
5. CI Engineering
100/200
📣 Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
270
Last 30 days
581
Total (180 days)
581
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✕ Not detected PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 655 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community50 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✕ 0 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP Metadata & Packaging200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Security & Supply Chain150 / 200 ▾
Zero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✕ 0 pts
Snyk / Audit Link✓ 40 pts
HTTPS Repository✓ 50 pts
4. Documentation, SEO & Ecosystem155 / 200 ▾
Structured README✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Website / Technical Articles✓ 45 pts
5. Engineering, CI & Quality100 / 200 ▾
Automated Tests✓ 65 pts
GitHub Actions CI✕ 0 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✕ 0 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide — scriptivox

PyPI Metadata v0.6.0
Show full original documentation (English README) ▾

Scriptivox Python SDK

The official Python client for the Scriptivox transcription API. Upload a file or pass a link, wait for the transcript, export SRT, VTT or text, list your jobs and verify webhooks. Sync and asyncio clients, typed responses and one exception class per error code.

  • Python 3.9 or newer. One dependency: httpx.
  • Every submit carries an Idempotency-Key, so a retried call never starts a second job.
  • Large files are streamed from disk, never read into memory.

Install

pip install scriptivox

Quickstart

Create an API key on the API Keys page and add balance on the Billing page.

from scriptivox import Scriptivox

client = Scriptivox()  # reads SCRIPTIVOX_API_KEY, or pass api_key="sk_live_..."

job = client.transcribe(file="meeting.mp3", language="en")
done = client.wait(job["id"])
print(done["result"]["full_transcript"])

From a public link (direct file links, Google Drive, Dropbox and OneDrive share links, and public TikTok, Instagram, Facebook, X and Snapchat posts):

job = client.transcribe(url="https://example.com/podcast.mp3", diarize=True, speaker_count=2)
reel = client.transcribe(url="https://www.instagram.com/reel/C0nT3stR33l/")

A social post is checked when you send it, so that call takes a few seconds. A post that is private, deleted or has no video raises UrlNotAccessibleError at once (e.error.get("reason") says why, e.error.get("platform") names the site), and nothing is created or charged.

Pass language when you know it: it is faster and more accurate than auto-detection. Omit it to auto-detect.

Captions and plain text

srt = client.get(job["id"], format="srt", max_words=4)
vtt = client.get(job["id"], format="vtt", include_speakers=True)
text = client.get(job["id"], format="text", include_timestamps=True)

format="json" (the default) returns the whole job. The caption options are max_words, max_chars, max_duration, sentence_aware, include_speakers, strip_chars and, for text, include_timestamps. See caption export.

Upload with progress

def show(p):
    print(f"{p.percent:5.1f}%  {p.loaded}/{p.total} bytes")

upload = client.upload("lecture.mp4", on_progress=show)
job = client.transcribe(upload_id=upload["upload_id"])
# or in one call:
job = client.transcribe(file="lecture.mp4", on_upload_progress=show)

file can be a path, bytes, or a binary file object (open(path, "rb")). For bytes or a stream without a name, pass filename="audio.mp3". A non-seekable stream also needs size=. Filenames are made ASCII-safe for you (Réunion.mp3 is sent as Reunion.mp3).

Transcribe again with other options

A finished job can be transcribed again from the audio Scriptivox still holds, with another language or speaker labels: no upload, no download. It is a new job, charged like any other. The options are this call's own (omit language and it is detected again).

from scriptivox import SourceExpiredError

try:
    again = client.transcribe_again(job["id"], language="es", diarize=True)
    done = client.wait(again["id"])
except SourceExpiredError:
    pass  # the audio is kept 24 hours after a job ends: send the file again with transcribe(file=...) or url=

Waiting

wait(id) polls until the job ends. It waits 2 s between polls at first, growing to 10 s, and longer when a check of an unfinished job answers with a longer Retry-After (up to 60 s). It also honours Retry-After when rate-limited. It returns the completed job. A job that fails raises TranscriptionFailedError, whose code is the job's error.code:

from scriptivox import TranscriptionFailedError

try:
    done = client.wait(job["id"], timeout=3600)
except TranscriptionFailedError as e:
    print(e.code, e.transcription["error"]["message"])  # e.g. URL_NOT_ACCESSIBLE

Failed and cancelled jobs cost nothing. Prefer webhooks to polling for long files.

Listing, cancelling, deleting, balance

for t in client.list(status="completed"):      # follows the cursor page by page
    print(t["id"], t["audio_duration_seconds"])

client.cancel(job_id)    # before transcription starts; not charged
client.delete(job_id)    # a finished job and its transcript
b = client.balance()
print(b["available_cents"], b["auto_topup"]["enabled"])

list() takes status, from_, to (datetime or ISO string), limit (page size) and order. Items leave out result; get(id) has it.

Webhooks

Pass webhook_url when you submit, and check every request with verify_webhook. It needs the raw body, your key's webhook signing secret (whsec_…, on the API Keys page) and the request headers. It refuses a bad signature and a timestamp more than 5 minutes old.

import os
from fastapi import FastAPI, Request, Response
from scriptivox import verify_webhook, WebhookVerificationError

app = FastAPI()

@app.post("/scriptivox")
async def scriptivox_webhook(request: Request):
    try:
        event = verify_webhook(await request.body(), request.headers, os.environ["SCRIPTIVOX_WEBHOOK_SECRET"])
    except WebhookVerificationError:
        return Response(status_code=400)
    delivery_id = request.headers["x-scriptivox-delivery"]  # the same on every retry: skip ones you have handled
    if event["event"] == "transcription.completed":
        print(event["transcription_id"], event["result"]["full_transcript"][:80])
    elif event["event"] == "transcription.failed":
        print(event["transcription_id"], event["error"]["code"])
    return Response(status_code=200)

Flask: verify_webhook(request.get_data(), request.headers, secret). Django: verify_webhook(request.body, request.headers, secret).

client.test_webhook("https://your.server/scriptivox") sends a signed webhook.test event and tells you what your server answered. client.resend_webhook(job_id) sends a finished job's final event again.

Errors

Every error extends ScriptivoxError. When the API answers with an error you get an APIError subclass named after its error.code, under a class for its HTTP status:

from scriptivox import APIError, PaymentRequiredError, RateLimitExceededError, ZeroBalanceError

try:
    client.transcribe(url="https://example.com/a.mp3")
except ZeroBalanceError:
    print("Add funds on the Billing page")
except RateLimitExceededError as e:
    print("Too many jobs in progress:", e.error.get("in_flight"), "of", e.error.get("limit"))
except APIError as e:
    print(e.status, e.code, e.message, e.request_id)  # quote request_id to support
Class When
BadRequestError (400): InvalidRequestError, InvalidFilenameError, InvalidMediaFormatError, … The request is wrong; fix it, do not retry
AuthenticationError (401): InvalidApiKeyError, ApiKeyRevokedError The key is missing, wrong or revoked
PaymentRequiredError (402): InsufficientBalanceError, ZeroBalanceError Add balance
NotFoundError (404): TranscriptionNotFoundError, UploadNotFoundError Wrong id
ConflictError (409), IdempotencyKeyLockedError Not allowed in the job's current state
RateLimitError (429): RateLimitExceededError Too many requests, or too many jobs in progress
InternalServerError (5xx), ServiceUnavailableError (503): MaintenanceError (see Maintenance), LinkCheckUnavailableError Our side; safe to retry after e.retry_after seconds
APIConnectionError, APITimeoutError No answer
UploadFailedError The file upload itself failed
TranscriptionFailedError wait(): the job ended failed
WaitTimeoutError wait(): still running at the timeout
WebhookVerificationError verify_webhook(): not a genuine, fresh webhook

The full list of codes is in the API reference.

Maintenance

Now and then part of the API is paused for maintenance. A paused request answers 503 MAINTENANCE and the SDK raises MaintenanceError: nothing was created or charged, so send the same request again later. Jobs already accepted always finish.

from scriptivox import MaintenanceError

try:
    client.transcribe(file="meeting.mp3")
except MaintenanceError as e:
    print(e.message)      # what is paused, with our message
    print(e.scope)        # "upload", "link" or "global"
    print(e.back_by)      # when we expect it back (ISO 8601, UTC), or None
    print(e.retry_after)  # seconds to wait before sending it again
    print(e.status_url)   # the status call below

status() says whether the API is taking new jobs, before you send any. It needs no API key (the call is limited per IP):

import scriptivox

s = scriptivox.status()  # or client.status(); await scriptivox.async_status() in asyncio
if s["accepting_new_jobs"] is False:
    for p in s["maintenance"]["paused"]:
        print(p["name"], p["message"] or "", p["back_by"] or "")
    print("Try again in", s["maintenance"]["retry_after_seconds"], "seconds")
elif s["status"] == "unknown":
    print("Could not check just now")  # not the same as "down"
  • status is operational, maintenance or unknown. unknown means the state could not be checked just now, not that the API is down; the fields that could not be checked are then None.
  • Scope link: only links to video and social media sites are paused on transcribe(). Uploads and other file links carry on, so accepting_new_jobs stays True.
  • Full maintenance (a few minutes, for example during a planned upgrade) pauses every call, reads included: scope global and an empty still_working. wait() waits it out and carries on polling.
  • If the status call itself gets no answer, status() raises APIConnectionError. It never reports "all fine" from a failed call.
  • Uptime and incident history: status.scriptivox.com.

Retries, timeouts and idempotency

  • Requests that are safe to repeat (reads, deletes, cancels and submits with an Idempotency-Key) are retried up to 2 times after a dropped connection or a 5xx, waiting longer before each try (0.5 s, 1 s, 2 s, …).
  • A 429 or 503 with Retry-After is retried after that many seconds, if it is 60 s or less. A 429 without Retry-After (the jobs-in-progress cap) is raised at once. A maintenance pause usually asks for 5 minutes or more, so its MaintenanceError is raised for you to handle (see Maintenance).
  • upload() and transcribe() send a new random Idempotency-Key per call, reused on the SDK's own retries. Pass idempotency_key= (for example your own record id) to make a retry after a crash safe too.
client = Scriptivox(max_retries=4, timeout=30.0)  # timeout per request, in seconds

asyncio

import asyncio
from scriptivox import AsyncScriptivox

async def main():
    async with AsyncScriptivox() as client:
        job = await client.transcribe(file="meeting.mp3", language="en")
        done = await client.wait(job["id"])
        async for t in client.list(status="completed"):
            print(t["id"])

asyncio.run(main())

Configuration

Setting Argument Environment variable Default
API key api_key SCRIPTIVOX_API_KEY none (required)
Base URL base_url SCRIPTIVOX_BASE_URL https://api.scriptivox.com
Retries max_retries 2
Request timeout (s) timeout 60
Your own httpx client http_client a new httpx.Client

Responses are plain dicts, typed with TypedDicts generated from the OpenAPI document (scriptivox.Transcription, scriptivox.Balance, …).

Development

python scripts/generate.py            # regenerate _types.py and _error_codes.py from openapi/openapi.json
python scripts/generate.py --fetch    # refresh the snapshot from platform.scriptivox.com first
pip install -e '.[dev]' && pytest     # unit tests, no network

# integration tests against a test deployment
SCRIPTIVOX_API_KEY=sk_live_... SCRIPTIVOX_BASE_URL=https://api-test.scriptivox.com pytest tests/test_integration.py

License

MIT