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.9+

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_tinydb-1.3.0.tar.gz
  • Upload date:
  • Size: 11.3 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.tar.gz
Algorithm Hash digest
SHA256 da26c3bd92fe0a0092d97bd2bd43110537da94c85ca9f287c86187fc7e4f73f0
MD5 b392cdca7eb4e70b4c54b71ba3ca5568
BLAKE2b-256 921181ac131e99fb1bd748b0c49a41213a53262fb04fd800a8708a259dfa364a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Flask_tinydb-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2e95b6fba80400203d6314c7e2d71afb6b09c6aae48e9901a7936912652d57d
MD5 7ddaf824b25ed7bcf5a2621b396dbee2
BLAKE2b-256 654587c99cd516f1bdcd1467086bccf85282147d44b6e4f22404dd8f5fcf52ff

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