Skip to main content

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 .

credits

the idea comes straight from tag by Anatoly — a lovely little clojure tool that does the same thing for jvm artifacts. pathivu is a humble python take on the same idea, written because our python builds deserved it too. all credit for the shape of this goes upstream.

license

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathivu-0.1.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathivu-0.1.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file pathivu-0.1.1.tar.gz.

File metadata

  • Download URL: pathivu-0.1.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pathivu-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ded45ed3f0bcdea205e96a6dcc60ef71488dc2836ee4398df4530e0d294fbf7
MD5 fbf77f9e73ffa3c8d334406a0627a21b
BLAKE2b-256 8b5ae461cf8f43c9e70bf35617c48ef09ca517bae1891d4285cab4774154dc68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathivu-0.1.1.tar.gz:

Publisher: publish.yml on Iyalvan/pathivu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pathivu-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pathivu-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pathivu-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 762efde25a0f316564d2e19572503afbedf00eee330d6d060e681370d6338b2c
MD5 3fba3210515eb7f9ca1e4172dccea5ad
BLAKE2b-256 4d299199459dfc1b4f25543ff870f353601e43144a0b59b3bd077a78120447b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathivu-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Iyalvan/pathivu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page