该模块可用于验证BagitProfiles。
bagit_profile的Python项目详细描述
安装
bagit_profile.py是一个可以放入的单个文件python模块 您可以根据需要安装项目,也可以使用以下命令进行全局安装:
- git clone https://github.com/bagit-profiles/bagit-profiles-validator.git
- cd bagit-profiles-validator
- sudo python setup.py install
或:
pip install bagit_profile
用法
importbagitimportbagit_profile
实例化现有的包 bagit。 python bag = bagit.Bag('mydir')
实例化配置文件,提供其uri。 python my_profile = bagit_profile.Profile('http://example.com/bagitprofile.json')
验证“序列化”和“接受序列化”必须这样做 之前。调用validate(bag)“mydir”是指向包的路径。
ifmy_profile.validate_serialization('mydir'):print"Serialization validates"else:print"Serialization does not validate"
验证配置文件的其余部分。
ifmy_profile.validate(bag):print"Validates"else:print"Does not validate"
或者从命令行:
bagit_profile.py 'http://uri.for.profile/profile.json' path/to/bag
测试套件
python setup.py test
开发
- Fork the repository
- 做些很棒的事
- Submit a pull request 解释代码的作用
许可证
cc0