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 command takes a Fedora collection URI and writes a CSV of descriptive metadata and ordered file members to the current directory. The output file is named after the last path segment of the URI.

ferry <collection-uri>

Example:

ferry https://api.library.tamu.edu/fcrepo/rest/3b/6f/c3/25/3b6fc325-f6ca-41d8-b91e-8c5db3be8c13/graydiary-saf

This produces graydiary-saf.csv with one row per work and the following columns:

Column Source
dcterms_alternative dcterms:alternative
dcterms_datecreated dcterms:created
dc_subject dc:subject
dc_creator dc:creator
dc_publisher dc:publisher
dcterms_ispartof dcterms:isPartOf
dc_format dc:format
dc_type dc:type
dcterms_medium dcterms:medium
dc_description dc:description
dc_language dc:language
dcterms_extent dcterms:extent
files Ordered file URIs via PCDM/IANA linked list

Multi-valued fields are pipe-delimited (e.g. History|Art).

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.2.0.tar.gz (7.3 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.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: charon_crossing-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 dfa681055b8fcdd8005cfe60e14f1c6abaeb1f27a43f253a2fbdf3d393399b56
MD5 1a84f7d42c7722fc6e93e7cb71ff291c
BLAKE2b-256 43db6a1ad790b6d1d992162ae3c3bf48dc7fe685a13219cdd565d54d7cdd8acb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charon_crossing-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b6d9f3366ebe5f85d51d5bd7d239d76495f2e66fda39f1bf88f8f83f7fdd8e8
MD5 cf3d7a04e0a4d1fa70ef9a5117e147a8
BLAKE2b-256 910614cf63cf3bdfe706749a895e6754d3a21046f7cba98c14ac8dc9190d206d

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