Skip to main content

A dumb database, not for production

Project description

dumbee

Pretend it's a database

Installation

pip install dumbee

Getting started

import dumbee

# create an Engine
db = dumbee.Engine(
    driver=dumbee.drivers.Filesystem("./data", extensions=[(".", "json")]),
    middlewares=dumbee.Pipeline(
        [
            dumbee.ext.logging.Logger(),
            dumbee.ext.jsonschema.Validator(
                {
                    "schema": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "age":{
                                "type":"number"
                            }
                        },
                        "required":["name"]
                    },
                    "paths":[
                        "./users/[A-Za-z]+$"
                    ]
                }
            ),
            dumbee.ext.json.Serializer(),
        ]
    ),
)

# write and read back a record
me = (
    db
    .collections["users"]
    .get("me")
    .write({"name":"David", "age":32})
    .read()
)

# nested collection
repos = (
    db
    .collections["users"]
    .get("me")
    .collections["repositories"]
    .get("OSS")
    .write(["easychart","easytree","doubledate","dumbee"])
    .read()
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dumbee-0.2.2.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

dumbee-0.2.2-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page