Skip to main content

gl-smartsort

A tiny Python package that canonicalizes GL Strings by smart sorting:

  • recursively sorts within delimiter levels in precedence: ^, |, +, ~, /
  • orders blocks by gene/locus (left of *)
  • orders alleles numerically (not lexically) within a locus (e.g., A*01:11 before A*01:103)
  • strips suffixes for numeric comparison (e.g., 01:01N compares as 01:01)

This is a Python port of SmartSort.pm (2012-11-14).

Install (local)

From the project directory:

python -m pip install -U pip
python -m pip install -e .

Usage (Python)

from gl_smartsort import smart_sort

print(smart_sort("A*01:103+A*01:11"))
# A*01:11+A*01:103

Usage (CLI)

Sort a single GL string:

gl-smartsort "B*07:02^A*02:01"

Or sort from stdin (one per line):

cat gl.txt | gl-smartsort

Provenance

This package is a Python port of the original Perl implementation SmartSort.pm (2012-11-14), authored by Martin J. Maiers. Both the original Perl implementation and this Python port were written by the same author. The implementation relies only on the Python standard library and incorporates no third-party source code.

License

Licensed under the Apache License, Version 2.0 (Apache-2.0). See the LICENSE and NOTICE files for details.

Copyright 2012 Martin J. Maiers and National Marrow Donor Program (NMDP).

Metadata

Release files for gl-smartsort 0.1.2

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

Source distribution (sdist)

Source distribution for gl-smartsort 0.1.2
File Size Uploaded Provenance Actions
gl_smartsort-0.1.2.tar.gz 10.1 kB With provenance Details for gl_smartsort-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gl-smartsort 0.1.2
File Interpreter ABI Platform Actions
gl_smartsort-0.1.2-py3-none-any.whl Python 3 none any Details for gl_smartsort-0.1.2-py3-none-any.whl

Total release size: 19.3 kB

Release files / gl_smartsort-0.1.2.tar.gz

Download URL gl_smartsort-0.1.2.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dc2ec5421e7423f8757095c43b266916c014eb2d12834d49ad67791d70e9ea6f
BLAKE2b-256 checksum
How to use checksums
279cc6460cf470a99fb352028c02b62c5812c0389381e61731eda99a64094bed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / gl_smartsort-0.1.2-py3-none-any.whl

Download URL gl_smartsort-0.1.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55f05ded29a03d4f5dbdefb916e44822cb2803f3d84e02650137d1d8037c6407
BLAKE2b-256 checksum
How to use checksums
27514ecd8863f0becd3308059711c6ac29f2cc1e7f01c3e8da99d376a478a110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for gl-smartsort 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gl_smartsort-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

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