SQLAlchemy-Handler is an extension that still like Flask-SQLAlchemy adds more support for SQLAlchemy to your application. It helps to handle models with humanized ids once it is jsonified, throws api errors for some casting of value during the save time.
[](https://circleci.com/gh/betagouv/sqlalchemy-handler/tree/master) [](https://coveralls.io/github/betagouv/sqlalchemy-handler)
Installing
Install and update using pip:
$ pip install -U SQLAlchemy-Handler
A Simple Example
from flask import Flask
from sqlalchemy_handler import Handler
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
db = SQLAlchemy(app)
class User(Handler, 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)
user = User(username="Flask", email="example@example.com")
Handler.save(user)
Links
Documentation: https://sqlalchemy-handler.betagouv.fr/
Issue tracker: https://github.com/betagouv/sqlalchemy-handler/issues
Test status: https://travis-ci.org/betagouv/sqlalchemy-handler
Test coverage: https://codecov.io/gh/betagouv/sqlalchemy-handler
SQLAlchemy: https://www.sqlalchemy.org
Deploy
First, make sure that the deploy environment is started:
./sqlah start
In a second tab, then:
Change the __version__ into sqlalchemy_handler/__init__.py
Pre publish:
./sqlah prepublish
Publish:
./sqlah publish
Release files for SQLAlchemy-Handler 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| SQLAlchemy-Handler-0.0.3.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| SQLAlchemy_Handler-0.0.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 31.2 kB
Release files / SQLAlchemy-Handler-0.0.3.tar.gz
| Download URL | SQLAlchemy-Handler-0.0.3.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50b884c2e5d5f63dc85af86bb29360b1b0d0f36ea57629f5e47077ea9c3af822
|
|
BLAKE2b-256 checksum How to use checksums |
1c74e390b3ef442d40b87d5be6ed7d4f124cfdef88e55a5961c82ae8696f8117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / SQLAlchemy_Handler-0.0.3-py2.py3-none-any.whl
| Download URL | SQLAlchemy_Handler-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
52103fb58677621260a15fab109d566cd68924a0ef2605ae85f9c1e3ccae53e2
|
|
BLAKE2b-256 checksum How to use checksums |
a84ec7f5b60757a7118856489c8e8ac11246632399275a48bce8d0d726a3e4aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|