Skip to main content

k3rangeset

Action-CI Documentation Status Package

segmented range which is represented in a list of sorted interleaving range.

k3rangeset is a component of pykit3 project: a python3 toolkit set.

Segmented range which is represented in a list of sorted interleaving range.

A range set can be thought as: [[1, 2], [5, 7]].

Install

pip install k3rangeset

Synopsis

import k3rangeset

a = k3rangeset.RangeSet([[1, 5], [10, 20]])
a.has(1)  # True
a.has(8)  # False
a.add([5, 7])  # [[1, 7], [10, 20]]

inp = [
    [
        0,
        1,
        [
            ["a", "b", "ab"],
            ["b", "d", "bd"],
        ],
    ],
    [
        1,
        2,
        [
            ["a", "c", "ac"],
            ["c", "d", "cd"],
        ],
    ],
]

r = k3rangeset.RangeDict(inp, dimension=2)
print(r.get(0.5, "a"))  # 'ab'
print(r.get(1.5, "a"))  # 'ac'

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Metadata

Release files for k3rangeset 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k3rangeset 0.1.8
File Size Uploaded
k3rangeset-0.1.8.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for k3rangeset 0.1.8
File Interpreter ABI Platform
k3rangeset-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / k3rangeset-0.1.8.tar.gz

Download URL k3rangeset-0.1.8.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c5556419fa83a871ef3418f31ec2d28f1b1b4beea5affb1ce624c23ff18a3395
BLAKE2b-256 checksum
How to use checksums
eb73d8aac0f57dd5f060b21e4ed6b2fc2bd45f0b64cc3c14cb1cdf355881ebd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / k3rangeset-0.1.8-py3-none-any.whl

Download URL k3rangeset-0.1.8-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd78b965a5710833e2c49d080fd372aa8344b91267abc24787cbfd69ee85e9cb
BLAKE2b-256 checksum
How to use checksums
c8a2ee4104647be91d71c6a3695670bcb9422f5657b2c318e13996dd4a03078b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page