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.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

dumbee-0.2.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file dumbee-0.2.0.tar.gz.

File metadata

  • Download URL: dumbee-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for dumbee-0.2.0.tar.gz
Algorithm Hash digest
SHA256 276f9bc5ffe566e0bf1c29cb04d47f6970215ed64f6d6338c29b7e523873bca8
MD5 afd55690eec989437e0c1492db8489e7
BLAKE2b-256 f257742c470bfa3b5910646539626a7fa5f2839867ea3f10c1e8c59eaf9a148c

See more details on using hashes here.

File details

Details for the file dumbee-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dumbee-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for dumbee-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 559459fe8fbc11bf857646a58863cc7cd5da527af1d1776969bfed7a6b889aae
MD5 5da9bc01ff40887447805c15db85276e
BLAKE2b-256 3fa003c1ac35a3de1b536defc160ef56ba6fe9488fe81f6894410a8a43f23ed4

See more details on using hashes here.

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