Skip to main content

BlanketDB

https://img.shields.io/pypi/v/blanketdb.svg https://img.shields.io/travis/luphord/blanketdb.svg Documentation Status Docker Automated build

BlanketDB is a very simple database written in Python based on SQLite. It is intended for small IoT projects where you need a quick way to collect and store data from sensors and other devices. You communicate to BlanketDB using HTTP GET / POST / DELETE requests. Request and response bodies are usually JSON, but you can also POST HTML forms directly to BlanketDB. There is no schema in the database, you simply store objects in buckets.

BlanketDB is free software provided under a MIT license. Documentation is available at https://blanketdb.readthedocs.io.

Why is it called BlanketDB? Well, a blanket is simple, lightweight, portable and keeps you warm. But if you really want to relax, you’ll need a couch.

Features

  • GET / POST / DELETE requests to communicate with BlanketDB

  • JSON requests / responses

  • HTML forms can POST directly to BlanketDB

  • Data stored in buckets

  • Schemaless

  • Query using various parameters to a HTTP GET request

  • Data is stored in a single file on the file system which is a SQLite database

  • BlanketDB is a single Python file without any dependencies besides the standard library

  • No sequrity whatsoever; BlanketDB is completely open to readers and writers (use with care!)

Quickstart

To install BlanketDB, you’ll need a Python (>=3.4) installation with pip:

$ pip install blanketdb

To use BlanketDB as a standalone database (and communicate over HTTP), enter the following command:

$ python3 -m blanketdb -i localhost -p 8080 -f /path/to/db.sqlite

BlanketDB will now serve its web interface at http://localhost:8080. You can open this page in your browser to check if everything works.

To use BlanketDB in a Python project, enter the following code:

from blanketdb import BlanketDB
db = BlanketDB('/path/to/db.sqlite')

# you can now use db using its Python API
db.store_dict(x='test')['id']
for entry in db:
    print(entry)

# db is alse a wsgi conforming callable
# you can use it e.g. with the wsgi reference implementation
from wsgiref.simple_server import make_server
httpd = make_server('localhost', 8080, db)
httpd.serve_forever()

Detailed documentation is available at https://blanketdb.readthedocs.io.

Credits

Main author and project maintainer is luphord.

This package was prepared with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.4.0 (2020-02-26)

  • Start uwsgi using http protocol by default in DOCKERFILE (s.t. standalone use is possible)

  • Overwrite CMD in docker-compose file to communicate via uwsgi protocol between nginx and blanketdb container

0.3.4 (2020-02-26)

  • Support Python 3.8

0.3.3 (2019-12-12)

  • Split tests into Python and HTTP API tests

  • Added tests that can be executed against an actual HTTP API of BlanketDB

0.3.2 (2019-12-04)

  • Release to trigger build on dockerhub

0.3.1 (2019-03-06)

  • Improved clarity with default values

0.3 (2019-03-06)

  • Type annotations for BlanketDB

  • Python 3.4 is not supported anymore (as it does not know type annotations)

0.2.2 (2019-01-31)

  • setuptools entrypoint for cli

  • quickstart documentation

  • added logo

0.2.1 (2019-01-24)

  • fix tag confusion

0.2.0 (2019-01-24)

  • Added CLI for starting BlanketDB with wsgiref.simple_server

  • Tests for BlanketDB Web API using webtest

  • Added documentation for usage and Web API

0.1.0 (2019-01-18)

  • First release on PyPI.

Metadata

Release files for blanketdb 0.4.0

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

Source distribution (sdist)

Source distribution for blanketdb 0.4.0
File Size Uploaded Provenance
blanketdb-0.4.0.tar.gz 36.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for blanketdb 0.4.0
File Interpreter ABI Platform
blanketdb-0.4.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 49.3 kB

Release files / blanketdb-0.4.0.tar.gz

Download URL blanketdb-0.4.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fd57f3e250bf1c9918fa93537bce081b9677215ebbcf77fbf4858e55ed548dc6
BLAKE2b-256 checksum
How to use checksums
4db1e5186bc02d5d854ffc0aa9d6d24727e5c6232b0a48c9cf0034e97ef6662e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / blanketdb-0.4.0-py2.py3-none-any.whl

Download URL blanketdb-0.4.0-py2.py3-none-any.whl
Size 12.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4143fdf8142ab3d375f1eb85cff1c14856d2124b30bf7921446bcb2a1cbc2adc
BLAKE2b-256 checksum
How to use checksums
b2a9a4b210dbe5f7bf1d5ec8b486f338299007c468c713499c4b66632078addf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for blanketdb 0.4.0

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.

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