Official Python SDK for the Forgefy Developer API — transcripts in, structured product requirements out.
Project description
forgefy
Official Python SDK for the Forgefy Developer API — transcripts in, structured product requirements (features, open questions, conflicts, action items) out.
Python 3.10+. One dependency (httpx).
pip install forgefy
Quick start
import os
from forgefy import Forgefy
client = Forgefy(
api_key=os.environ["FORGEFY_API_KEY"], # fgy_live_… from the dashboard's Developers page
base_url="https://your-forgefy-host", # or set $FORGEFY_API_URL
)
result = client.extract(
"We need Google login before launch. Sarah owns billing.",
extractors=["features", "action_items"], # optional — omit to run all four
)
for f in result["features"]:
print(f"[{f['priority']}] {f['title']}")
print(result["usage"]) # {"input_tokens": ..., "output_tokens": ...}
Long transcripts (async jobs)
job = client.jobs.create(
long_transcript, # up to 200k chars
webhook_url="https://yourapp.com/hooks/forgefy", # optional
)
# Either wait by polling…
done = client.jobs.wait_for(job["job_id"]) # raises JobFailedError / JobTimeoutError
print(done["result"])
# …or verify the webhook delivery instead:
from forgefy import verify_signature
@app.post("/hooks/forgefy")
async def hook(request):
raw = await request.body() # raw bytes — verify BEFORE parsing JSON
if not verify_signature(raw, request.headers.get("x-forgefy-signature"), job["webhook_secret"]):
return Response(status_code=401)
event = json.loads(raw) # {"type", "job_id", "status", "result"?, "error"?}
return Response(status_code=200)
jobs.create() sends an auto-generated Idempotency-Key, so a network-level
retry can never run the same job twice. Pass idempotency_key= yourself to
dedupe across processes.
Errors
All API failures raise typed subclasses of ForgefyError with .status and .detail:
| Class | When |
|---|---|
AuthenticationError |
401 — bad or revoked key |
QuotaExceededError |
402 — monthly tokens exhausted (free tier); detail has the reset date |
NotFoundError |
404 |
ValidationError |
422 |
RateLimitError |
429 — 60 req/min per key (retried automatically first) |
ServerError |
5xx |
APIConnectionError |
no HTTP response at all |
Retry behavior: 429 and network errors are always retried (default 2 retries,
exponential backoff, Retry-After honored). 5xx is retried only where safe —
GETs and idempotent job creation, never the sync extract() (a retry would
bill tokens twice).
Quota
usage = client.usage()
# {"tier", "monthly_tokens", "tokens_used", "tokens_remaining", "resets_at"}
Paid accounts over budget aren't blocked — requests are served by the free
economy model instead. Check result["model_tier"] to see which tier answered.
Development
# from forgefy-backend/, using its venv (httpx + pytest already installed)
python -m pytest sdks/python/tests -q
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgefy-0.1.0.tar.gz.
File metadata
- Download URL: forgefy-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77d2a76d32a066d822ae6fa83826cc633b30eba636c3f131388fb6298cc9a7d1
|
|
| MD5 |
d3cb0ba9e15701173aeea61d1526455f
|
|
| BLAKE2b-256 |
e4083a7c1a52335d8174d546896450027fb828ea1cb300151245c1f996b23f74
|
File details
Details for the file forgefy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: forgefy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d53cd6f12e029b16b412eaeec6b6256658cc418d5168df475b2646cb063af5c0
|
|
| MD5 |
859ad4ad0be25912f74deb7e122875cf
|
|
| BLAKE2b-256 |
64912a0f7d33fc37ff76ebd960152c15194d871d926ea6b7961a0e7af86022b6
|