{"id":22191950,"url":"https://github.com/klich3/rocket-store-python","last_synced_at":"2026-02-13T11:28:48.612Z","repository":{"id":212655375,"uuid":"725702573","full_name":"klich3/rocket-store-python","owner":"klich3","description":"Using the filesystem as a searchable database.","archived":false,"fork":false,"pushed_at":"2024-06-27T15:52:12.000Z","size":358,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T05:05:00.692Z","etag":null,"topics":["database","database-management","document","fast-storage","file","filebase","record","store","store-file"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klich3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["klich3"],"ko_fi":"klich3"}},"created_at":"2023-11-30T17:39:16.000Z","updated_at":"2024-06-27T15:52:16.000Z","dependencies_parsed_at":"2023-12-15T13:18:50.029Z","dependency_job_id":"745ecea2-1ff8-490c-91c7-a51d2ec05833","html_url":"https://github.com/klich3/rocket-store-python","commit_stats":null,"previous_names":["klich3/rocket-store-python"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klich3%2Frocket-store-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klich3%2Frocket-store-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klich3%2Frocket-store-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klich3%2Frocket-store-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klich3","download_url":"https://codeload.github.com/klich3/rocket-store-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727046,"owners_count":19687098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","database-management","document","fast-storage","file","filebase","record","store","store-file"],"created_at":"2024-12-02T12:18:28.771Z","updated_at":"2026-02-13T11:28:48.562Z","avatar_url":"https://github.com/klich3.png","language":"Python","funding_links":["https://github.com/sponsors/klich3","https://ko-fi.com/klich3"],"categories":[],"sub_categories":[],"readme":"# Rocket-Store Python\n\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n[![Issues](http://img.shields.io/github/issues/klich3/rocket-store-python.svg)]( https://github.com/klich3/rocket-store-python/issues )\n[![GitHub pull-requests](https://img.shields.io/github/issues-pr/paragi/rocket-store.svg)](https://github.com/klich3/rocket-store-python/pull/)\n\n***Using the filesystem as a searchable database.***\n\nRocketstore is a Python library for data storage. It provides an interface for storing and retrieving data in various formats.\n\n***ORIGINAL / NODE VERSION:*** https://github.com/Paragi/rocket-store/\n\nYou can download from PyPi repository: https://pypi.org/project/Rocket-Store/\n\n---\n\n# Basic terminology\n\nRocket-Store was made to replace a more complex database, in a setting that required a low footprint and high performance.\n\nRocket-Store is intended to store and retrieve records/documents, organized in collections, using a key.\n\nTerms used:\n* __Collection__: name of a collections of records. (Like an SQL table)\n* __Record__: the data store. (Like an SQL row)\n* __Data storage area__: area/directory where collections are stored. (Like SQL data base)\n* __Key__: every record has exactly one unique key, which is the same as a file name (same restrictions) and the same wildcards used in searches.\n\nCompare Rocket-Store, SQL and file system terms:\n\n| Rocket-Store | SQL| File system |\n|---|---|---\n| __storage area__     |  database     |  data directory root   |\n| __collection__       |  table        |  directory             |\n| __key__              |  key          |  file name             |\n| __record__           |  row          |  file                  |\n\n\n## Features\n\n- Support for file locking.\n- Support for creating data storage directories.\n- Support for adding auto incrementing sequences and GUIDs to keys.\n\n\n## Usage\n\nTo use Rocketstore, you must first import the library:\n\n```python\nfrom Rocketstore import Rocketstore\n\nrs = Rocketstore()\n```\n\nusage of constants:\n```python\n\n#method 1:\nrs = Rocketstore()\nrs.post(..., rs._FORMAT_JSON)\n\n#or \n\nrs.post(..., Rocketstore._FORMAT_JSON)\n\n```\n\n\n### Post\n\n```python\nrs.post(collection=\"delete_fodders1\", key=\"1\", record={\"some\":\"json input\"}, flags=Rocketstore._FORMAT_JSON)\n# or\nrs.post(\"delete_fodders1\", \"1\", {\"some\":\"json input\"}, Rocketstore._FORMAT_JSON)\n```\n\nStores a record in a collection identified by a unique key\n\n__Collection__ name to contain the records.\n\n__Key__ uniquely identifying the record\n\nNo path separators or wildcards etc. are allowed in collection names and keys.\nIlligal charakters are silently striped off.\n\n__Content__ Data input to store\n\n__Options__\n  * _ADD_AUTO_INC:  Add an auto incremented sequence to the beginning of the key\n  * _ADD_GUID: Add a Globally Unique IDentifier to the key\n\n__Returns__ an associative array containing the result of the operation:\n* count : number of records affected (1 on succes)\n* key:   string containing the actual key used\n\n\nIf the key already exists, the record will be replaced.\n\nIf no key is given, an auto-incremented sequence is used as key.\n\nIf the function fails for any reason, an error is thrown.\n\n### Get\n\nFind and retrieve records, in a collection.\n\n```python\nrs.get(collection=\"delete_fodders1\")\n\n# or\nrs.get(\"delete_fodders1\")\n\n# Get wildcard\nrs.get(\"delete_*\")\n\n# Get wildcard in collection\nrs.get(\"*\")\n\n# Get wildcard in key (see sample in Samples/queries.py)\nrs.get(\"delete_fodders1\", \"*\")\n\n# Get only auto incremented rows (see sample in Samples/queries.py)\nrs.get(\"delete_fodders1\", \"?\")\n\n# get only keys\nrs.get(\"delete_fodders1\", \"*\", Rocketstore._KEYS)\n```\n\n__Collection__ to search. If no collection name is given, get will return a list of data base assets: collections and sequences etc.\n\n__Key__ to search for. Can be mixed with wildcards '\\*' and '?'. An undefined or empty key is the equivalent of '*'\n\n__Options__:\n  * _ORDER       : Results returned are ordered alphabetically ascending.\n  * _ORDER_DESC  : Results returned are ordered alphabetically descending.\n  * _KEYS        : Return keys only (no records)\n  * _COUNT       : Return record count only\n\n__Return__ an array of\n* count   : number of records affected\n* key     : array of keys\n* result  : array of records\n\nNB: wildcards are very expensive on large datasets with most filesystems.\n(on a regular PC with +10^7 records in the collection, it might take up to a second to retreive one record, whereas one might retrieve up to 100.000 records with an exact key match)\n\n### Delete\n\nDelete one or more records, whos key match.\n\n```python\n# Delete database\nrs.delete()\n\n# Delete collection with content\nrs.delete(\"delete_fodders1\")\n\n# Delete wild collection \nrs.delete(\"delete_*\")\n\n# Delete exact key\nrs.delete(\"delete_fodders1\", \"1\")\n\n```\n\n__Collection__ to search. If no collection is given, **THE WHOLE DATA BASE IS DELETED!**\n\n__Key__ to search for. Can be mixed with wildcards '\\*' and '?'. If no key is given, **THE ENTIRE COLLECTION INCLUDING SEQUENCES IS DELETED!**\n\n__Return__ an array of\n* count : number of records or collections affected\n\n### Options\n\nCan be called at any time to change the configuration values of the initialized instance\n\n__Options__:\n  * data_storage_area: The directory where the database resides. The default is to use a subdirectory to the temporary directory provided by the operating system. If that doesn't work, the DOCUMENT_ROOT directory is used.\n  * data_format: Specify which format the records are stored in. Values are: _FORMAT_NATIVE - default. and RS_FORMAT_JSON - Use JSON data format.\n\n```python\nrs.options(data_format=Rocketstore._FORMAT_JSON)\n# or\nrs.options(**{\n  \"data_format\": Rocketstore._FORMAT_JSON,\n  ...\n})\n```\n\n#### Inserting with Globally Unique IDentifier key\n\nAnother option is to add a GUID to the key.\nThe GUID is a combination of a timestamp and a random sequence, formatet in accordance to  RFC 4122 (Valid but slightly less random)\n\nIf ID's are generated more than 1 millisecond apart, they are 100% unique.\nIf two ID's are generated at shorter intervals, the likelyhod of collission is up to 1 of 10^15.\n\n---\n\n### Contribute\nContributions are welcome. Please open an issue to discuss what you would like to change.\n\n---\n\n### Docs:\n* https://packaging.python.org/en/latest/tutorials/packaging-projects/\n* https://realpython.com/pypi-publish-python-package/\n\n### Publish to Pypi\n\n***Local:***\n```shell\npython -m pip install build twine\npython3 -m build   \ntwine check dist/*\ntwine upload dist/*\n```\n\n***Live:***\nNo need do nothing GitHub have Workflow action its publish auto\n\n---\n\n### Local dev\n\nIn root folder run create virtual env `virtualenv ./venv \u0026\u0026 . ./venv/bin/activate`\nand run `pip install -e .`\n\n---\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=klich3/rocket-store-python\u0026type=Date)](https://star-history.com/#klich3/rocket-store-python\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklich3%2Frocket-store-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklich3%2Frocket-store-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklich3%2Frocket-store-python/lists"}