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

Uploaded Source

Built Distribution

namedranges-0.5.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: namedranges-0.5.2.tar.gz
  • Upload date:
  • Size: 4.7 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.2.tar.gz
Algorithm Hash digest
SHA256 f1f175e70d1971b31a50ce27168c6a8490142ff429edf7935871c60e2561952d
MD5 905b5ee63d9ec4357f4aa932346253e2
BLAKE2b-256 dd95921131319601064035cb000add4dbfce92a3f252a1382433cc7d601e888e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: namedranges-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1fa86c94142a06217009d10b620c4a398df320e46118e784e988cca195064d
MD5 f3b62124334b1db358081ae4594e0284
BLAKE2b-256 149cf80302a783b1367eddf4c57ba538c9208881263085a33b669ad45e1f8abe

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