A set of static assets used (mainly) for ARCHE data preprocessing
Project description
Arche Assets
Set of static assets used (mainly) for ARCHE data preprocessing or ARCHE information pages:
- URI normalization rules used within the ACDH-CD.
(stored inAcdhArcheAssets/uriNormRules.json
) - Description of input data formats accepted by ARCHE.
(stored inAcdhArcheAssets/formats.json
)
The repository provides also Python 3 and PHP bindings for accessing those assets.
Installation & usage
Python
- Install using pip3:
pip3 install acdh-arche-assets
- Use with
from AcdhArcheAssets.uri_norm_rules import get_rules, get_normalized_uri print(f"{get_rules()}") wrong_id = "http://sws.geonames.org/1232324343/linz.html" good_id = get_normalized_uri(wrong_id) print(good_id) # "https://www.geonames.org/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')
PHP
- Install using using composer:
composer require acdh-oeaw/arche-assets
- Usage with
require_once 'vendor/autoload.php'; print_r(acdhOeaw\UriNormRules::getRules()); print_r(acdhOeaw\ArcheFileFormats::getAll(); print_r(acdhOeaw\ArcheFileFormats::getByMime('application/json'); print_r(acdhOeaw\ArcheFileFormats::getByExtension('application/json');
Description of assets
Formats
A curated and growing list of file extensions. For each file extension mappings to the respective ARCHE Resource Type Category (stored in acdh:hasCategory
) and Media Type (MIME type) (stored in acdh: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.
- fileExtension: File extension to be mapped.
- name: Name(s) the format is known
- archeCategory: The corresponding URI of the ARCHE Resource Type Category Vocabulary
- dataType: A broad category to group formats in; mainly intended for visualisation purposes.
- pronomID: ID(s) assigned by PRONOM
- mimeType: Official Media Type(s) (formerly known as MIME types) registered at IANA.
- informalMimeType: Other MIME types kown for the format
- magicNumber: A constant numerical or text value used to identify a file format, e.g. Wikipedia list of file signatures
- ianaTemplate: Link to template at IANA
- reference: Link(s) to format specifications referenced by IANA and others
- longTerm: Indicates if a format is suitable for long-term preservation.
Possible values and their meaning- yes - long-term format
- no - not suitable, another format should be used
- restricted - can be used for long-term preservation in some cases (see comment)
- unsure - status remains to be evaluated
- archeDocs: Link to a place with more information for the format.
- comment: Any other noteworthy information not stated elsewhere.
Developement (Python)
install needed developement packages pip install requirements_dev.txt
linting, tests and testcoverage
- to run the test:
tox
- check coverage and create report:
coverage run setup.py test
andcoverage html
- check linting
flake8
Project details
Release history Release notifications | RSS feed
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
Hashes for acdh_arche_assets-3.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 900b68286d8569d619061e5567130720dcc355e29df2e35b5c748bdfa7bf750f |
|
MD5 | 883efa9f09a89247dcd8137bf28b1b51 |
|
BLAKE2b-256 | d9ae6de730c9114ab2a3ba64a19f2dd27abb56f342f37b37755d760b3d0d943d |