============
ConstDB
============
ConstDB is a very simple and fast read-only embedded key-value database. Keys consist of 64-bit integers or strings and values consist of arbitrary byte strings.
Sample
===============
.. code-block:: python
import constdb
with constdb.create('db_name') as db:
db.add(-2, b'7564')
db.add(3, b'23')
db.add(-1, b'66')
with constdb.read('db_name') as db:
assert db.get(-2) == b'7564'
assert db.get(-1) == b'66'
assert db.get(3) == b'23'
Documenation
===============
ConstDB contains only two functions: ``create`` and ``read``.
``create(filename)`` allows you to create a new ConstDB database.
It takes a filename and returns a ConstDBWriter. A ConstDBWriter has two methods:
- ``add(key, value)``: Adds a key-value pair to the database. The key must be a 64 bit integer or a string. The value must be a byte string.
- ``close()``: Finalize and close the database.
``read(filename)`` allows you to read an existing ConstDB database.
It takes a filename and returns a ConstDBReader. A ConstDBReader has two methods:
- ``get(key)``: Get a value from the database. The key must be a 64 bit integer or a string. Returns the value if the key is in the database. Returns None if the key is not found.
- ``close()``: Finalize and close the database.
Requirements
===============
The only requirement for ConstDB is Python 3.
Raw data
{
"_id": null,
"home_page": "https://github.com/Lalaland/constdb-python",
"name": "constdb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "database embedded",
"author": "Ethan Steinberg",
"author_email": "ethan.steinberg@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3b/a7/50b83435b2197f052b67895e941addf3be652950a0dfa67f16abaddb5a3b/constdb-4.1.0.tar.gz",
"platform": null,
"description": "============\nConstDB\n============\n\nConstDB is a very simple and fast read-only embedded key-value database. Keys consist of 64-bit integers or strings and values consist of arbitrary byte strings.\n\nSample\n===============\n\n.. code-block:: python\n\n import constdb\n\n with constdb.create('db_name') as db:\n db.add(-2, b'7564')\n db.add(3, b'23')\n db.add(-1, b'66')\n\n with constdb.read('db_name') as db:\n assert db.get(-2) == b'7564'\n assert db.get(-1) == b'66'\n assert db.get(3) == b'23'\n\nDocumenation\n===============\n\nConstDB contains only two functions: ``create`` and ``read``.\n\n``create(filename)`` allows you to create a new ConstDB database. \nIt takes a filename and returns a ConstDBWriter. A ConstDBWriter has two methods: \n\n- ``add(key, value)``: Adds a key-value pair to the database. The key must be a 64 bit integer or a string. The value must be a byte string.\n- ``close()``: Finalize and close the database.\n \n``read(filename)`` allows you to read an existing ConstDB database.\nIt takes a filename and returns a ConstDBReader. A ConstDBReader has two methods: \n\n- ``get(key)``: Get a value from the database. The key must be a 64 bit integer or a string. Returns the value if the key is in the database. Returns None if the key is not found.\n- ``close()``: Finalize and close the database.\n \nRequirements\n===============\n\nThe only requirement for ConstDB is Python 3.\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A simple and fast read-only embedded key-value database",
"version": "4.1.0",
"split_keywords": [
"database",
"embedded"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "91c332dbdcae8fb3344cd3f740888cbb",
"sha256": "ee2ee169bd9edf48bda6b207d29e3940d9df1444f68f17c74c64e66eb60a7e3d"
},
"downloads": -1,
"filename": "constdb-4.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "91c332dbdcae8fb3344cd3f740888cbb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3766,
"upload_time": "2022-12-11T20:59:15",
"upload_time_iso_8601": "2022-12-11T20:59:15.768444Z",
"url": "https://files.pythonhosted.org/packages/0a/be/d43b45f27c78257927120eb0981d1c3a90469d1a77bd270b4d36d4fc79b4/constdb-4.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "2c2dbddd00d99242856e7c69b44d6b6d",
"sha256": "d2b9968d2f4066c64780eed79853ee8ded74b4ba573d5f224db528b9c707a272"
},
"downloads": -1,
"filename": "constdb-4.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2c2dbddd00d99242856e7c69b44d6b6d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5126,
"upload_time": "2022-12-11T20:59:18",
"upload_time_iso_8601": "2022-12-11T20:59:18.467207Z",
"url": "https://files.pythonhosted.org/packages/3b/a7/50b83435b2197f052b67895e941addf3be652950a0dfa67f16abaddb5a3b/constdb-4.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-11 20:59:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Lalaland",
"github_project": "constdb-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "constdb"
}