acdh-arche-assets
A set of static assets used (mainly) for ARCHE data preprocessing
A set of static assets used (mainly) for ARCHE data preprocessing
To install packages from this channel, you must first login at the command line:
anaconda loginYou can then use the channel temporarily with conda or add it to your .condarc file for configured ongoing access. Learn more
Set of static assets used (mainly) for ARCHE data preprocessing and ARCHE information pages:
AcdhArcheAssets/uriNormRules.json)AcdhArcheAssets/formats.json)The repository provides also Python 3 and PHP bindings for accessing those assets.
Install using pip3:
pip3 install acdh-arche-assets
Use with
from AcdhArcheAssets.uri_norm_rules import get_rules, get_normalized_uri, get_norm_id
print(f"{get_rules()}")
wrong_id = "http://sws.geonames.org/1232324343/linz.html"
good_id = get_normalized_uri(wrong_id)
print(good_id)
# "https://sws.geonames.org/1232324343/"
# extract ID from URL
norm_id = get_norm_id("http://sws.geonames.org/1232324343/linz.html")
print(norm_id)
# "1232324343"
from AcdhArcheAssets.file_formats import get_formats, get_by_mtype, get_by_extension
formats = get_formats()
matching_mapping = get_by_mtype('image/png')
matching_mapping = get_by_extension('png')
Install using the composer:
composer require acdh-oeaw/arche-assets
Use with
require_once 'vendor/autoload.php';
print_r(acdhOeaw\UriNormRules::getRules());
print_r(acdhOeaw\UriNormRules::getRules(['viaf', 'gnd']));
print_r(acdhOeaw\ArcheFileFormats::getAll());
print_r(acdhOeaw\ArcheFileFormats::getByMime('application/json'));
print_r(acdhOeaw\ArcheFileFormats::getByExtension('json'));
Each rule consists of five properties:
name: a rule namematch: a regular expression matching rule's URI namespacereplace: a regex-replace expression transforming an URI in a rule's namespace into its ACDH-canonical formresolve: a regex-replace expression transforming an URI in a rule's namespace into an URL fetching an RDF dataformat: an RDF serialization format to be requested while resolving the URL produced using the resolve fieldA curated and growing list of file extensions. For each file extension mappings to the respective ARCHE Resource Type Category (stored in :hasCategory) and Media Type (MIME type) (stored in :hasFormat) are given. The indicated Media Type should only be used as a fallback; it is best practice to rely on automated Media Type detection based on file signatures.
Further information is provided as well.
install needed developement packages pip install requirements_dev.txt
toxcoverage run setup.py test and coverage htmlflake8Summary
A set of static assets used (mainly) for ARCHE data preprocessing
Last Updated
May 19, 2026 at 12:53
License
MIT