Cryptographic PDF tracking for LaTeX with optional PDF protection and encrypted audit logs.
Project description
TrustNoCorpo
Cryptographic PDF tracking for LaTeX builds — with optional PDF password protection and an encrypted audit log per project.
Track who built what, when, and how — directly from your LaTeX toolchain or Python.
Features
- 🔒 Encrypted audit log stored locally under .trustnocorpo/
- 🔐 Optional PDF password protection (via pypdf)
- 🧰 Drop-in CLI for initializing projects and building PDFs
- 🐍 Python API for programmatic builds
- 🧪 Testing without LaTeX (LaTeX calls are mocked in tests)
Quick start
Install (editable)
python3 -m pip install -e .
Run tests
pytest -q
Initialize a project
trustnocorpo init
This creates a .trustnocorpo/ workspace in your repo and copies helpful templates (e.g., a Makefile).
Build a document (CLI)
trustnocorpo build path/to/document.tex --classification=CONFIDENTIAL
# or shorthand:
trustnocorpo path/to/document.tex --classification=CONFIDENTIAL
The --classification flag lets you tag builds (e.g., INTERNAL, CONFIDENTIAL, SECRET) in the encrypted audit trail.
Python API
from tnc.core import trustnocorpo
cms = trustnocorpo()
cms.init_project() # creates .trustnocorpo/ if missing
pdf_path = cms.build("document.tex", classification="SECRET")
print("PDF:", pdf_path)
Makefile template
A portable Makefile is provided at example/Makefile. Typical usage:
# Adjust as needed
DOC ?= document.tex
CLASS ?= CONFIDENTIAL
.PHONY: pdf
pdf:
# Build with tracking + classification label
trustnocorpo $(DOC) --classification=$(CLASS)
.PHONY: init
init:
trustnocorpo init
Use make init once per repo; make pdf thereafter.
Requirements & notes
- LaTeX toolchain (e.g., pdflatex/xelatex) is only required when you actually compile PDFs.
- Tests do not require LaTeX; they mock the LaTeX layer.
- PDF protection: implemented with PyPDF2.
- Audit storage: encrypted SQLite database lives under .trustnocorpo/ within your project directory.
CLI availability
The trustnocorpo command is installed via the package’s console script entry point.
After pip install -e ., ensure your environment is active and your shell can see the script on PATH. If not:
- Activate your virtualenv (source venv/bin/activate) or
- Rehash your shims (e.g., hash -r in bash/zsh) or
- Run via python -m tnc.cli as a fallback.
For all options:
trustnocorpo --help
How it fits in your LaTeX workflow
- Initialize once per repository: trustnocorpo init.
- Build via CLI or your Makefile: trustnocorpo path/to.tex --classification=INTERNAL**.**
- Ship the PDF; the build metadata (who/when/what) is logged encrypted in .trustnocorpo/.
You keep full control: all tracking is local to your project unless you choose to export logs.
Troubleshooting
- trustnocorpo: command not found Activate your virtual environment or re-open your shell; confirm pip show lists the package.
- LaTeX not found Ensure pdflatex/xelatex is on PATH. Only needed for real builds, not for tests.
- PDF not protected as expected Verify you passed the appropriate protection options (see --help) and that the output path isn’t being overwritten by another tool.
Contributing
PRs welcome! Please:
- Add or update tests for new behavior.
- Keep CLI and Python API examples in this README in sync.
- Run pytest -q before submitting.
License
See LICENSE in the repository.
Appendix: Design goals
- Minimal friction for LaTeX users (works with existing Makefiles).
- Local-first & private: encrypted logs live in your repo.
- Explicit classification to reduce accidental leaks.
- Scriptable via CLI and Python for CI/CD integration.
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 trustnocorpo-1.0.0.tar.gz.
File metadata
- Download URL: trustnocorpo-1.0.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30c72085c5cc9244ad1073855231bff60dde8550e7bfa14a2d63cdd5f4e5c4fa
|
|
| MD5 |
694ee694cf7b07fde0d55a254fe48adc
|
|
| BLAKE2b-256 |
e3f635c0a966c1ee3e92db8f47e2764efb40d3d1d31aec4795ae2cb5f13e1ca3
|
Provenance
The following attestation bundles were made for trustnocorpo-1.0.0.tar.gz:
Publisher:
pypi.yaml on Fran-cois/TrustNoCorpo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustnocorpo-1.0.0.tar.gz -
Subject digest:
30c72085c5cc9244ad1073855231bff60dde8550e7bfa14a2d63cdd5f4e5c4fa - Sigstore transparency entry: 404923615
- Sigstore integration time:
-
Permalink:
Fran-cois/TrustNoCorpo@884ba03156e7fd9beb0e659376e6c6447814aa93 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/Fran-cois
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@884ba03156e7fd9beb0e659376e6c6447814aa93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trustnocorpo-1.0.0-py3-none-any.whl.
File metadata
- Download URL: trustnocorpo-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01554813c4e40cdbf08cc222ecefae7621ab462fbfcb3722ddef9ae428043db7
|
|
| MD5 |
fc68af70c2c2e6407d63e2fbeb0edad4
|
|
| BLAKE2b-256 |
9d598b49937c3e2a62bde94b81b6d4d1f405fbc5a63cf799420ea50ba6a605aa
|
Provenance
The following attestation bundles were made for trustnocorpo-1.0.0-py3-none-any.whl:
Publisher:
pypi.yaml on Fran-cois/TrustNoCorpo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustnocorpo-1.0.0-py3-none-any.whl -
Subject digest:
01554813c4e40cdbf08cc222ecefae7621ab462fbfcb3722ddef9ae428043db7 - Sigstore transparency entry: 404923616
- Sigstore integration time:
-
Permalink:
Fran-cois/TrustNoCorpo@884ba03156e7fd9beb0e659376e6c6447814aa93 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/Fran-cois
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@884ba03156e7fd9beb0e659376e6c6447814aa93 -
Trigger Event:
push
-
Statement type: