Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.
Installing
Install and update using pip:
$ pip install -U Flask-SQLAlchemy
A Simple Example
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique=True, nullable=False)
email = db.Column(db.String, unique=True, nullable=False)
db.session.add(User(name="Flask", email="example@example.com"))
db.session.commit()
users = User.query.all()
Links
Documentation: https://flask-sqlalchemy.palletsprojects.com/
Issue tracker: https://github.com/pallets/flask-sqlalchemy/issues
Test status: https://travis-ci.org/pallets/flask-sqlalchemy
Test coverage: https://codecov.io/gh/pallets/flask-sqlalchemy
Release files for Flask-SQLAlchemy 2.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-SQLAlchemy-2.5.1.tar.gz | 132.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 150.5 kB
Release files / Flask-SQLAlchemy-2.5.1.tar.gz
| Download URL | Flask-SQLAlchemy-2.5.1.tar.gz |
|---|---|
| Size | 132.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bda44b43e7cacb15d4e05ff3cc1f8bc97936cc464623424102bfc2c35e95912
|
|
BLAKE2b-256 checksum How to use checksums |
35f039dd2d8e7e5223f78a5206d7020dc0e16718a964acfb3564d89e9798ab9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
|
Release files / Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl
| Download URL | Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f12c3d4cc5cc7fdcc148b9527ea05671718c3ea45d50c7e732cceb33f574b390
|
|
BLAKE2b-256 checksum How to use checksums |
262c9088b6bd95bca539230bbe9ad446737ed391aab9a83aff403e18dded3e75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
|