charon-crossing
A Python library and CLI tool for migrating content from a Fedora repository into Archipelago. It traverses PCDM-structured collections, extracts descriptive metadata, and resolves ordered file members.
Installation
poetry install
CLI Usage
The ferry CLI provides two subcommands. Run ferry --help to see all options.
ferry ferry — Export collection works to CSV
Iterates the works in a Fedora collection and writes a CSV of descriptive metadata and ordered file URIs. The output file is named after the last path segment of the collection URI.
ferry ferry <collection-uri>
Example:
ferry ferry https://api.library.tamu.edu/fcrepo/rest/3b/6f/c3/25/3b6fc325-f6ca-41d8-b91e-8c5db3be8c13/graydiary-saf
Produces graydiary-saf.csv with one row per work. Multi-valued fields are pipe-delimited (e.g. History|Art).
| Column | Source |
|---|---|
dcterms_alternative |
dcterms:alternative |
dcterms_created |
dcterms:created |
dcterms_issued |
dcterms:issued |
dc_date |
dc:date |
dc_subject |
dc:subject |
dcterms_coverage |
dcterms:coverage |
dcterms_temporal |
dcterms:temporal |
dcterms_spatial |
dcterms:spatial |
dc_creator |
dc:creator |
dc_contributor |
dc:contributor |
dc_publisher |
dc:publisher |
dc_format |
dc:format |
dc_type |
dc:type |
dcterms_type |
dcterms:type |
dcterms_medium |
dcterms:medium |
dcterms_abstract |
dcterms:abstract |
dc_summary |
dc:summary |
dc_description |
dc:description |
dc_language |
dc:language |
dcterms_extent |
dcterms:extent |
dc_identifier |
dc:identifier |
dcterms_otherIdentifier |
dcterms:otherIdentifier |
dcterms_URL |
dcterms:URL |
dc_rights |
dc:rights |
dcterms_rightsHolder |
dcterms:rightsHolder |
dcterms_rightsURI |
dcterms:rightsURI |
dcterms_accessRights |
dcterms:accessRights |
dcterms_isPartOf |
dcterms:isPartOf |
dcterms_isPartOfSeries |
dcterms:isPartOfSeries |
dcterms_lcc |
dcterms:lcc |
dc_citation |
dc:citation |
dc_genre |
dc:genre |
files |
Ordered file URIs via PCDM/IANA linked list |
ferry get-members — List sub-collections as CSV
Iterates the contents of a top-level Fedora container and writes a summary of each sub-collection to collections.csv.
ferry get-members <container-uri>
Example:
ferry get-members https://api.library.tamu.edu/fcrepo/rest/3b/6f/c3/25/3b6fc325-f6ca-41d8-b91e-8c5db3be8c13
Produces collections.csv with columns:
| Column | Description |
|---|---|
uri |
Full URI of the sub-collection |
created |
Creation date of the sub-collection |
works |
Number of works (pcdm:hasMember) in the sub-collection |
Library Usage
The package exposes several classes for working with Fedora objects directly:
from charon_crossing import FedoraCollection, FedoraWork, FedoraFile, FedoraProxy
# Retrieve a collection and its members
collection = FedoraCollection("https://...")
members = collection.get_members()
# Work with an individual work
work = FedoraWork(members[0])
print(work.title)
print(work.rights)
print(work.metadata_to_dict())
print(work.get_ordered_member_files())
# Access a file object
file = FedoraFile("https://.../fcrepo/rest/.../file")
file.download("/path/to/output")
Classes
FedoraCollection(uri)
get_members()— returns a list of member URIs viapcdm:hasMemberget_contains()— returns a list of contained URIs vialdp:contains
FedoraWork(uri)
title— list ofdc:titlevaluesrights— firstdc:rightsvaluesummary— firstdc:descriptionvaluemembers— list ofpcdm:hasMemberURIsmetadata_to_dict()— dict of descriptive metadata with pipe-joined values ready for CSV exportget_ordered_members()— members in order via IANA linked listget_ordered_member_files()— ordered list of file URIs
FedoraFile(uri)
get_files()— returnspcdm:hasFileURIsdownload(path)— downloads the file to the given directoryget_cantaloupe_base_64()— returns a IIIFinfo.jsonURL with base64-encoded identifier
FedoraProxy(uri)
get_proxy_for()— returns theore:proxyFortarget URIget_next()— returns the next proxy in the IANA linked list
Metadata
Release files for charon-crossing 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| charon_crossing-0.5.0.tar.gz | 9.5 kB | Without provenance | Details for charon_crossing-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| charon_crossing-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for charon_crossing-0.5.0-py3-none-any.whl |
Total release size: 21.1 kB
Release files / charon_crossing-0.5.0.tar.gz
| Download URL | charon_crossing-0.5.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db1af5bc7eea9ada967b3162a9683c7c1ed126f9c76da135746eafd711aff7e2
|
|
BLAKE2b-256 checksum How to use checksums |
4b47c2be606b46cc42ea59145481c6046f02ca2a2710f95a272decb44a2e5512
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.13 Darwin/23.6.0
|
Release files / charon_crossing-0.5.0-py3-none-any.whl
| Download URL | charon_crossing-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ca81a51ccd429d234e9c1bede8d5ec6fcba868729ef92939a210f289f88ab7a
|
|
BLAKE2b-256 checksum How to use checksums |
a673410bbc0a9f82d7a450b150580952de07e0c9060de357579ac156471a9bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.13 Darwin/23.6.0
|
Security for charon-crossing 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.