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

bagit_profile-1.3.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distributions

bagit_profile-1.3.1-py3.7.egg (21.3 kB view details)

Uploaded Source

bagit_profile-1.3.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file bagit_profile-1.3.1.tar.gz.

File metadata

  • Download URL: bagit_profile-1.3.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.3.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for bagit_profile-1.3.1.tar.gz
Algorithm Hash digest
SHA256 57798cdcf98b32a413edb29382d85f4f8c44d3204940d7e12d84998521a98c3f
MD5 0b0cd189b26eb0a4c61ac59d564ba0cf
BLAKE2b-256 fc301768557c9f93e20ca2873df0f826c699cb31818099c6856d9b01d50e039b

See more details on using hashes here.

File details

Details for the file bagit_profile-1.3.1-py3.7.egg.

File metadata

  • Download URL: bagit_profile-1.3.1-py3.7.egg
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.3.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for bagit_profile-1.3.1-py3.7.egg
Algorithm Hash digest
SHA256 19df2f726dbd27e50d785195d5891336aa3a2931b8cfc0c508bb3325a09e7a70
MD5 1f0580baf6e528bcb67aaf8bb9c8ec6e
BLAKE2b-256 fe6409516cf70650cdaa19f9fec82aea1035c36fec67a6bd3aa76a41af9cb717

See more details on using hashes here.

File details

Details for the file bagit_profile-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: bagit_profile-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.3.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for bagit_profile-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7565a95902cbdc9a646eece0939cfec025d77b00764d10538fd3d5962fa1c2b7
MD5 a559e712a30f4d2a159bbd33ea11a5a4
BLAKE2b-256 a68ea780f9d13ecfcd69e22cd6ba4497248abf82463386f616330f03da2b8a37

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