Skip to main content

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.

[![CircleCI](https://circleci.com/gh/betagouv/sqlalchemy-handler/tree/master.svg?style=svg)](https://circleci.com/gh/betagouv/sqlalchemy-handler/tree/master) [![Coverage Status](https://coveralls.io/repos/github/betagouv/sqlalchemy-handler/badge.svg)](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)

Deploy

First, make sure that the deploy environment is started:

./sqlah start

In a second tab, then:

  1. Change the __version__ into sqlalchemy_handler/__init__.py

  2. Pre publish:

./sqlah prepublish
  1. 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)

Source distribution for SQLAlchemy-Handler 0.0.3
File Size Uploaded
SQLAlchemy-Handler-0.0.3.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SQLAlchemy-Handler 0.0.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page