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.7
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.7.tar.gz | 13.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3rangeset-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / k3rangeset-0.1.7.tar.gz
| Download URL | k3rangeset-0.1.7.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0df6cc7946ad4ef3483dbe5d262bb15b3b3331e2c672608b72305057fd456f9
|
|
BLAKE2b-256 checksum How to use checksums |
660e1379c4443c5f9982924e3c910a38093decaf06c6e363c16628b578c0ccbf
|
| 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.7-py3-none-any.whl
| Download URL | k3rangeset-0.1.7-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f126ff35ff095b88044e16319cd1e516ffeb183e8677be0a2ca8c5a7cf3b5262
|
|
BLAKE2b-256 checksum How to use checksums |
f0fcec4d7114bed217c0a5dbc7acc347117b28645d6471e22e16e8b125d2dbb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|