Pango lineage aliasing and dealiasing
Project description
Python convenience library to translate between aliased and unaliased Pango lineages
Useful for:
- constructing a tree of Pango lineages
- semantic sorting of Pango lineages
- ...
Usage
from pango_aliasor.aliasor import Aliasor
# Initalize aliasor (only needs to be done once)
# If no alias_key.json is passed, downloads the latest version from github
aliasor = Aliasor()
# To use custom alias_key.json, pass the relative path to the file
# aliasor = Aliasor('alias_key.json')
# Go from aliased lineage to unaliased lineage
aliasor.uncompress("BA.5") # 'B.1.1.529.5'
aliasor.uncompress("BE.5") # 'B.1.1.529.5.3.1.5'
aliasor.uncompress("XA") # 'XA'
# Go from unaliased lineage to aliased lineage
aliasor.compress("B.1.1.529.3.1") # 'BA.3.1'
See tests for more examples.
Installation
pip install pango_aliasor
Testing
Run pytest
from the project root to run all tests.
Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pango_aliasor-0.1.5.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for pango_aliasor-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8bf95da97d604e9ad030820931600ecc303f9fd5b9b8e66c2d8a3b91d4e7c12 |
|
MD5 | c81934aee7add18502064a9d616cab57 |
|
BLAKE2b-256 | deea517814d04bb52ee02b1e9917cd0a94afa269917c909d77b493aa2ddaace1 |