Skip to main content

Named ranges with utilities for index reflows

Project description

namedranges

This lib provides a simple way to work with intervals/ranges in Python using a tuple representation for each interval and a string annotation.

Installation

pip install namedranges

Usage

ranges = {
    "1": (1, 5),
    "2": (6, 22),
    "3": (23, 26),
    "4": (27, 38)
}

nr = namedrange.from_dict(ranges)
nr.add_gaps([(10, 10)])
complement = nr.complement()
print(complement)

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

namedranges-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

namedranges-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file namedranges-0.1.0.tar.gz.

File metadata

  • Download URL: namedranges-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for namedranges-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69489006e0b5a4811c15883e8d98e4aa96a9b2e667bcbabd3cfd7acba32fba7c
MD5 12e1c2f38867e43aacce7d46dd3260ca
BLAKE2b-256 51888bb0603f4113100bcbaf92d905a08e1be18f83d2bf1744ba418bfb617d5b

See more details on using hashes here.

File details

Details for the file namedranges-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: namedranges-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for namedranges-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18bdd03485d1cab77907b1d44a4fd1802b32ac9abc99991b8b6665fa98849a30
MD5 4ca959e77dc2a1aff14a88c8f79169c9
BLAKE2b-256 7848b4f5692d77f70da8c5a42e4bdc1870927f16d712720f5ef7941f076284ec

See more details on using hashes here.

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