Skip to main content

A set of URI normalization rules used by the ACDH

Project description

UriNormRules

PyPI version Latest Stable Version License

Set of URI normalization rules used within the ACDH-CD.

Provides Python 3 and PHP bindings.

Rules are stored as a JSON in the UriNormRules/rules.json file.

Installation & usage

Python

  • Install using pip3:
    pip3 install acdh_uri-norm-rules
    
  • Use with
    from AcdhUriNormRules import get_rules, get_normalized_uri
    print(AcdhUriNormRules.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"
    

PHP

  • Install using using composer:
    composer require acdh-oeaw/uri-norm-rules
    
  • Usage with
    require_once 'vendor/autoload.php';
    print_r(acdhOeaw\UriNormRules::getRules());
    

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_uri-norm-rules-2.0.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

acdh_uri_norm_rules-2.0.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

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