Skip to main content

Automatic model code generator for SQLAlchemy with Flask support

Project description

GitHub page: flask-sqlacodegen

Fork of sqlacodegen by Alex Gronholm. Based off of version 1.1.6.

What’s different:

  • Support for Flask-SQLAlchemy syntax using --flask option.
  • Defaults to generating backrefs in relationships. --nobackref still included as option in case backrefs are not wanted.
  • Naming of backrefs is class name in snake_case (as opposed to CamelCase) and is pluralized if it’s Many-to-One or Many-to-Many using inflect.
  • Primary joins are explicit.
  • If column has a server_default set it to FetchValue() instead of trying to determine what that value is. Original code did not set the right server defaults in my setup.
  • --ignore-cols ignores special columns when generating association tables. Original code requires all columns to be foreign keys in order to generate association table. Example: --ignore-cols id,inserted,updated.
  • Uses the command flask-sqlacodgen instead of sqlacodegen.


With pip:

pip install flask-sqlacodegen

Without pip:

git clone
cd flask-sqlacodegen/
python install

Project details

Release history Release notifications

This version
History Node

History Node

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
flask_sqlacodegen- (13.4 kB) Copy SHA256 hash SHA256 Wheel 3.5 Sep 12, 2016
flask-sqlacodegen- (11.0 kB) Copy SHA256 hash SHA256 Source None Sep 12, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page