Skip to main content

Old Norse Alphabet

Old Norse Alphabet & sorting in Python

Motivation

Old Norse constains letters that may be hard to type with most keyboards. Prime examples being þ, ð and ǫ. There are also some letters "missing", like c and q. This package offers the alphabet & tricky individual letters as constants.

Also provides sorting function to get the old norse alphabet order just right.

Install

pip install old-norse-alphabet

Usage

The library offers Old Norse alphabet in lower/uppercases, and a function for sorting by old norse alphabetical order.

Sort

The crate exposes custom compare function for getting old norse alphabetical order just right. Compare function accepts two words to compare, so you can use cmp_to_key with sorted.

from functools import cmp_to_key
from old_norse_alphabet.sort import old_norse_sort

words = (
    "öðli",
    "ógnan",
    "æðrask",
    "aðili",
    "þakkan",
    "áfir",
    "á-auki",
    "él-ligr",
    "maðka",
    "ef-lauss",
    "œgir",
    "áðr",
    "maðr",
    "madr",
    "mæðr",
)

result = sorted(words, key=cmp_to_key(old_norse_sort))

print(result)
# "aðili", "á-auki", "áðr", "áfir", "ef-lauss", "él-ligr", "madr", "maðka", "maðr", "mæðr", "ógnan", "þakkan", "æðrask", "œgir", "öðli",

Alphabet

Alphabets are just immutable tuples of letters in ON alphabetical order with getter functions.

from old_norse_alphabet import alphabet

# Both alphabets contain 34 characters.
upper = alphabet.get_upper() 
lower = alphabet.get_lower()

# There is special list for characters that are valid as first letter.
valid_as_first = alphabet.get_valid_as_first()

Exposed special characters:

from old_norse_alphabet import alphabet

print(alphabet.eth) # ð
print(alphabet.thorn) # þ
print(alphabet.o_caudata) # ǫ
print(alphabet.slashed_o) # ø
print(alphabet.ae) # æ
print(alphabet.oe) # œ
print(alphabet.ash) # Alternative export of AE

About Old Norse

Old Norse was a North Germanic language that was spoken by inhabitants of Scandinavia and their overseas settlements from about the 7th to the 15th centuries.

Metadata

Release files for old-norse-alphabet 1.0.1

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

Source distribution (sdist)

Source distribution for old-norse-alphabet 1.0.1
File Size Uploaded
old-norse-alphabet-1.0.1.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for old-norse-alphabet 1.0.1
File Interpreter ABI Platform
old_norse_alphabet-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / old-norse-alphabet-1.0.1.tar.gz

Download URL old-norse-alphabet-1.0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c02bcfc0da6b4b6c824daccc1df6a5735c784adee1881f9aae4a515ddf818f7a
BLAKE2b-256 checksum
How to use checksums
5b29d228d6d4dbb7b56f4ff1ab0fcd993a01253625565ad8fdc18fa637b439b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / old_norse_alphabet-1.0.1-py3-none-any.whl

Download URL old_norse_alphabet-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f07f4c291f1de9b9337b2c523c6f3754f86ef893718af1f94144af0ba84f38c3
BLAKE2b-256 checksum
How to use checksums
96ad62e5c85c3541fcbf152b1307477d9c3eaeaf942aef24b4c308e81db5dd6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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