Skip to main content

This module can be used to validate BagitProfiles.

Project description

https://img.shields.io/pypi/v/bagit_profile.svg https://circleci.com/gh/bagit-profiles/bagit-profiles-validator.svg?style=svg

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:

  1. git clone https://github.com/bagit-profiles/bagit-profiles-validator.git

  2. cd bagit-profiles-validator

  3. 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

  1. Fork the repository

  2. Do something awesome!

  3. Submit a pull request explianing what your code does

License

CC0

CC0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocrd-fork-bagit_profile-1.3.0.post1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file ocrd-fork-bagit_profile-1.3.0.post1.tar.gz.

File metadata

File hashes

Hashes for ocrd-fork-bagit_profile-1.3.0.post1.tar.gz
Algorithm Hash digest
SHA256 d44244bec22d9d2a2c08a47e0c0552d390eddc2bc9346c8522bb2a71fea54f3c
MD5 278fec2e6aa8286b20ccce79e780c7cb
BLAKE2b-256 ad99ee6d5ccdcb555a848ea30e6175b7d5bb54877ac417d85801c4442e73d5ac

See more details on using hashes here.

File details

Details for the file ocrd_fork_bagit_profile-1.3.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for ocrd_fork_bagit_profile-1.3.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 545d4acd20276de120c811e371ab96845b92f555e6ebc52b4089068b7fcbc6ec
MD5 aa6dba90bad06ac0770feeba22dbe411
BLAKE2b-256 ea9ea51dd9975c6ebf9b4ed5239c39e4f9df7ed2ffde679f0bd9d46a979510a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page