This module can be used to validate BagitProfiles.
Project description
Description
A simple Python module for validating BagIt profiles. See the BagIt Profiles Specification for more information.
This module is intended for use with bagit but does not extend it.
Installation
bagit_profile.py is a single-file python module that you can drop into your project as needed or you can install globally with:
git clone https://github.com/ruebot/bagit-profiles-validator.git
cd bagit-profiles/python
sudo python setup.py install
or:
pip install bagit_profile
Usage
import bagit
import bagit_profile
Instantiate an existing Bag using bagit. python bag = bagit.Bag('mydir')
Instantiate a profile, supplying its URI. python my_profile = bagit_profile.Profile('http://example.com/bagitprofile.json')
Validate ‘Serialization’ and ‘Accept-Serialization’. This must be done before .validate(bag) is called. ‘mydir’ is the path to the Bag.
if my_profile.validate_serialization('mydir'):
print "Serialization validates"
else:
print "Serialization does not validate"
Validate the rest of the profile.
if my_profile.validate(bag):
print "Validates"
else:
print "Does not validate"
Or from the commandline:
bagit_profile.py 'http://uri.for.profile/profile.json' path/to/bag
Test suite
python setup.py test
Development
Do something awesome!
Submit a pull request explianing what your code does
License
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
Hashes for bagit_profile-1.0.1.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6071edae405e19dca590642c4b29e7fd09ec7574b0b354daff55f9fee46cb6e4 |
|
MD5 | 226b29094313838829f230a75b4a299b |
|
BLAKE2b-256 | ef9f0ceec3dc371126a766b2fb3039797c8054a22480e7e5919ccd4eb21378c6 |