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

Uploaded Source

Built Distribution

namedranges-0.5.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: namedranges-0.5.1.tar.gz
  • Upload date:
  • Size: 4.6 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.1.tar.gz
Algorithm Hash digest
SHA256 f421880b2a802bb757d1ce4665b5d6484ebc7246acd77bc6b4d95020760a9738
MD5 ce94c758ccd55abf469f3fdaccbdd9f6
BLAKE2b-256 b7e27e16f759952848ba51d49541d8d2a6d766677540626d5ecca9f3a964d860

See more details on using hashes here.

File details

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

File metadata

  • Download URL: namedranges-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 029315c9a425a1567fb6d06a904e939de49439cae6f47b1a3f2747a9308a6b87
MD5 084c52756c6acea14ff817f728c80872
BLAKE2b-256 720b7e9df265521f05591f28c054ddb4ef81abe3220f11618d7e93e984b816f6

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