Skip to content

Instantly share code, notes, and snippets.

@kevinmmartins
Last active November 8, 2018 11:52
Show Gist options
  • Save kevinmmartins/33b68bbf94d7d5599df860e0874d654f to your computer and use it in GitHub Desktop.
Save kevinmmartins/33b68bbf94d7d5599df860e0874d654f to your computer and use it in GitHub Desktop.
Generate SQLAlchemy Models from Postgres using sqlacodegen
sqlacodegen postgresql://user:pass@host:5432/database

Install

pip install sqlacodegen

Error with psycopg2

If you have the problem:

ImportError: No module named 'psycopg2'

Run:

sudo apt-get install build-dep python-psycopg2
pip install psycopg2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment