Arche Assets
Set of static assets used (mainly) for ARCHE data preprocessing and ARCHE information pages:
- URI normalization rules used by the ACDH.
(stored inAcdhArcheAssets/uriNormRules.json) - Description of input data formats accepted by the 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, 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')
PHP
- 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'));
Description of assets
URI normalization rules
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 theresolvefield
Formats
A 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.
- 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 testandcoverage html - check linting
flake8
Metadata
Release files for acdh-arche-assets 3.33.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acdh_arche_assets-3.33.0.tar.gz | 11.4 kB | Without provenance | Details for acdh_arche_assets-3.33.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acdh_arche_assets-3.33.0-py3-none-any.whl | Python 3 | none | any | Details for acdh_arche_assets-3.33.0-py3-none-any.whl |
Total release size: 24.3 kB
Release files / acdh_arche_assets-3.33.0.tar.gz
| Download URL | acdh_arche_assets-3.33.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42e2700216ac46f598b8ca5fd33a6419f963db0c326b583fcfed908f0d6c38b2
|
|
BLAKE2b-256 checksum How to use checksums |
40014addf6196829ae59dc9a4774ea39d069621b6d82ab1a203425b387506453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / acdh_arche_assets-3.33.0-py3-none-any.whl
| Download URL | acdh_arche_assets-3.33.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5af75cbab6614faec36c82627b869850c585afebea6e15d24446131036ca6d99
|
|
BLAKE2b-256 checksum How to use checksums |
78e35142ba608ad7d8a0637d662e6e9d90306a7c5ba9bb1b0662abf140984b9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for acdh-arche-assets 3.33.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.