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

Uploaded Source

Built Distribution

namedranges-0.3.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: namedranges-0.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 537f3d5c720f952359239ce4c75cb45df438c32c624de5e503ad62fe885b5977
MD5 d6ebb04b9e2c87b23048c91fced2bf6a
BLAKE2b-256 e6af066c057b3e804f0af649fd094be4954135420af3f33eefef90aa1f642a90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: namedranges-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86189cdff07e95a3a74d63c38b726d84c2272c8d4476009c9bf48b387327aed2
MD5 074a4b3ee838673ffa02841e64fe7f92
BLAKE2b-256 fc83a9ee22ef86c94e44024fb34a003501d78d7cb6000f4d8cda169750e03ad8

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