Skip to main content

A pure python port of nim-lapper.

Project description

py_lapper

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.

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.

Source Distribution

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file py_lapper-0.9.5.tar.gz.

File metadata

  • Download URL: py_lapper-0.9.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.5 Darwin/18.7.0

File hashes

Hashes for py_lapper-0.9.5.tar.gz
Algorithm Hash digest
SHA256 d429e8b97795eaf96b55636c1798b4e78de640ed79c53e44c82e53b7c3ecc9c1
MD5 c7264e7e7d0e976ef6bfe12029f609fb
BLAKE2b-256 31fcf901730b574bc21d31516efae262f56cc121d508b0bac9a45dc53da6b946

See more details on using hashes here.

File details

Details for the file py_lapper-0.9.5-py3-none-any.whl.

File metadata

  • Download URL: py_lapper-0.9.5-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.5 Darwin/18.7.0

File hashes

Hashes for py_lapper-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3f466916925acd657a84a07b9b2ec3bc3e93be7c8805e45b4502b3324d08e682
MD5 bab179d023716ffe1a8dcec9d5144eaf
BLAKE2b-256 0017c85f7da1198af4b86526462fda7b5291ded4bfdd1d5f92ff243c9721cddc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page