Package: add new is_compressed helper
Package: add support for checking fixity

This teaches Packages how to check their own fixity, and report the
results. This is currently only supported for bags (which have a
record of their own fixity), e.g. AICs or AIPs.

This also adds a new API which allows external services to request
fixity scans and receive a report of the results. The URL is in the
format /file/<uuid>/check_fixity/

refs #6567
Package.extract_file: handle uncompressed packages
Added LOCKSS-o-matic stubs

refs #5425

Added a Space class for the LOCKSS-o-matic.  Functionality relating
to LOM on the changes to the METS file are stubs, since those
requirements not yet decided on.

Updated store AIP and download file functions to work with LOM, and
added a stub callback function for when LOM is done storing the file.
Added a new status for a package for when it is on the Storage Server,
but not yet in LOM.

Split chunks of an AIP are found at <aip_uuid>/download/<chunk_number>/
LOCKSS Space can parse service document

Add function to fetch and parse a service document, update the au_size and
collection_iri.

Added dependency on sword2 client library. Github version is newer and more
featureful than the version on PyPI. Install dependency from github.
Add common NSMAP

Add a common namespace map for use when working with METS and XML.
Update existing lxml code to use it. Add ipython as a development
dependency.
Create AtoM entry for AIP

refs #6009

Create the AtoM entry with the title, ID, agent, and description of the
AIP. Title, agent and description parsed from the METS file Dublin Core
title, description and an 'organization' agent.  Extract state IRI for
polling LOCKSS-o-matic from the deposit receipt.
Update LOCKSS-o-matic service doc and resource creation

refs #6009

Update LOCKSS handling of service document and atom entries to create
resources to match API changes.

Add checksumType parsing to service document.  Resource creation uses
lom:content tags, add checksum and checksum type to content tags.

Code moved to LOCKSS Space from Package, since it deals more with
Space-specific problems than Package.
LOCKSS WIP - edit & state IRI

refs #5425

Properly parse the edit and state IRIs from the deposit receipt.  Add sword
and Lockss-o-matic related namespaces to the namespace map.  Start on
polling for state, comments and logs where work needed.
Initial LOCKSS tests

Add pytest and pytest-django as testing dependencies.  Add testing fixtures
- initial data needed for everything, and a lockss-o-matic specific one.
Start on adding tests; currently only work if the modified simple sword
server is running.
Update for LOM changes

refs #5425

Update namespace for LOM, and make common.utils the only place it is
defined.  Add content provider ID, input by the user, and used to identify
the SS to LOM.
File splitting for LOCKSS uses tar

refS #5425

Splitting the file into chunks of no more than au_size uses tar instead of
split.  A tar file has headers and stores some of its own metadata, making
it a safer choice.
Update Lockssomatic to use new infrastructure

refs #5425

Update Lockssomatic to use (post) move to/from storage service.  Removed
now duplicate _store_aip_lom.  Store AIP calls post move functions.
Sizes to/from LOM are in kB

refs #5425

maxUploadSize in the service document, and lom:content size in the atom
entry are both in kilobytes, while all internal sizes are stored in bytes.
Add unit conversion.  Outgoing size rounded up.
Save State & Edit IRI in Packages.misc

refs #5425

Save state & edit IRI from deposit receipt into the misc attributes field
of Packages.
Add package Update Status button for LOCKSS

refs #5425

Add button to check the status of a Package.  Calls update_package_status
in Lockssomatic Space, which queries the state IRI and sets it to success if
all the server states are 'agreement'.
Update pointer file for entry creation

refs #5425

Update structMap and fileGrp, for when a package is split or unsplit.  Add
event and SS agent when the file is split.

Add helper function for writing PREMIS events and agents.  Update structMap
and fileGrp of pointer file with information on chunks.

Add version.py for tracking storage service version and providing string
display of it.
Update pointer file with LOCKSS URLs

refs #5425

Query the state_iri for this package and parse it for the server states. If
all are in agreement, add those URLs to the pointer file for each LOCKSS
chunk.  Works for both split and unsplit packages.

Factor out generation of download URL, as that is the ID of lom:content
elements in the SWORD statement.
Minor fixes

refs #5425

Misc minor fixes: update_package_status idempotent (removes LOCKSS URLs
before adding new ones), download path returns correct URL for tar changes,
checksum name is always uppercase, others.
Update pointer file - delete local copy

refs #5425

Delete LOCKSS chunks once AIP is safely stored, and remove their local URLs
from the pointer file.  If configured, delete local copy of AIP and update
pointer file: add deletion event, remove local URLs, etc.  Ensure that
multiple delete events not added if update status called repeatedly.