skillfed

bagit

Create and validate BagIt packages

bagit v1.9.0 84.6K downloads/30d#13,986 on PyPI
Permissive license AGING released

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 bagit

uv

uv add bagit

poetry

poetry add bagit

Installing 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

Intended Audience :: DevelopersLicense :: Public DomainProgramming Language :: Python :: 3Topic :: Communications :: File SharingTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Filesystems

Tags

bagit package creationdigital preservation formatchecksum validationbag manifest generationfile integrity verificationbagit command line toolmetadata persistence
digital-preservationfile-integrityarchival

More Python Modules packages