record immutable git and build intel into your python artifacts
Project description
pathivu
record immutable git and build intel into your python artifacts.
pathivu (Tamil: பதிவு) means "record" or "entry" — a permanent log of what an artifact is, inscribed into the artifact itself at build time.
once a wheel or docker image is built, it is often hard to tell what exactly
is in it: which commit, which tag, when it was built, what dependencies
resolved. pathivu runs right before the build and writes an _about.json
inside your package. your app reads it back at runtime — e.g. through a
simple /about endpoint — so the artifact can describe itself.
install
pip install pathivu
# with adapters:
pip install "pathivu[fastapi]"
pip install "pathivu[flask]"
use
at build time:
pathivu my-api "I serve users"
# writes src/my_api/_about.json
python -m build
at runtime:
from pathivu import read_about
about = read_about("my_api")
what the about file looks like
{
"about": { "app_name": "my-api", "description": "I serve users" },
"git": {
"commit_id": "4fc2eea",
"version_tag": "v0.1.0",
"branch": "main",
"repo_url": "git@github.com:you/my-api.git",
"commit_time": "2026-04-21T15:28:40+05:30",
"author": "You",
"message": "initial: bootstrap"
},
"pkg": { "name": "my-api", "version": "0.1.0", "description": "..." },
"deps": {
"fastapi": {
"version": "0.136.0",
"depends_on": { "starlette": { "version": "1.0.0" }, "pydantic": { "...": "..." } }
}
},
"described_at": "2026-04-21T09:58:55+00:00"
}
missing pieces (no git, no tag, no pyproject) are omitted — pathivu never
blocks a build on missing intel. it is observational, not prescriptive.
wiring it into your build
uv
pathivu my-api "desc" && uv build
hatch
pathivu my-api "desc" && hatch build
poetry
pathivu my-api "desc" && poetry build
setuptools / build
pathivu my-api "desc" && python -m build
makefile (tool-agnostic)
build:
pathivu my-api "$$(git log -1 --pretty=%s)" && python -m build
making sure _about.json lands in the wheel
pathivu writes to src/<pkg>/_about.json by default. if you use the
standard src layout with hatchling / setuptools / poetry, package data
under the package directory is included automatically. for unusual layouts,
pass --out <path> to pathivu and adjust your build tool's include rules
accordingly.
reading it back in a web app
fastapi
from fastapi import FastAPI
from pathivu.frameworks.fastapi import about_router
app = FastAPI()
app.include_router(about_router("my_api"))
# GET /about -> the full about dict
custom path:
app.include_router(about_router("my_api", path="/meta"))
flask
from flask import Flask
from pathivu.frameworks.flask import about_blueprint
app = Flask(__name__)
app.register_blueprint(about_blueprint("my_api"))
any framework (manual)
from pathivu import read_about
about = read_about("my_api") # returns a dict; you handle serving it
cli reference
pathivu <app-name> [description]
[--out PATH] custom output path
[--pyproject PATH] pyproject.toml location (default ./pyproject.toml)
[--exclude-transitive list] comma-separated deps whose subtree collapses to "..."
python -m pathivu ... is equivalent.
develop
pip install -e ".[dev]"
pytest
ruff check .
license
MIT
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 pathivu-0.1.0.tar.gz.
File metadata
- Download URL: pathivu-0.1.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
958e45e1e6a4885c8bb654b0700c531f0c6b4bf3364a1a4174e3d3027cf463f5
|
|
| MD5 |
a0893ef555d5e1a961ae4a0fc234eef5
|
|
| BLAKE2b-256 |
8599d0d66b69bb9849a1d4abd7a1fa90684b445bfacd813a8fd9c67f88591fbf
|
File details
Details for the file pathivu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pathivu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb548005325407bd66d80d479be6b8f996903c0301e74dcf666a5a4deeabae02
|
|
| MD5 |
7ff826472d982e451a7f98a4a74506b1
|
|
| BLAKE2b-256 |
50cae7a1a2e5ae2d3dc550a01db6d7f5641c91ac0c1aeef2633b27fc6c44a6d6
|