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

Uploaded Source

Built Distribution

namedranges-0.4.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for namedranges-0.4.1.tar.gz
Algorithm Hash digest
SHA256 759d4760ada41cdbcfd7602d4bbcb94eb21ccda49b1e9f07c259bfa395b89042
MD5 26e9707b479bcae9b7d1d4d5662ea14e
BLAKE2b-256 a29317f9b7bb2810179aea10189d3417fb203040c4af511bec60d8606dfa2aef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: namedranges-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7de77fbbc16ca1d2fbdbe71a9a233fc6be494901d54ccdac9e7573b33ec4d2
MD5 002e432074cba1982e819553f1a42992
BLAKE2b-256 ee2d8051a3fb901d05a872f19c9bbab5c0417c1cb0de5c0d0ead0bb36e998faf

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