pyfj
A fully typed Python client for the Forgejo API — async-first, with a complete sync mirror.
Highlights
- Complete — every operation in the Forgejo 16 API is callable, generated from a vendored spec.
- Typed — pydantic v2 models for every schema, annotations everywhere, and a
py.typedmarker. - Dual —
Forgejo(sync) andAsyncForgejo(async) over httpx, with identical surfaces. - Ergonomic — resource namespaces, keyword arguments, lazy
Paginated[T]lists, and typed exceptions.
Quickstart
from pyfj import Forgejo
with Forgejo("https://codeberg.org", token="...") as client:
repo = client.repos.get("forgejo", "forgejo")
print(repo.full_name)
for issue in client.repos.issues.list("forgejo", "forgejo", state="open"):
print(f"#{issue.number} {issue.title}")
The async flavour is the same code with AsyncForgejo, async with, and async for.
Where to next
- Getting started — install forgejo-python, authenticate, and make your first requests.
- Guides — authentication, pagination, errors, impersonation, and the escape hatch.
- Architecture — the public surface and runtime behaviour, in depth.