k3rangeset
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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| k3rangeset-0.1.4.tar.gz | 13.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3rangeset-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / k3rangeset-0.1.4.tar.gz
| Download URL | k3rangeset-0.1.4.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb10723dd30e35f4467b0834ecd22fcd5e3c0ecfc4a092bba2f8c9ff6d8ab11f
|
|
BLAKE2b-256 checksum How to use checksums |
86d2857c651b2bc9e7e0d004044d611d297e16274ca80828dc235be76fb84004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / k3rangeset-0.1.4-py3-none-any.whl
| Download URL | k3rangeset-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ce6afef1d7541bc44b49a32aba3d6553531520acf4e44a1aa9bedb45959f17e
|
|
BLAKE2b-256 checksum How to use checksums |
7cd7801841fe2c5f55fdf663ebff4a7281a7b7986a3a00d0bdbbff385ad005ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|