# miftahdb [![version](https://img.shields.io/pypi/v/miftahdb?style=flat&logo=pypi)](https://pypi.org/project/miftahdb) [![Downloads](https://static.pepy.tech/personalized-badge/miftahdb?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/miftahdb)
Easy, Simple and powerful key-value database backed by sqlite3.
### Features
- Fast and easy-to-use database
- Simultaneously **asynchronous** or **synchronous** calls
- Store any data supported by [**pickle**](https://docs.python.org/3/library/pickle.html)
### Requirements
- Python3.8+
### Installation
```bash
pip install miftahdb
```
From github (dev version)
```bash
pip install git+https://github.com/miftahDB/miftahdb-python
```
### Documentation
[miftahdb](https://github.com/miftahDB/miftahdb-python) documentation available at [miftahdb.rtfd.io](https://miftahdb.rtfd.io/).
### Usage
```python
from miftahdb import Client # For sync version do: from miftahdb.sync import Client
import asyncio
async def main():
async with Client("kv.sqlite") as db:
key = "123-456-789"
result = await db.set(key, "Hello world. Bye!")
if await db.exists(key):
get_key = await db.get(key)
print(get_key) # Hello world. Bye!
await db.delete(key)
await db.set(key, "This key has a lifetime of 60 seconds", 60)
print(await db.get(key))
else:
print("Key not found", result)
asyncio.run(main())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/miftahDB/miftahdb-python",
"name": "miftahdb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "sync, asyncio, sqlite, sqlite3, key-value, database, redis",
"author": "vwh",
"author_email": "vwhe@proton.me",
"download_url": "https://files.pythonhosted.org/packages/5d/6d/a09c98c0f23d3deadaa44dec6e8b67b7a36b4bbcf900c2b7745722337f1c/miftahdb-0.2.4.tar.gz",
"platform": null,
"description": "# miftahdb [![version](https://img.shields.io/pypi/v/miftahdb?style=flat&logo=pypi)](https://pypi.org/project/miftahdb) [![Downloads](https://static.pepy.tech/personalized-badge/miftahdb?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/miftahdb)\n\nEasy, Simple and powerful key-value database backed by sqlite3.\n\n### Features\n\n- Fast and easy-to-use database\n- Simultaneously **asynchronous** or **synchronous** calls\n- Store any data supported by [**pickle**](https://docs.python.org/3/library/pickle.html)\n\n### Requirements\n\n- Python3.8+\n\n### Installation\n\n```bash\npip install miftahdb\n```\n\nFrom github (dev version)\n\n```bash\npip install git+https://github.com/miftahDB/miftahdb-python\n```\n\n### Documentation\n\n[miftahdb](https://github.com/miftahDB/miftahdb-python) documentation available at [miftahdb.rtfd.io](https://miftahdb.rtfd.io/).\n\n### Usage\n\n```python\nfrom miftahdb import Client # For sync version do: from miftahdb.sync import Client\nimport asyncio\n\nasync def main():\n async with Client(\"kv.sqlite\") as db:\n\n key = \"123-456-789\"\n result = await db.set(key, \"Hello world. Bye!\")\n\n if await db.exists(key):\n get_key = await db.get(key)\n\n print(get_key) # Hello world. Bye!\n\n await db.delete(key)\n\n await db.set(key, \"This key has a lifetime of 60 seconds\", 60)\n\n print(await db.get(key))\n else:\n print(\"Key not found\", result)\n\n\nasyncio.run(main())\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Easy-to-use synchronous/asynchronous key-value database backed by sqlite3.",
"version": "0.2.4",
"project_urls": {
"Documentation": "https://miftahdb.rtfd.io/",
"Homepage": "https://github.com/miftahDB/miftahdb-python",
"Source": "https://github.com/miftahDB/miftahdb-python",
"Tracker": "https://github.com/miftahDB/miftahdb-python/issues"
},
"split_keywords": [
"sync",
" asyncio",
" sqlite",
" sqlite3",
" key-value",
" database",
" redis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5d6da09c98c0f23d3deadaa44dec6e8b67b7a36b4bbcf900c2b7745722337f1c",
"md5": "365eb6c3853c2f58fc3650b018dbf35d",
"sha256": "0de2035dd89f28d3154f84b10a881cbcbe09ce401d311a67cde934598f691722"
},
"downloads": -1,
"filename": "miftahdb-0.2.4.tar.gz",
"has_sig": false,
"md5_digest": "365eb6c3853c2f58fc3650b018dbf35d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11048,
"upload_time": "2024-09-05T22:14:31",
"upload_time_iso_8601": "2024-09-05T22:14:31.094161Z",
"url": "https://files.pythonhosted.org/packages/5d/6d/a09c98c0f23d3deadaa44dec6e8b67b7a36b4bbcf900c2b7745722337f1c/miftahdb-0.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-05 22:14:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "miftahDB",
"github_project": "miftahdb-python",
"github_not_found": true,
"lcname": "miftahdb"
}