1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.
pyskip
A pure Python skiplist implementation.
A skiplist provides a quickly searchable structure (like a balanced binary tree) that also updates fairly cheaply (no nasty rebalancing acts). In other words, it’s awesome.
See http://en.wikipedia.org/wiki/Skip_list for more information.
Written mostly an exercise for myself, it turns out skiplists are really useful. It also comes with a (mostly-underdocumented) linked-list implementation (+ a sorted variant), if that’s useful.
Requirements
Python 3.3+ (should work on Python 2.6+ as well, as well as PyPy 2.0+)
nose>=1.30 for running unittests
Usage
Using it looks like:
>>> import skiplist >>> skip = skiplist.Skiplist() >>> len(skip) 0 >>> 6 in skip False >>> skip.insert(0) >>> skip.insert(7) >>> skip.insert(3) >>> skip.insert(6) >>> skip.insert(245) >>> len(skip) 5 >>> 6 in skip True >>> skip.remove(245) >>> len(skip) 4 >>> skip.find(3) <Skiplist: 3>
Performance
Performance is alright, though I’m sure there’s room for improvement. See the bench.py script for more information.
Running Tests
Run pip install nose (preferrably within a virtualenv) to install nose.
Then run nosetests -s -v tests.py to exercise the full suite.
TODO
A more performant implementation of remove (still O(N))
More performance testing
Loading data seems slow
Meta
- author:
Daniel Lindsley
- license:
BSD
- version:
0.9.0
Release files for pyskip 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release files before installing.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyskip-0.9.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyskip-0.9.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / pyskip-0.9.0.tar.gz
| Download URL | pyskip-0.9.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa107ee1cce4dae596533b2fc616bffc7c34aa27246347203f07e7e27cff4f82
|
|
BLAKE2b-256 checksum How to use checksums |
d93c87b6f0ca9740a3409baa5e9cedb5b1f9cdacbff036fcf5e6c7d84dd65638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyskip-0.9.0-py2.py3-none-any.whl
File added late
This file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release file before installing.
| Download URL | pyskip-0.9.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
21f678cbefa8507cb45f28e27c7bf108551bd27856a63a013e31c3a503e30e9e
|
|
BLAKE2b-256 checksum How to use checksums |
219a2350e7d0ab8418c20fd1bb9ab61f03f08ed15ffa5884535659fef4f4bb4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |