Flask-RESTAlchemy
A Flask extension to build REST APIs. It dismiss the need of building Schema classes, since usually all the information needed to serialize an SQLAlchemy instance is in the model itself.
By adding a model to the API, all its properties will be exposed:
class User(Base):
__tablename__ = "User"
id = Column(Integer, primary_key=True)
firstname = Column(String)
lastname = Column(String)
email = Column(String)
password = Column(String)
api = Api(flask_app)
api.add_model(User, "/user")
To change the way properties are serialized, declare only the one that needs a non-default behaviour:
from serialchemy import ModelSerializer, Field
class UserSerializer(ModelSerializer):
password = Field(load_only=True)
api = Api(flask_app)
api.add_model(User, "/user", serializer_class=UserSerializer)
Development Setup
Requires uv.
uv python pin 3.10
uv sync --group dev
source .venv/bin/activate
If serialchemy is checked out as a sibling repository, install it as an editable dependency:
uv pip install -e ../serialchemy
Run the tests:
pytest src/flask_restalchemy/tests/
Release
A reminder for the maintainers on how to make a new release.
Note that the VERSION should folow the semantic versioning as X.Y.Z Ex.: v1.0.5
- Create a
release-VERSIONbranch fromupstream/master. - Update
CHANGELOG.rst. - Push a branch with the changes.
- Once all builds pass, push a
VERSIONtag toupstream. - Merge the PR.
Metadata
Release files for flask-restalchemy 0.15.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 | Provenance | |
|---|---|---|---|---|
| flask_restalchemy-0.15.1.tar.gz | 95.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_restalchemy-0.15.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.5 kB
Release files / flask_restalchemy-0.15.1.tar.gz
| Download URL | flask_restalchemy-0.15.1.tar.gz |
|---|---|
| Size | 95.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83028a1f551850b02a338ff7426bfb3f218a44a6f1f01bc44aad12de72713ac2
|
|
BLAKE2b-256 checksum How to use checksums |
0e619c0f1f219a6473793f5924c9719fe511c080d04fa3cb8e7f1f2f818adfec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / flask_restalchemy-0.15.1-py3-none-any.whl
| Download URL | flask_restalchemy-0.15.1-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6729a2e5900595826a7f27df4ebddbec7fa09a42c05131879293af465db55fb7
|
|
BLAKE2b-256 checksum How to use checksums |
18a36f0f7695077fb06d0ccbfd6f2da8774fc604767a5344530bc69181d33e3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for flask-restalchemy 0.15.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.