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.
Documentation can be found here.
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)
Changelog
1/17/2020 -- 0.9.4
* Fix bug with seek where it skipped last match
1/16/2020 -- 0.9.3
* Added type hints
* Added documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size py_lapper-0.9.5-py3-none-any.whl (5.0 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size py_lapper-0.9.5.tar.gz (4.1 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for py_lapper-0.9.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f466916925acd657a84a07b9b2ec3bc3e93be7c8805e45b4502b3324d08e682 |
|
MD5 | bab179d023716ffe1a8dcec9d5144eaf |
|
BLAKE2-256 | 0017c85f7da1198af4b86526462fda7b5291ded4bfdd1d5f92ff243c9721cddc |