{"id":42398878,"url":"https://github.com/patx/kenobi","last_synced_at":"2026-01-28T01:12:08.897Z","repository":{"id":270535760,"uuid":"207457900","full_name":"patx/kenobi","owner":"patx","description":"kenobiDB is a document based sqlite3 abstraction for Python 3.","archived":false,"fork":false,"pushed_at":"2025-02-14T04:57:34.000Z","size":402,"stargazers_count":68,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T13:58:02.244Z","etag":null,"topics":["atomic","database","datastore","document-based-db","json","nosql","nosql-data-storage","nosql-database","pickledb","process-safe","python","python3","sqlite","sqlite-database","sqlite3","sqlite3-database","thread-safe","yaml"],"latest_commit_sha":null,"homepage":"https://patx.github.io/kenobi/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-10T03:32:44.000Z","updated_at":"2025-09-14T15:40:36.000Z","dependencies_parsed_at":"2025-01-23T22:20:29.146Z","dependency_job_id":"2dff559b-d9ee-415c-b9b5-7f2be596937b","html_url":"https://github.com/patx/kenobi","commit_stats":null,"previous_names":["patx/kenobi"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/patx/kenobi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patx%2Fkenobi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patx%2Fkenobi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patx%2Fkenobi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patx%2Fkenobi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patx","download_url":"https://codeload.github.com/patx/kenobi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patx%2Fkenobi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atomic","database","datastore","document-based-db","json","nosql","nosql-data-storage","nosql-database","pickledb","process-safe","python","python3","sqlite","sqlite-database","sqlite3","sqlite3-database","thread-safe","yaml"],"created_at":"2026-01-28T01:12:07.997Z","updated_at":"2026-01-28T01:12:08.891Z","avatar_url":"https://github.com/patx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"KenobiDB is a document-based data store abstraction built on Python’s `sqlite3`, offering a simple and efficient way to manage JSON-like data. Its API is highly similar to MongoDB’s, providing familiar operations for insertion, updates, and searches—without the need for a server connection. By removing the complexity of SQL, KenobiDB delivers a secure, high-performance environment with built-in thread safety, async execution, and basic indexing while leveraging the simplicity of a document-based database. Perfect for small applications and prototypes, KenobiDB combines SQLite’s lightweight, serverless setup with the flexibility of document-based storage. Check out the [website](http://patx.github.io/kenobi/) or view the project on [PyPI](https://pypi.org/project/kenobi/).\n\n## Features\n\n- Lightweight and serverless setup using SQLite.\n- MongoDB-like API for familiar operations.\n- Supports key-value pair searching instead of complex SQL queries.\n- Thread safety with `RLock`.\n- Asynchronous execution with `ThreadPoolExecutor`.\n- Built-in basic indexing for efficient searches.\n- Super easy integration.\n- Solid performance\n\n## Installation\n\nYou can install KenobiDB using pip:\n\n```bash\npip install kenobi\n```\n\nAlternatively, for the latest version, copy and paste the `kenobi.py` file into your working directory.\n\n## Quick Start\n\n```python\nfrom kenobi import KenobiDB\n\ndb = KenobiDB('example.db')\n\ndb.insert({'name': 'John', 'color': 'blue'})\n# Output: True\n\ndb.search('color', 'blue')\n# Output: [{'name': 'John', 'color': 'blue'}]\n```\n\n## Overview/Usage\n\n### Initialization and Setup\n\nInitialize the database with a specified file. If the file does not exist, it will be created. SQLite is used for storage, and the database ensures the necessary table and indices are created.\n\n```python\ndb = KenobiDB('example.db')\n```\n\n### Basic Operations\n\n#### Insert\n\nAdd a single document or multiple documents to the database.\n\n```python\ndb.insert({'name': 'Oden', 'color': 'blue'})\n\ndb.insert_many([\n    {'name': 'Ryan', 'color': 'red'},\n    {'name': 'Tom', 'color': 'green'}\n])\n```\n\n#### Remove\n\nRemove documents matching a specific key-value pair.\n\n```python\ndb.remove('name', 'Oden')\n```\n\n#### Update\n\nUpdate documents matching a specific key-value pair with new data.\n\n```python\ndb.update('name', 'Ryan', {'color': 'dark'})\n```\n\n#### Purge\n\nRemove all documents from the database.\n\n```python\ndb.purge()\n```\n\n### Search Operations\n\n#### All\n\nRetrieve all documents with optional pagination.\n\n```python\ndb.all(limit=10, offset=0)  # With pagination\n\ndb.all()  # No pagination\n```\n\n#### Search\n\nRetrieve documents matching a specific key-value pair with optional pagination.\n\n```python\ndb.search('color', 'blue')\n```\n\n#### Glob Search\n\nRetrieve documents using regex.\n\n```python\ndb.search_pattern('color', 'b*')\n```\n\n#### Find Any\n\nRetrieve documents where a key matches any value in a list.\n\n```python\ndb.find_any('color', ['blue', 'red'])\n```\n\n#### Find All\n\nRetrieve documents where a key matches all values in a list.\n\n```python\ndb.find_all('color', ['blue', 'red'])\n```\n\n### Concurrency and Asynchronous Execution\n\nKenobiDB uses `RLock` for thread safety and `ThreadPoolExecutor` with a maximum of 5 workers for concurrent operations.\n\n#### Asynchronous Execution\n\nUse the `execute_async` method to run functions asynchronously.\n\n```python\ndef insert_document(db, document):\n    db.insert(document)\n\nfuture = db.execute_async(insert_document, db, {'name': 'Luke', 'color': 'green'})\n```\n\n#### Close\n\nShut down the thread pool executor.\n\n```python\ndb.close()\n```\n\n## Testing and Contributions\n\nContributions are welcome! To test the library:\n\n1. Clone the repository.\n2. Report issues as you encounter them.\n3. Run the unittests.\n\nFeel free to open issues or submit pull requests on the [GitHub repository](https://github.com/patx/kenobi).\n\n## Limitations\n\nKenobiDB is designed for small-scale applications and prototypes. While it provides excellent performance for most operations, it is not intended to replace full-fledged databases for high-scale or enterprise-level applications for that you should use MongoDB.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatx%2Fkenobi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatx%2Fkenobi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatx%2Fkenobi/lists"}