Shared infrastructure (typed exceptions, central config, structured logging + tracing) for MGF projects
Project description
mgf-common
The cornerstone library for the Magogi ecosystem. Typed exceptions + layered configuration + structured logging + OTel + crash reporting + vault + process management + FastAPI/Django/ alembic adapters — bundled into one PEP 561 typed package so every Magogi project (and any compatible consumer) inherits the same shape.
Status: pre-1.0 (current
0.24.0). API stable enough that three real consumers (VManager Qt desktop, inthewords Django, PlasmaMapper FastAPI) ship with it. Public names areexperimentalper AP-11; promoted tostableafter one full MINOR cycle without a 🔴 Blocker filed against them.
Pick your starting point
The docs are organised by audience. Pick one:
| If you are… | Read |
|---|---|
| Evaluating mgf-common (right library for me?) | docs/audience/shoppers.md |
| Building with it (already adopted) | docs/audience/users.md |
| Contributing or designing alongside | docs/audience/developers.md |
| A test/QA engineer | docs/audience/qa.md |
| Cutting releases / running CI | docs/audience/release.md |
| Doing a security review | docs/audience/security.md |
| An AI agent (Claude or other) | docs/audience/ai-agents.md |
If you don't fit any of these neatly: docs/audience/README.md
is the meta-routing index.
If you just want to try it: see
docs/tutorial.md (zero → working app in
~30 minutes).
At a glance
import mgf.common as mc
with mc.bootstrap(app_name="myapp", app_version="1.0") as ctx:
# identity + logging + OTel + excepthooks all wired transactionally
do_work()
# Clean shutdown on context-exit; LIFO rollback on any startup failure.
from mgf.common.process import Service, AllOf, PortReady, LogLineReady
with Service(
["postgres", "-D", str(db_dir), "-p", str(port)],
ready=AllOf([
PortReady("127.0.0.1", port),
LogLineReady(r"database system is ready"),
]),
timeout_s=20.0,
) as svc:
run_my_integration_tests(port=port)
# Service stopped + process group cascaded on context-exit.
More: docs/recipes/ (17 cookbook patterns)
and PUBLIC_API.md (full surface).
Top-level files
| File | Purpose |
|---|---|
STARTHERE.md |
Two-flow navigation hub (new project vs catching up an existing one) |
FEEDBACK.md |
Living queue of consumer-filed feedback (the relay process driver) |
CHANGELOG.md |
Per-release short-form (Keep-a-Changelog format) |
PUBLIC_API.md |
Full public surface, table-form |
PUBLIC_API.json |
Auto-generated machine-readable surface |
SECURITY.md |
Vulnerability reporting policy (per SC-12) |
CONTRIBUTING.md |
Dev setup + the four green gates + PR process |
Consumers using it today
- VManager — Qt desktop, libvirt VM toolkit (reference consumer; co-designed)
- inthewords — Django web app (canonical web consumer)
- PlasmaMapper — FastAPI scientific platform ("small consumer" scope discipline)
License
MIT. See LICENSE.
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 mgf_common-0.28.0.tar.gz.
File metadata
- Download URL: mgf_common-0.28.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83c33cbc2fca62f20fd266ce754be02828d40fd4f6757dcc798692b446e96d22
|
|
| MD5 |
a4247e4b9220b9d5bcbbb72c8f8c9e89
|
|
| BLAKE2b-256 |
1daefddfb23c4b5c694070019f7f162473843d87d952f8f9444d80194ab0dda3
|
File details
Details for the file mgf_common-0.28.0-py3-none-any.whl.
File metadata
- Download URL: mgf_common-0.28.0-py3-none-any.whl
- Upload date:
- Size: 467.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b11e6908e6142e62cbcec33deed400eeb9c29bfb97f1930bb717f717705963a4
|
|
| MD5 |
7bcf94f2c95b1e702c28b1c829dd5c45
|
|
| BLAKE2b-256 |
16ab6e7e46ffdc2fae2c998909112c1f3849aac34fb5d5c0cd215ed9dc128dcc
|