Skip to main content

SQLAlchemy Helpers

Project description

SQLAlchemy Helpers

This project contains a tools to use SQLAlchemy and Alembic in a project.

It has a Flask integration, and other framework integrations could be added in the future.

The full documentation is on ReadTheDocs.

You can install it from PyPI.

PyPI Supported Python versions Build status Documentation

Features

Here's what sqlalchemy-helpers provides:

  • Alembic integration:
    • programmatically create or upgrade your schema,
    • get information about schema versions and status
    • drop your tables without leaving alembic information behind
    • use a function in your env.py script to retrieve the database URL, and thus avoid repeating your configuration in two places.
    • migration helper functions such as is_sqlite() or exists_in_db()
  • SQLAlchemy naming convention for easier schema upgrades
  • Automatically activate foreign keys on SQLite
  • Addition of some useful query properties on your models
  • A query function get_or_create() that you can call directly or use on your model classes
  • Optional Flask integration: you can use sqlalchemy-helpers outside of a Flask app and feel at home
  • The models created with sqlalchemy-helpers work both inside and outside the Flask application context
  • Support for asyncio and FastAPI.

This project has 100% code coverage and aims at reliably sharing some of the basic boilerplate between applications that use SQLAlchemy.

Check out the User Guide to learn how to use it in your application, with or without a web framework.

FAQ

Those projects are great, but we also have apps that are not based on Flask and that would benefit from the features provided by sqlalchemy-helpers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlalchemy_helpers-0.13.0.tar.gz (28.1 kB view hashes)

Uploaded Source

Built Distribution

sqlalchemy_helpers-0.13.0-py3-none-any.whl (36.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page