Skip to main content

A set of static assets used (mainly) for ARCHE data preprocessing

Project description

Arche Assets

PyPI version Latest Stable Version License

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

  • URI normalization rules used within the ACDH-CD.
    (stored in AcdhArcheAssets/uriNormRules.json)
  • Description of input data formats accepted by 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_uri-norm-rules
    
  • 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 and coverage html
  • check linting flake8

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acdh_arche-assets-3.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acdh_arche_assets-3.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file acdh_arche-assets-3.1.tar.gz.

File metadata

  • Download URL: acdh_arche-assets-3.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for acdh_arche-assets-3.1.tar.gz
Algorithm Hash digest
SHA256 b7b5c82a3ebd4594fe49f644f36e6a88df94ae7531503d5e5d4ca2eea4d3e835
MD5 b884a5a38b78d1a38fe3b45f8303cbb4
BLAKE2b-256 ef317614ef030778bfbdf2d0b1310dd009efe46d322cd69018b25d15069643af

See more details on using hashes here.

File details

Details for the file acdh_arche_assets-3.1-py3-none-any.whl.

File metadata

  • Download URL: acdh_arche_assets-3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for acdh_arche_assets-3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7340a67464a07e6b9f4883fc2ffcd9f19b54b591ccc62b163472dd0eb92933
MD5 d4c93a23274b58b74d0ed4900df983ef
BLAKE2b-256 51054a26e7cfd580baa9cc2ef4bff55b1ed0f69d1db1b529574ca68bb354e3bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page