Bagit Profile (validator)
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-python 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/bagit-profiles/bagit-profiles-validator.git
cd bagit-profiles-validator
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
CC0
Metadata
Release files for ocrd-fork-bagit-profile 1.2.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ocrd-fork-bagit_profile-1.2.0.post1.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ocrd_fork_bagit_profile-1.2.0.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / ocrd-fork-bagit_profile-1.2.0.post1.tar.gz
| Download URL | ocrd-fork-bagit_profile-1.2.0.post1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbd7fd167258af2eecebf6ab800c84843b53f0862c76b06445d3b410c3b12c30
|
|
BLAKE2b-256 checksum How to use checksums |
53f5e9293dc1d7a398ada05b253539ad8d7a00d3e38ce98bf0adbbbd6a1c3219
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.12
|
Release files / ocrd_fork_bagit_profile-1.2.0.post1-py3-none-any.whl
| Download URL | ocrd_fork_bagit_profile-1.2.0.post1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14b0801d12cf963f7d791890b80fba15d2323902e6d796f683cf22ff706a5e4b
|
|
BLAKE2b-256 checksum How to use checksums |
fec99e90b6a489e516ff529fea2c7cb0fdc9435373d544b7d314fa8ea4049ed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.12
|