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, presigned download and upload links, browser upload forms 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.2.1

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.2.1
File Size Uploaded Provenance Actions
forktex-1.2.1.tar.gz 39.8 kB Without provenance Details for forktex-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 112.9 kB

Release files / forktex-1.2.1.tar.gz

Download URL forktex-1.2.1.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1bbc115043ee99d804a03a96ca12bdc35c2f208136c2f953dbb80b8c8849380f
BLAKE2b-256 checksum
How to use checksums
f535334e14c6f6b8c0ef20a1e3a55803a1db811404631e6f68a01a16b3381987
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.2.1-py3-none-any.whl

Download URL forktex-1.2.1-py3-none-any.whl
Size 73.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63914a768c168f85b9b8eb2d3770e22642cb9010fdc4ec446a898bd74db2cdc1
BLAKE2b-256 checksum
How to use checksums
87049d661993b81f9e98d345c93fe0bd2faf74a800f9d29381e4718e8f91b312
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.2.1

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