A pure python port of nim-lapper.
Project description
py_lapper
A pure python port of nim-lapper. Please also see the rust lib, rust-lapper
Stay tuned for a pyO3 wrapper for the rust lib.
Install
pip install py_lapper
Usage
from py_lapper import Interval, Lapper, Cursor
intervals = [Interval(0, 5, True), Interval(4, 8, True), Interval(9, 12, True)]
lapper = Lapper(intervals)
found = [iv for iv in lapper.find(4, 7)]
# found = [Interval(0, 5, True), Interval(4, 8, True)]
# Use seek when you will have many queries in sorted order.
cursor = Cursor(0)
found = [iv for iv in lapper.seek(1, 4, cursor)]
# found = [Interval(0, 5, True)]
# cursor = Cursor(2)
found = [iv for iv in lapper.seek(5, 7, cursor)]
# found = [Interval(4, 8, True)]
# cursor = Cursor(3)
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
py_lapper-0.9.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for py_lapper-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 360f2abc376eff9a25ac2053f136effaccfe098eff3015a65b9e92a6ca77cd52 |
|
MD5 | a1535f5d5bb8158a9f2edbc32a06947e |
|
BLAKE2b-256 | e7c64596f1bd207f2d5cf3cb6c0f232c43a6f8e17dd4052e6e8908d60d945edd |