o2r-project / bagit

A npm module to support creation, modification and validation of bagit containers
Apache License 2.0
0 stars 2 forks source link

Any chance of some more detailed instructions? #5

Open ptsefton opened 6 years ago

ptsefton commented 6 years ago

If you have time it would be useful to know.

What needs to be installed on the Python side?

How do I use it in my code?

nuest commented 6 years ago

Thanks for you interest. I'll see if I can find time for proper docs - we were just waiting for someone external to want to use it I guess.

We use this package for a Node.js web service, based on it's Dockerfile I think all dependencies are installed with

pip install bagit

and we're only using it with Python 2 so far.

In that project you can also see how to use the validation API in this file:

const Bag = require('bagit');
const debug = require('debug')('bagit');
let fastValidation = true;

let bag = new Bag('/path/to/bag');
        bag.validate(fastValidation)
            .then(res => {
                debug('bag is valid: %s', res);
            }).catch(err => {
                debug('bag is _IN_valid: %s',err);
                }
});