Skip to main content

A pure python port of nim-lapper.

Project description


PyPI version Coverage Documentation Status

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.


pip install py_lapper


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, 4, cursor)]
# found = [Interval(0, 5, True)]
# cursor = Cursor(2)

found = [iv for iv in, 7, cursor)]
# found = [Interval(4, 8, True)]
# cursor = Cursor(3)


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.

Source Distribution

py_lapper-0.9.5.tar.gz (4.1 kB view hashes)

Uploaded source

Built Distribution

py_lapper-0.9.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page