Skip to main content

forktex

PyPI Python License

The shared Python substrate for ForkTex services.

Logging, errors, typed models, PostgreSQL, Redis, S3 and a FastAPI app factory. Use one module or all of them: each works on its own, and importing one does not load the others.

pip install forktex
from forktex.api import AppConfig, create_app
from forktex.error import NotFoundError
from forktex.log import get_logger

log = get_logger(__name__)
app = create_app(AppConfig(title="Notes"))


@app.get("/notes/{note_id}")
async def get_note(note_id: str) -> dict:
    log.info("note requested")  # carries the request's trace id
    raise NotFoundError(f"note {note_id} not found")
    # → 404 {"code": "not_found", "message": "note n2 not found", "details": {}, "traceId": "…"}

Requirements

Python 3.14
Install One package, no extras: every module ships with it.
Infrastructure Only what the modules you use need: PostgreSQL for database, Redis for cache, any S3-compatible server for storage.

What you can do

You want to Read
Use one module Its page, linked above
Build a web service, adding modules as you need them The guide: an app first, then a database, a cache, file uploads
Run something outside a web app (a worker, a script) The module's page: every module except api works without FastAPI

Modules

Module What you get Needs
Basics log Structured JSON logs, with a trace id that follows each request, job and thread —
error One error hierarchy with stable codes, and the JSON envelope clients receive —
types Pydantic base models: camelCase on the wire, frozen value objects, UTC datetimes —
iso Datetimes to and from text, always in UTC —
Infrastructure database Transactions, ORM models, CRUD, pagination, safe client filters, advisory locks, SQL migrations PostgreSQL
cache get/set, a @cached decorator with stale-while-revalidate, key invalidation Redis
storage Upload, download, metadata and listings; presigned links and upload forms the store holds to a key, a size and a SHA-256, including multipart Any S3-compatible server
App factory api A FastAPI app with error envelopes, trace ids, security headers, CORS and health checks FastAPI (included)

Every module page starts with a complete example you can copy and run, then lists the module's functions, its errors and the things to know.

Documentation

Page For
Guide One web service, built a module at a time
log · error · types · iso The basics, one page per module
database · cache · storage · api The infrastructure and the app factory, one page per module

Stability

From 1.0.0, semantic versioning covers every name in each module's __all__. Anything else is internal and may change in any release. Changes are listed in the CHANGELOG.

Contributing

Working on forktex itself? Start with docs/development.md.

Licence

AGPL-3.0-or-later, or a commercial licence from FORKTEX S.R.L. (info@forktex.com). See LICENSE and NOTICE.

Metadata

Release files for forktex 1.3.0

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

Source distribution (sdist)

Source distribution for forktex 1.3.0
File Size Uploaded Provenance Actions
forktex-1.3.0.tar.gz 42.3 kB Without provenance Details for forktex-1.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 119.0 kB

Release files / forktex-1.3.0.tar.gz

Download URL forktex-1.3.0.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
799181e66431f5761725ab60a745755c6a5d8b3e3b9aa19b9e9dcd35d068c3d7
BLAKE2b-256 checksum
How to use checksums
38667aad627cda5fb877d8db23b18a7be0790309f0a736c468ca4d2507682bb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / forktex-1.3.0-py3-none-any.whl

Download URL forktex-1.3.0-py3-none-any.whl
Size 76.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09c8ea3c932e6071661c64b25d7cd14cf152adb4d79def2498aab251067a2482
BLAKE2b-256 checksum
How to use checksums
742d33ffa80e25b6c3c380ba19386f3b84e826dd34445ae8e0586ff600c6c23d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for forktex 1.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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