Skip to main content

Arche Assets

PyPI version codecov Test flake8 Lint Latest Stable Version phpunit License

Set of static assets used (mainly) for ARCHE data preprocessing and ARCHE information pages:

  • URI normalization rules used by the ACDH.
    (stored in AcdhArcheAssets/uriNormRules.json)
  • Description of input data formats accepted by the ARCHE.
    (stored in AcdhArcheAssets/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 name
  • match: a regular expression matching rule's URI namespace
  • replace: a regex-replace expression transforming an URI in a rule's namespace into its ACDH-canonical form
  • resolve: a regex-replace expression transforming an URI in a rule's namespace into an URL fetching an RDF data
  • format: an RDF serialization format to be requested while resolving the URL produced using the resolve field

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 test and coverage html
  • check linting flake8

Metadata

Release files for acdh-arche-assets 3.32.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acdh-arche-assets 3.32.0
File Size Uploaded
acdh_arche_assets-3.32.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for acdh-arche-assets 3.32.0
File Interpreter ABI Platform
acdh_arche_assets-3.32.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / acdh_arche_assets-3.32.0.tar.gz

Download URL acdh_arche_assets-3.32.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4c40e1ae69d0f7833c7d00a7e2a51b1c4f2376edd491a7ecc3c3e2852efdf0e7
BLAKE2b-256 checksum
How to use checksums
967e9ced8dfa176e01a0b3a6e0e38d1147a0f319d13a742f554dd01e70b1224f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / acdh_arche_assets-3.32.0-py3-none-any.whl

Download URL acdh_arche_assets-3.32.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8a79447b8aa3099d7de5a5d62dbad6be932a312300bcb26ad21004d7817e32b
BLAKE2b-256 checksum
How to use checksums
53d5a54f48cbe7e2bc9fa49e0e1b1f55628fe6bd8321c257a65b287022929f0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

3.32.0 This release

2 release files

3.31.3

2 release files

3.31.2

2 release files

3.31.1

2 release files

3.31

2 release files

3.29.0

2 release files

3.28.1

2 release files

3.27.1

2 release files

3.27.0

2 release files

3.26.1

2 release files

3.26.0

2 release files

3.25.0

2 release files

3.24.0

2 release files

3.23.0

2 release files

3.22.3

2 release files

3.22.2

2 release files

3.22.1

2 release files

3.22.0

2 release files

3.21.1

2 release files

3.21.0

2 release files

3.20.1

2 release files

3.20.0

2 release files

3.19

2 release files

3.18.1

2 release files

3.18.0

2 release files

3.17.1

2 release files

3.17.0

2 release files

3.12.2

2 release files

3.12.1

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.0

2 release files

3.9.7

2 release files

3.9.6

2 release files

3.9.5

2 release files

3.9.4

2 release files

3.9.3

2 release files

3.9.2

2 release files

3.9.1

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page