Skip to main content

flask-tinydb is a Flask extension that provides a TinyDB database.

Project description

flask-tinydb is a Flask extension that provides a TinyDB database.

  • tiny 🔍

  • fast 🚀

  • simple 💡

  • lightweight 📦

  • typed ✨

requirements

  • Python 3.8+

  • Flask 1.0+

  • TinyDB 4.0+

  • pyyaml 6.0+(optinal)

install

via pip:

pip install flask-tinydb

via source:

git clone https://github.com/mmdbalkhi/flask-tinydb.git
cd flask-tinydb
python setup.py install

usage

from flask import Flask, jsonify
from flask_tinydb import TinyDB

app = Flask(__name__)
db = TinyDB(app).get_db()

@app.route('/<username>')
def index(username):
    db.insert({'name': username})
    return f"{username} added to database"

@app.route('/users')
def users():
    return jsonify(db.all())

if __name__ == '__main__':
    app.run()

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

flask_tinydb-1.3.0.dev0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

Flask_tinydb-1.3.0.dev0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file flask_tinydb-1.3.0.dev0.tar.gz.

File metadata

  • Download URL: flask_tinydb-1.3.0.dev0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flask_tinydb-1.3.0.dev0.tar.gz
Algorithm Hash digest
SHA256 63cd1fe8d9dc4db2e7926655c1e47446bc3c2b8985453b73587e8a856503d055
MD5 a188b4330619d576e182d33b2f09a5e8
BLAKE2b-256 0e559b832d3f8acba66e3ef89ed11b656e4a6ecf784df8f9492a4aeefe2bcc44

See more details on using hashes here.

File details

Details for the file Flask_tinydb-1.3.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_tinydb-1.3.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 acc9d0ce4f9decf943a6eded8329ae9b279cb956861e4dd6fc22344e5773385b
MD5 0740699e8ecc3ebeddb64074c9109abf
BLAKE2b-256 02d476a5b1edde7cdd1c9e68d19cdb59f1603bce70b92222fc20f2020f81dfa5

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