Python bindings for LevelDB. Python 2-3 compatible
Project description
# ctypes bindings for LevelDB
The existing three [LevelDB](http://code.google.com/p/leveldb/) interfaces ([py-leveldb](http://code.google.com/p/py-leveldb/), [cpy-leveldb](https://github.com/forhappy/cpy-leveldb), [plyvel](https://github.com/wbolster/plyvel/)) use the Python C API and compile Python modules that work with LevelDB's C++ interface. This Python module simply uses the ctypes library to LevelDB's C interface - making it more portable across Python implementations and easier to install and distribute.
lvldb:
* Python 2-3 compatible
* supports get/put/delete (with standard read/write options)
* supports bloom filters
* supports leveldb LRU cache
* allows for manual or automatic database closing (compare with py-leveldb)
* provides write batches
* provides iterators (full control of leveldb iteration, with additional idiomatic python iterator support)
* provides prefix-based iteration (returns iterators that work as if all keys with a shared prefix had the prefix stripped and were dumped into their own database)
* provides scoped sub-databases (presents a new database wrapper backed by an existing database with all keys prefixed by some prefix)
* provides range iterators (for idioms like give me all keys between start and end)
* provides an in-memory db implementation (for faster unit tests)
* supports snapshots
* fits in one file
* requires no compilation
## Sample Usage
```
# Python3
import lvldb
db = lvldb.DB("/path/to/db", create_if_missing=True)
db.put("key1", "value1")
db.put("key2", "value2")
print(f"key1 => {db.get('key1')} ")
for key, value in db:
print(f"{key} => {value}")
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lvldb-0.1.2.tar.gz
(14.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
lvldb-0.1.2-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file lvldb-0.1.2.tar.gz.
File metadata
- Download URL: lvldb-0.1.2.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62aa7a739532f382811832fe13e43c300b9bd8d798879ee93a8a4e5855abebe0
|
|
| MD5 |
69d8e2d8637f2c7e953d6c21f326daa3
|
|
| BLAKE2b-256 |
6fe525ed61b64c7003093022cc887deb80320455dd6653ef841306b01ef21f93
|
File details
Details for the file lvldb-0.1.2-py3-none-any.whl.
File metadata
- Download URL: lvldb-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bfc247ff43792c59bba0746be7b2d0e3d2780ee6a84a5be3ae741eab3303e19
|
|
| MD5 |
16592eb3e811371688890e1d9791fa72
|
|
| BLAKE2b-256 |
82243872b8a2408a2b13aa6f19915b83bba870a7f932691b0e5ad959f0ce3f6e
|