bagit
Create and validate BagIt packages
What it is and what it does
bagit is a Python library and command-line tool for creating and validating BagIt packages, a standardized format used in digital preservation and archival work. A BagIt bag is a directory structure that bundles data files with checksums and metadata, ensuring file integrity across storage and transfer. The package lets you create bags from existing directories, add or update metadata, regenerate manifests when payload changes, and validate bags against their stored checksums to detect corruption or tampering.
You can use it as a command-line utility (bagit.py) to quickly bag directories with metadata like contact names and checksums, or import it into Python code to programmatically create Bag instances, modify metadata, and run validation checks. It supports multiple checksum algorithms (MD5, SHA1, SHA256, SHA512) and can parallelize both bag creation and validation across multiple CPU cores. No external runtime dependencies are required.
Use it for:
- Archive digital collections with cryptographic integrity verification before long-term storage
- Validate received bags to detect file corruption or tampering during transfer or archival
- Batch-create bags from directories with standardized metadata and checksums for institutional workflows
- Regenerate manifests after modifying bag contents to keep checksums in sync with payload changes
- Integrate bag creation into Python preservation pipelines without external command-line tools
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Create, validate, and manage BagIt-style packages—a standardized format for digital preservation and file transfer that bundles data with checksums and metadata.
Yes, if you work with digital preservation, archival systems, or need standardized file packages with integrity verification. The permissive license and zero runtime dependencies make it low-risk to adopt. However, the aging maintenance status (427 days since last release) and high install friction (source tarball only) mean you should verify compatibility before deploying to modern environments. For casual use or one-off bag validation, it's straightforward; for production archival systems, confirm it meets your Python version and support expectations.
Install
bagit on PyPI
pip
pip install bagituv
uv add bagitpoetry
poetry add bagitInstalling bagit
Before you install
High install friction: the package is distributed as a source tarball with no pre-built wheels. Maintenance status is aging—last release was 427 days ago—so expect slower response to issues or compatibility problems with newer Python versions.
License in practice
Licensed as permissive public domain, imposing no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install bagit
import bagit
# Create a bag
bag = bagit.make_bag('mydir', {'Contact-Name': 'John Kunze'})
# Validate it
if bag.is_valid():
print('Bag is valid')
Requires Python 3; exact minimum version unspecified in metadata.
Verify before relying
- Whether the package works with current Python versions (requires_python is unspecified in metadata)
- Current state of the GitHub repository (archived status and commit history not available in fact sheet)
- Whether parallel checksum calculation (--processes flag) is thread-safe or process-safe
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | aging — 427 days since the last release |
| First released | |
| Downloads | 84,577/month — #13,986 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bagit-1.9.0.tar.gz
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
bagit-profileValidates BagIt bags against BagIt profile…
permissive · top 15,000 on PyPI
bdbagbdbag creates, validates, and manages BagIt…
permissive · top 15,000 on PyPI
paytmchecksumGenerates and verifies checksums for Paytm…
permissive · top 15,000 on PyPI
checksumdirComputes a single hash digest of all file…
permissive · top 15,000 on PyPI
dirhashComputes a single hash value for an entire…
permissive · top 5,000 on PyPI
ansible-signGenerates and validates checksums and GPG…
permissive · top 15,000 on PyPI
filehashCalculates and verifies file checksums and…
permissive · top 15,000 on PyPI
dbt-loomdbt-loom is a dbt Core plugin that fetches…
unclear · top 15,000 on PyPI
rosbagsRead, write, convert, and deserialize ROS bag…
permissive · top 15,000 on PyPI
setuptools-downloadA setuptools plugin that downloads external…
permissive · top 5,000 on PyPI