Archive::BagIt - An interface to make and verify bags according to the BagIt standard
This is experimental software for the moment and under active development.
Under the hood, the module Archive::BagIt::Base was adapted and extended to
support BagIt 1.0 according to RFC 8493 (\[https://tools.ietf.org/html/rfc8493\](https://tools.ietf.org/html/rfc8493)).
Also: Check out Archive::BagIt::Fast if you are willing to add some extra dependencies to get
better speed by mmap-ing files.
An Object Oriented Interface to a bag. Opens an existing bag.
my $bag = Archive::BagIt->new('/path/to/bag');
A constructor that will make and return a bag from a directory
If a data directory exists, assume it is already a bag (no checking for invalid files in root)
An interface to verify a bag.
You might also want to check [Archive::BagIt::Fast](https://metacpan.org/pod/Archive::BagIt::Fast) to see a more direct way of
accessing files (and thus faster).
This is the checksum for the bag, md5 of the manifest-md5.txt
Returns the bagit version according to the bagit.txt file.
Returns an array with all of the payload files (those files that are below the data directory)
Returns an array with files that are in the root of the bag, non-manifest files
Return an array with the list of manifest files that exist in the bag
Return an array with the list of tagmanifest files
The original development version is on github at [http://github.com/rjeschmi/Archive-BagIt](http://github.com/rjeschmi/Archive-BagIt)
and may be cloned from there.
The actual development version is available at [https://art1pirat.spdns.org/art1/Archive-BagIt](https://art1pirat.spdns.org/art1/Archive-BagIt)
You can find documentation for this module with the perldoc command.
You can also look for information at:
- RT: CPAN's request tracker (report bugs here)
- AnnoCPAN: Annotated CPAN documentation
- CPAN Ratings
- Search CPAN
This modules will hopefully help with the basic commands needed to create
and verify a bag. My intention is not to be strict and enforce all of the
specification. The reference implementation is the java version
and I will endeavour to maintain compatibility with it.
#read in an existing bag:
my $bag_dir = "/path/to/bag";
my $bag = Archive::BagIt->new($bag_dir);
#construct bag in an existing directory
my $bag2 = Archive::BagIt->make_bag($bag_dir);
# Validate a BagIt archive against its manifest
my $bag3 = Archive::BagIt->new($bag_dir);
my $is_valid = $bag3->verify_bag();
The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit [http://www.perl.com/CPAN/](http://www.perl.com/CPAN/) to find a CPAN
site near you, or see [https://metacpan.org/module/Archive::BagIt/](https://metacpan.org/module/Archive::BagIt/).
# BUGS AND LIMITATIONS
You can make new bug reports, and view existing ones, through the
web interface at [http://rt.cpan.org](http://rt.cpan.org).
Rob Schmidt <firstname.lastname@example.org>
# COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by Rob Schmidt and William Wueppelmann and Andreas Romeyke.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.