Skip to main content

No project description provided

Project description

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 via pcdm:hasMember
  • get_contains() — returns a list of contained URIs via ldp:contains

FedoraWork(uri)

  • title — list of dc:title values
  • rights — first dc:rights value
  • summary — first dc:description value
  • members — list of pcdm:hasMember URIs
  • metadata_to_dict() — dict of descriptive metadata with pipe-joined values ready for CSV export
  • get_ordered_members() — members in order via IANA linked list
  • get_ordered_member_files() — ordered list of file URIs

FedoraFile(uri)

  • get_files() — returns pcdm:hasFile URIs
  • download(path) — downloads the file to the given directory
  • get_cantaloupe_base_64() — returns a IIIF info.json URL with base64-encoded identifier

FedoraProxy(uri)

  • get_proxy_for() — returns the ore:proxyFor target URI
  • get_next() — returns the next proxy in the IANA linked list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charon_crossing-0.3.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charon_crossing-0.3.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file charon_crossing-0.3.0.tar.gz.

File metadata

  • Download URL: charon_crossing-0.3.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.12 Darwin/23.6.0

File hashes

Hashes for charon_crossing-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fb85db27f1b89234f9a1bd94f661aa16963a87323f1d9a0d4722aa6d95a4fe96
MD5 d7054c6f2875443e07811aa1b3601625
BLAKE2b-256 98416f7ee1a32fec6a10fcd20d1d13e678a3124e17a2b57fe24c3ec43806d9aa

See more details on using hashes here.

File details

Details for the file charon_crossing-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: charon_crossing-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.12 Darwin/23.6.0

File hashes

Hashes for charon_crossing-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03db92d87c43fd692fd4760568ba653d7006b95f54847c35468b84ee1bf12aa4
MD5 708519eb669f12d2ba6ea66cb431e645
BLAKE2b-256 9437d6c19fe76694343593dd18ccba73086f86067f0f8cc8b4a08e8c200ce4b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page