Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.4MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 4.1s · import 0.000s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Profile
✓ from bagit_profile import Profile
✗ from bagit_profile import BagitProfile
This quickstart demonstrates how to load a BagIt Profile from a remote URI. It prints some basic information from the loaded profile. To perform actual validation, you would additionally need to create or load a `bagit.Bag` object and pass it to the `profile.validate()` method.
import os
from bagit_profile import BagitProfile
# Define a public BagIt Profile URI for demonstration
profile_uri = "https://raw.githubusercontent.com/bagit-profiles/bagit-profiles/master/bagitProfileFAB.json"
print(f"Attempting to load BagIt Profile from URI: {profile_uri}")
try:
# Load the BagIt Profile from the URI
profile = BagitProfile.from_uri(profile_uri)
print(f"\nSuccessfully loaded profile with identifier: {profile.bag_profile_identifier}")
print(f"Profile version: {profile.profile_version}")
print(f"BagIt-Profile-Description: {profile.bag_info.get('BagIt-Profile-Description', 'N/A')}")
# To perform actual validation, you would need a 'bagit.Bag' object:
# from bagit import Bag
# bag = Bag('/path/to/your/bag') # Replace with an actual Bag path
# is_valid = profile.validate(bag)
# print(f"\nBag validation result: {is_valid}")
# if not is_valid:
# print("Validation errors:")
# for error in profile.errors:
# print(f"- {error}")
except Exception as e:
print(f"\nAn error occurred during profile loading: {e}")
bagit_profile --version
Debug
Known issues
gotchaThe `bagit-profile` library has not been updated since March 2020. While functional, users should be aware of its infrequent maintenance and consider potential compatibility issues with newer Python versions or significant changes in the `bagit` library.fixThoroughly test with your specific Python and `bagit` library versions. Consider forking or contributing if critical updates are needed.
affects: All versions post 1.3.1
breakingPrior to version 1.3.1, validation of Bag-Info tags was case-sensitive, which could lead to unexpected validation failures if tag names varied in casing (e.g., 'Bagging-Date' vs 'bagging-date').fixUpgrade to `bagit-profile` version 1.3.1 or later to enable case-insensitive Bag-Info tag validation. Ensure your BagIt Profile also defines tag names consistently.
affects: <1.3.1
gotchaThe library explicitly depends on `bagit==1.7.0`. While `bagit` is generally stable, future breaking changes in the `bagit` library could cause incompatibilities if `bagit-profile` is not updated.fixWhen installing, ensure `bagit==1.7.0` is installed alongside `bagit-profile`. If encountering issues, check the `bagit` version and try to downgrade it to `1.7.0` if a newer version was installed.
affects: All versions
Upgrade
Version history
1.3.1latest on PyPI · released Mar 24, 2020
Audit
Dependencies
bagitrequiredRequired for creating and working with BagIt bags, which are validated against BagIt Profiles. Specifically depends on `bagit==1.7.0`.