pyavalon
Tools for doing things in batches in Avalon at TAMU — as a command line utility and as a Python library.
Installing
To install and use as a command line utility, use pipx:
pipx install pyavalon
To use as a library, use pip:
pip install pyavalon
Configuration
Commands talk to either the pre (staging) or prod Avalon instance, selected with --instance/-i (default: pre). Each instance requires an Avalon API key, set via environment variable:
export AVALON_PRE="your-pre-instance-api-key"
export AVALON_PROD="your-prod-instance-api-key"
Commands
Run pyavalon --help or pyavalon COMMAND --help for full details on any command.
print_all_collections
List all collections in the repository.
pyavalon print_all_collections -i pre
create_iiif_collection
Create a IIIF Collection manifest for a given Avalon collection.
pyavalon create_iiif_collection -c "mk61rh127" -o collection.json
get_file_ids_from_a_collection
Create a CSV of master files in a collection, with metadata and a path to the best-available derivative. Optionally download the derivatives via scp.
pyavalon get_file_ids_from_a_collection -c "mk61rh127" -o output.csv
Download files while building the CSV:
pyavalon get_file_ids_from_a_collection -c "mk61rh127" --download -u myusername -f tmp
Only page through a range of results (10 items per page) instead of the whole collection:
pyavalon get_file_ids_from_a_collection -c "mk61rh127" --get_range --start 1 --end 5
get_media_object
Fetch a media object (or other Avalon object type) and pretty-print it, also writing it to media_object.json.
pyavalon get_media_object -m "mk61rh127" -t media_object
upload_supplemental_files
Upload PDFs, transcripts, or captions to existing files based on a CSV manifest.
CSV columns: id,filename,label,type (type is one of pdf, caption, or transcript).
pyavalon upload_supplemental_files -c supplementals.csv
find_files_missing_supplementals
Find all master files in a collection missing a given supplemental file type (caption, transcript, or pdf).
pyavalon find_files_missing_supplementals -c "mk61rh127" -t transcript
get_json_for_whisper_reviewer
Build a JSON manifest (audio/vtt/url per item) for use with a Whisper transcript reviewer site, from a CSV of media object ids.
CSV columns: media_object_id,path_to_json,path_to_vtts.
pyavalon get_json_for_whisper_reviewer -c input.csv -o output.json
create_ami_set
Builds an AMI set from a collection id.
pyavalon create_ami_set -c <collection_id> -i prod -o ami_set.csv
Running Tests
pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyavalon-0.1.13.tar.gz.
File metadata
- Download URL: pyavalon-0.1.13.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.13 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
becdd3b455a741847f98dc6dbacec86eb281fbd61f6672a2df5c428e3944d1b6
|
|
| MD5 |
32ef5f60a7097407b88f2914cfbf301e
|
|
| BLAKE2b-256 |
6601c23a2dfa96ee4e1e48d4a729d260ebd0107431d3f464be478dfec8f3c00c
|
File details
Details for the file pyavalon-0.1.13-py3-none-any.whl.
File metadata
- Download URL: pyavalon-0.1.13-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.13 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae4df0f78d5f217281de4d20d492ea22b23a268af5dfdd1479979137f9cf9e6
|
|
| MD5 |
228b56a49f5a6f831b72533318879d52
|
|
| BLAKE2b-256 |
10034012b16f801a3fd5a798998d6f6712d180665e023b3322555fb467b294b8
|