Skip to main content

Sort terms according to German DIN.

Project description

Sort terms according to German DIN 5007.

Build Status | sources | issues

Little Python library to support sorting of terms according to DIN (German Standards Institute) standard 5007.

This standard describes how to sort german terms alphabtically. It provides two variants:

  • Variant 1:

    • 'ä' equals 'a'

    • 'ß' equals 'ss'

  • Variant 2:

    • 'ä' equals 'ae'

    • 'ß' equals 'ss'

In both variants other diacritics are removed. So 'é' and 'ç' become 'e' and 'c' respecively.

Usage

dinsort is a Python library.

Normalizing Terms

Main function is dinsort.normalize. It generates a normalized form of any string term given:

>>> from dinsort import normalize
>>> normalize("Löblich")
'loblich'

Variants are defined as constants:

>>> from dinsort import VARIANT1, VARIANT2
>>> normalize("Müßig", variant=VARIANT1)
'mussig'

>>> normalize("Müßig", variant=VARIANT2)
'muessig'

Terms are normalized to lower-case by default. You can request case-sensitiveness:

>>> normalize("Maße", case_sensitive=True)
'Masse'

Install

User Install

The latest release of dinsort can be installed via pip:

$ pip install dinsort

The exact way depends on your operating system.

Developer Install

Developers clone the sources from github:

$ git clone https://github.com/ulif/dinsort.git

Create a virtual env (Python versions >= 2.6 supported):

$ cd dinsort
$ virtualenv py27
$ source py27/bin/activate

and install dependencies:

(py27) python setup py dev

You can run tests with py.test:

(py27) py.test

or with tox:

(py27) pip install tox
(py27) tox

Changes

0.1 (2015-10-13)

  • Initial version.

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

dinsort-0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

dinsort-0.1-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dinsort-0.1.tar.gz.

File metadata

  • Download URL: dinsort-0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dinsort-0.1.tar.gz
Algorithm Hash digest
SHA256 2a036fc5d54890e290f52f5679ec59db9b816f51ad44ce8443ef2542df3abe90
MD5 4da5c5126c7e5711253b4d6f3bd174fa
BLAKE2b-256 6045dafea481c1530b4fe40b87d40677cf777405fe8170b6d54d63b8b06f365a

See more details on using hashes here.

File details

Details for the file dinsort-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dinsort-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6c30ddd8513ee84eba41d8955e2aff887e2e314660059ffeb3b107a8e3a96e17
MD5 dfbf29c72ab58f472487b9d730b76fba
BLAKE2b-256 0955285405f7188f230be3f0e7fe24e36a2309e0f4cdc31e92fe0732cf30b3c9

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