Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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:

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.

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.

# 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.

selectById{"some_document_id"}

selectByIdRegex

Requires regular expression to match document ids and returns all data with document ids matching given regular expression.

# 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.

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.

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.

withDB{"sub_db_name"}

createDB

Requires sub db name. Will create sub db with specified name.

createDB{"sub_db_name"}

deleteSelection

Does not require any input. Will delete all data selected by previous requests from db.

deleteSelection{}

delete

Requires document id. Will delete document with specified id from db.

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.

update{"document_id,{'key1':'value1','key2':'value2'}"}

insert

Requires data to write to db. Data should be in following format:

{
    "document_id": {
        "key1": "value1",
        "key2": "value2",
        ...
    }
}

Data will be added to db.

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.

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.

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.

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.

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.

Metadata

Release files for aetherdb 0.0.1b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aetherdb 0.0.1b1
File Size Uploaded Provenance Actions
aetherdb-0.0.1b1.tar.gz 10.8 kB Without provenance Details for aetherdb-0.0.1b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aetherdb 0.0.1b1
File Interpreter ABI Platform Actions
aetherdb-0.0.1b1-py3-none-any.whl Python 3 none any Details for aetherdb-0.0.1b1-py3-none-any.whl

Total release size: 20.9 kB

Release files / aetherdb-0.0.1b1.tar.gz

Download URL aetherdb-0.0.1b1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1d937e8f92f8ae49885a6325985c98db544fcd1783bfae6b78ca4a8a059b2175
BLAKE2b-256 checksum
How to use checksums
33a28bcf64e5350d412f7b2f1ba0a2dc5301b01d06e67060e3a747267384bbb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / aetherdb-0.0.1b1-py3-none-any.whl

Download URL aetherdb-0.0.1b1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85b54f74e8adb673690013481065009424a9ea5f1a27d31c51e6388fa02bc5cd
BLAKE2b-256 checksum
How to use checksums
650906c94562be89f0cbfd5717fdeaadc78ec3006dc7ca1be2b65cb3c9ef2e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for aetherdb 0.0.1b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page