{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/2"},{"label":"Code Generators","url":"https://skillfed.io/packages/category/software-development-code-generators"}],"enrichment":{"capability":"Reads an existing database schema and generates SQLAlchemy model code automatically, supporting multiple output formats including declarative classes, dataclasses, and SQLModel.","skillfed_tags":["code-generation","orm-tooling","schema-reverse-engineering"],"use_cases":["Quickly bootstrap SQLAlchemy models from a legacy database without manual class definition.","Generate dataclass-based models for modern Python projects that prefer immutability or type hints.","Create SQLModel definitions for FastAPI applications that need both ORM and API schema in one model.","Reverse-engineer relationship logic (foreign keys, many-to-many joins) automatically instead of writing it by hand.","Maintain model code when the database schema changes by regenerating and comparing the output."],"what_it_does":"sqlacodegen is a command-line tool that introspects an existing database and generates the corresponding SQLAlchemy model definitions. It reads the database schema\u2014tables, columns, constraints, relationships\u2014and outputs Python code that you can use directly in your application. The tool supports multiple code generation styles: traditional declarative classes, dataclasses, and SQLModel, letting you choose the pattern that fits your project.\n\nThe generator handles relationship detection (many-to-one, one-to-one, many-to-many), joined table inheritance, and produces PEP 8 compliant code. It includes options to control naming (using the inflect library to singularize class names), constraint handling, and dialect-specific type preservation. This is useful when you have an existing database and want to avoid hand-writing boilerplate ORM models, or when you need to keep models synchronized with schema changes.","worth_installing":"Yes. This is a mature, actively maintained tool (Production/Stable status, recent release) with low install friction and no known vulnerabilities. It solves a real problem\u2014avoiding tedious hand-written ORM boilerplate\u2014and is well-suited for projects with existing databases or frequent schema changes. The permissive MIT license adds no restrictions."},"id":"sqlacodegen","links":{"html":"https://skillfed.io/packages/sqlacodegen","md":"https://skillfed.io/packages/sqlacodegen.md","pypi":"https://pypi.org/project/sqlacodegen/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-19","license_spdx":"MIT","license_treatment":"permissive","name":"sqlacodegen","python_support":"supports_current","summary":"Automatic model code generator for SQLAlchemy"},"popularity":{"monthly_downloads":1842566,"position":3495,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"4.0.4"}
