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.5.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

namedranges-0.5.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for namedranges-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f9d7bb5abade85eb07c6b8a39e0abb1b997179eb931582de8d520f508139c308
MD5 fd63792fd8cbb65139cf45aba361cac5
BLAKE2b-256 f045e62a4290b913fb442287a022dd84651846d924019cf45a38e3156d5bac60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: namedranges-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f0980eb11e2ed076a593af74de10d26fc3711518999e225bfbf767333b36da2
MD5 09ab9e48980a5b626f35421bd5e9db34
BLAKE2b-256 71899aee6612066f8fbc35f865207ea59780604fe0e266f1ca78b5e7ff047d7d

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