# 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}")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jtolio/leveldb-py",
"name": "lvldb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Python,LevelDB",
"author": "JT Olds",
"author_email": "jt@spacemonkey.com",
"download_url": "https://files.pythonhosted.org/packages/96/35/b0e0e49e519ba5ccbe5df8670d1082beebc9108b41a14374f64e78512e7d/lvldb-0.1.1.tar.gz",
"platform": null,
"description": "# ctypes bindings for LevelDB \n\nThe 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. \n\nlvldb:\n * Python 2-3 compatible\n * supports get/put/delete (with standard read/write options)\n * supports bloom filters\n * supports leveldb LRU cache\n * allows for manual or automatic database closing (compare with py-leveldb)\n * provides write batches\n * provides iterators (full control of leveldb iteration, with additional idiomatic python iterator support)\n * 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)\n * provides scoped sub-databases (presents a new database wrapper backed by an existing database with all keys prefixed by some prefix)\n * provides range iterators (for idioms like give me all keys between start and end)\n * provides an in-memory db implementation (for faster unit tests)\n * supports snapshots\n * fits in one file\n * requires no compilation\n \n## Sample Usage \n\n```\n# Python3\nimport lvldb\n\ndb = lvldb.DB(\"/path/to/db\", create_if_missing=True)\ndb.put(\"key1\", \"value1\")\ndb.put(\"key2\", \"value2\")\nprint(f\"key1 => {db.get('key1')} \")\n\nfor key, value in db:\n print(f\"{key} => {value}\")\n```\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Python bindings for LevelDB. Python 2-3 compatible",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/jtolio/leveldb-py"
},
"split_keywords": [
"python",
"leveldb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2a12b81fe0b995bbd37e7d9b86df4a9448034e7d8d1ff08725a6af6b42ac97db",
"md5": "8f57bf9613c427193216be420906f854",
"sha256": "655af1a67abc949b0bd02158350275b5a8eeec7baa779b8d0a4cfe904df31eb4"
},
"downloads": -1,
"filename": "lvldb-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f57bf9613c427193216be420906f854",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10259,
"upload_time": "2024-02-01T16:39:49",
"upload_time_iso_8601": "2024-02-01T16:39:49.428241Z",
"url": "https://files.pythonhosted.org/packages/2a/12/b81fe0b995bbd37e7d9b86df4a9448034e7d8d1ff08725a6af6b42ac97db/lvldb-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9635b0e0e49e519ba5ccbe5df8670d1082beebc9108b41a14374f64e78512e7d",
"md5": "99141fcb11db7c251e8a324276c31d2e",
"sha256": "5118bbab8ea10bc072a9e81663a4f5362b22839ec096d0cadcff6e1722b61c0c"
},
"downloads": -1,
"filename": "lvldb-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "99141fcb11db7c251e8a324276c31d2e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14476,
"upload_time": "2024-02-01T16:39:51",
"upload_time_iso_8601": "2024-02-01T16:39:51.767378Z",
"url": "https://files.pythonhosted.org/packages/96/35/b0e0e49e519ba5ccbe5df8670d1082beebc9108b41a14374f64e78512e7d/lvldb-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-01 16:39:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jtolio",
"github_project": "leveldb-py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "lvldb"
}