aetherdb


Nameaetherdb JSON
Version 0.0.1b1 PyPI version JSON
download
home_pageNone
SummaryAetherDB is a lightweight document-like database for Python.
upload_time2024-07-05 07:20:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache-2.0 license
keywords database document python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AetherDB
AetherDB is a simple lightweight db stored entirely inside json files and folders. AetherDB is document-like based db, but rather than storing each document as separate json it stores all documents inside json clusters. Data stored in following format:
```json
cluster_0.json
{
    "document_id": {
        "key1": "value1",
        "key2": "value2",
        ...
    }
}
```
Any data type supported by json can be stored.
## Installation
```
pip install aetherdb
```
## Usage
To open db you simply need to create db class instance, specifying path to your db folder. If folder (or folders) in path does not exists they will be created.
```python
from aetherdb import DB
db = DB("path_to_your_DB_folder")
```
After that you can do all kinds of operations on your DB by calling created class instance`s methods.
```python
# Open sub db (create if there is no such sub db)
db.open_sub_db("sub_db_name")
# Create sub db
db.create_sub_db("sub_db_name")
# Delete sub db
db.delete_sub_db("sub_db_name")
# Write butch of data
db.write({"document_id" : { some_data }})
# Read data by document id
db.read("document_id")
# Update data by id
db.update("document_id", { new_data })
# Delete data by id
db.delete("document_id")
# Backup db
db.backup("path_to_where_backup_should_be_stored")
# Make query request to db
db.query("query_text")
```
## Query syntax
Query supports a fixed list of requests:
- selectById{}
- selectByIdRegex{}
- selectWhere{}
- selectWhereRegex{}
- withDB{}
- createDB{}
- deleteSelection{}
- delete{}
- update{}
- insert{}
- withParentDB{}
- filter{}
- backup{}
- return{}
Requests can be chained using ".", for example:
```
selectById{"id"}.return{}
```
All requests should have {}, even if they dont need any data. Data needed for request can be passed inside {}. Each request require some set of data to function.
### Selectors
Selectors will select data from db by some specified data like document id. Selected data will be saved until query will be completed, but will not be returnd unless specified by other requests.
#### selectById
Requires string containig document id to search in db.
```python
selectById{"some_document_id"}
```
#### selectByIdRegex
Requires regular expression to match document ids and returns all data with document ids matching given regular expression.
```python
# This request will select every possible document
selectByIdRegex{".*"}
```
#### selectWhere
Requires comma separated key-value pairs in format `key=value` to search data with same key-value pairs.
```python
selectWhere{"key1=value1,key2=value2"}
```
#### selectWhereRegex
Requires comma separated key-value pairs in format `key=value` to search data with same key-value pairs. Values can be regular expressions to match.
```python
selectWhereRegex{"key1=.*,key2=value2"}
```
### withDB
Requires sub db name. Will open sub db and pass all requests after this request to sub db. Will return averything that sub db will return.
```python
withDB{"sub_db_name"}
```
### createDB
Requires sub db name. Will create sub db with specified name.
```python
createDB{"sub_db_name"}
```
### deleteSelection
Does not require any input. Will delete all data selected by previous requests from db.
```python
deleteSelection{}
```
### delete
Requires document id. Will delete document with specified id from db.
```python
delete{}
```
### update
Requires document id and data to write in document separated by comma. Will update data written in document with specified id to specified data.
```python
update{"document_id,{'key1':'value1','key2':'value2'}"}
```
### insert
Requires data to write to db. Data should be in following format:
```json
{
    "document_id": {
        "key1": "value1",
        "key2": "value2",
        ...
    }
}
```
Data will be added to db.
```python
insert{"{'document_id':{'key1':'value1','key2':'value2',...}}"}
```
### withParentDB
Does not require any input. Will open db in which this sub db is located  and pass all requests after this request to it. If used inside root db will do nothing (Will work only after `withDB`). Will return anything everything that opened db will return.
```python
withParentDB{}
```
### filter
Requires comma separated key-value pairs in format `key=value`. Will filter out all data selected by previous requests and leave in result only data that will match key-value pairs.
```python
filter{"key1=value1,key2=value2"}
```
### backup
Require optional path to where backup should be stored. Will create zip containing backup of current db at specified location. If path not specified backup will be created inside db in backup folder.
```python
backup{"path_to_backup_folder"}
```
### return
Does not require any input. Will return all data selected by previous requests. After this request query will finish, other requests after this will be ignored.
```python
return{}
```
## Contribution
Pull requests will be mostly ignored for now unless they fix some security issues. Please specify what and how your changes will fix.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aetherdb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "database, document, python",
    "author": null,
    "author_email": "Dragooonat <59411437+Dragooonat@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/33/a2/8bcf64e5350d412f7b2f1ba0a2dc5301b01d06e67060e3a747267384bbb7/aetherdb-0.0.1b1.tar.gz",
    "platform": null,
    "description": "# AetherDB\nAetherDB is a simple lightweight db stored entirely inside json files and folders. AetherDB is document-like based db, but rather than storing each document as separate json it stores all documents inside json clusters. Data stored in following format:\n```json\ncluster_0.json\n{\n    \"document_id\": {\n        \"key1\": \"value1\",\n        \"key2\": \"value2\",\n        ...\n    }\n}\n```\nAny data type supported by json can be stored.\n## Installation\n```\npip install aetherdb\n```\n## Usage\nTo open db you simply need to create db class instance, specifying path to your db folder. If folder (or folders) in path does not exists they will be created.\n```python\nfrom aetherdb import DB\ndb = DB(\"path_to_your_DB_folder\")\n```\nAfter that you can do all kinds of operations on your DB by calling created class instance`s methods.\n```python\n# Open sub db (create if there is no such sub db)\ndb.open_sub_db(\"sub_db_name\")\n# Create sub db\ndb.create_sub_db(\"sub_db_name\")\n# Delete sub db\ndb.delete_sub_db(\"sub_db_name\")\n# Write butch of data\ndb.write({\"document_id\" : { some_data }})\n# Read data by document id\ndb.read(\"document_id\")\n# Update data by id\ndb.update(\"document_id\", { new_data })\n# Delete data by id\ndb.delete(\"document_id\")\n# Backup db\ndb.backup(\"path_to_where_backup_should_be_stored\")\n# Make query request to db\ndb.query(\"query_text\")\n```\n## Query syntax\nQuery supports a fixed list of requests:\n- selectById{}\n- selectByIdRegex{}\n- selectWhere{}\n- selectWhereRegex{}\n- withDB{}\n- createDB{}\n- deleteSelection{}\n- delete{}\n- update{}\n- insert{}\n- withParentDB{}\n- filter{}\n- backup{}\n- return{}\nRequests can be chained using \".\", for example:\n```\nselectById{\"id\"}.return{}\n```\nAll requests should have {}, even if they dont need any data. Data needed for request can be passed inside {}. Each request require some set of data to function.\n### Selectors\nSelectors will select data from db by some specified data like document id. Selected data will be saved until query will be completed, but will not be returnd unless specified by other requests.\n#### selectById\nRequires string containig document id to search in db.\n```python\nselectById{\"some_document_id\"}\n```\n#### selectByIdRegex\nRequires regular expression to match document ids and returns all data with document ids matching given regular expression.\n```python\n# This request will select every possible document\nselectByIdRegex{\".*\"}\n```\n#### selectWhere\nRequires comma separated key-value pairs in format `key=value` to search data with same key-value pairs.\n```python\nselectWhere{\"key1=value1,key2=value2\"}\n```\n#### selectWhereRegex\nRequires comma separated key-value pairs in format `key=value` to search data with same key-value pairs. Values can be regular expressions to match.\n```python\nselectWhereRegex{\"key1=.*,key2=value2\"}\n```\n### withDB\nRequires sub db name. Will open sub db and pass all requests after this request to sub db. Will return averything that sub db will return.\n```python\nwithDB{\"sub_db_name\"}\n```\n### createDB\nRequires sub db name. Will create sub db with specified name.\n```python\ncreateDB{\"sub_db_name\"}\n```\n### deleteSelection\nDoes not require any input. Will delete all data selected by previous requests from db.\n```python\ndeleteSelection{}\n```\n### delete\nRequires document id. Will delete document with specified id from db.\n```python\ndelete{}\n```\n### update\nRequires document id and data to write in document separated by comma. Will update data written in document with specified id to specified data.\n```python\nupdate{\"document_id,{'key1':'value1','key2':'value2'}\"}\n```\n### insert\nRequires data to write to db. Data should be in following format:\n```json\n{\n    \"document_id\": {\n        \"key1\": \"value1\",\n        \"key2\": \"value2\",\n        ...\n    }\n}\n```\nData will be added to db.\n```python\ninsert{\"{'document_id':{'key1':'value1','key2':'value2',...}}\"}\n```\n### withParentDB\nDoes not require any input. Will open db in which this sub db is located  and pass all requests after this request to it. If used inside root db will do nothing (Will work only after `withDB`). Will return anything everything that opened db will return.\n```python\nwithParentDB{}\n```\n### filter\nRequires comma separated key-value pairs in format `key=value`. Will filter out all data selected by previous requests and leave in result only data that will match key-value pairs.\n```python\nfilter{\"key1=value1,key2=value2\"}\n```\n### backup\nRequire optional path to where backup should be stored. Will create zip containing backup of current db at specified location. If path not specified backup will be created inside db in backup folder.\n```python\nbackup{\"path_to_backup_folder\"}\n```\n### return\nDoes not require any input. Will return all data selected by previous requests. After this request query will finish, other requests after this will be ignored.\n```python\nreturn{}\n```\n## Contribution\nPull requests will be mostly ignored for now unless they fix some security issues. Please specify what and how your changes will fix.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0 license",
    "summary": "AetherDB is a lightweight document-like database for Python.",
    "version": "0.0.1b1",
    "project_urls": null,
    "split_keywords": [
        "database",
        " document",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "650906c94562be89f0cbfd5717fdeaadc78ec3006dc7ca1be2b65cb3c9ef2e06",
                "md5": "45a0ff0399d3db78bd8efdb3b8dc75a6",
                "sha256": "85b54f74e8adb673690013481065009424a9ea5f1a27d31c51e6388fa02bc5cd"
            },
            "downloads": -1,
            "filename": "aetherdb-0.0.1b1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45a0ff0399d3db78bd8efdb3b8dc75a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10163,
            "upload_time": "2024-07-05T07:20:56",
            "upload_time_iso_8601": "2024-07-05T07:20:56.268109Z",
            "url": "https://files.pythonhosted.org/packages/65/09/06c94562be89f0cbfd5717fdeaadc78ec3006dc7ca1be2b65cb3c9ef2e06/aetherdb-0.0.1b1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33a28bcf64e5350d412f7b2f1ba0a2dc5301b01d06e67060e3a747267384bbb7",
                "md5": "18b4643a6ee30fb43d862adace623fc7",
                "sha256": "1d937e8f92f8ae49885a6325985c98db544fcd1783bfae6b78ca4a8a059b2175"
            },
            "downloads": -1,
            "filename": "aetherdb-0.0.1b1.tar.gz",
            "has_sig": false,
            "md5_digest": "18b4643a6ee30fb43d862adace623fc7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10787,
            "upload_time": "2024-07-05T07:20:57",
            "upload_time_iso_8601": "2024-07-05T07:20:57.522101Z",
            "url": "https://files.pythonhosted.org/packages/33/a2/8bcf64e5350d412f7b2f1ba0a2dc5301b01d06e67060e3a747267384bbb7/aetherdb-0.0.1b1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-05 07:20:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aetherdb"
}
        
Elapsed time: 0.38539s