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()
Links
Documentation: https://flask-tinydb.readthedocs.io/
Source Code: https://github.com/mmdbalkhi/flask-tinydb
Issue Tracker: https://github.com/mmdbalkhi/flask-tinydb/issues/
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63cd1fe8d9dc4db2e7926655c1e47446bc3c2b8985453b73587e8a856503d055 |
|
MD5 | a188b4330619d576e182d33b2f09a5e8 |
|
BLAKE2b-256 | 0e559b832d3f8acba66e3ef89ed11b656e4a6ecf784df8f9492a4aeefe2bcc44 |
File details
Details for the file Flask_tinydb-1.3.0.dev0-py3-none-any.whl
.
File metadata
- Download URL: Flask_tinydb-1.3.0.dev0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acc9d0ce4f9decf943a6eded8329ae9b279cb956861e4dd6fc22344e5773385b |
|
MD5 | 0740699e8ecc3ebeddb64074c9109abf |
|
BLAKE2b-256 | 02d476a5b1edde7cdd1c9e68d19cdb59f1603bce70b92222fc20f2020f81dfa5 |