skillfed

WTForms-Alchemy

Generates WTForms forms from SQLAlchemy models.

wtforms-alchemy v0.19.1 89.0K downloads/30d#13,684 on PyPI247
Permissive license BSD Active released

What it is and what it does

WTForms-Alchemy bridges SQLAlchemy models and WTForms by introspecting your database schema and automatically creating corresponding form fields. Instead of manually defining form classes that duplicate your model structure, you inherit from ModelForm, specify your SQLAlchemy model in the Meta class, and the library generates appropriate field types, validators, and relationships for you.

The package depends on SQLAlchemy, WTForms, WTForms-Components, and SQLAlchemy-Utils to handle the model inspection and form generation. It's designed for web developers building CRUD interfaces where forms closely mirror database tables, reducing boilerplate and keeping form definitions in sync with schema changes.

Use it for:

  • Quickly scaffold admin forms for CRUD operations on existing SQLAlchemy models without manual field duplication.
  • Generate user registration or profile edit forms that automatically validate against your database constraints.
  • Build data entry forms for multi-table applications where form structure mirrors your ORM model hierarchy.
  • Reduce maintenance burden when database schema changes by auto-updating form fields instead of manual edits.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically generates WTForms form classes from SQLAlchemy model definitions, eliminating the need to manually write form fields that mirror your database schema.

Yes, if you use SQLAlchemy and WTForms together. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a genuine pain point—manual form-model synchronization. The BSD license poses no restrictions. Install it when you find yourself writing form classes that duplicate your model structure.

Install

wtforms-alchemy on PyPI

pip

pip install wtforms-alchemy

uv

uv add wtforms-alchemy

poetry

poetry add wtforms-alchemy

Installing WTForms-Alchemy

Before you install

Low friction install with four well-established runtime dependencies. Actively maintained with last commit on 2026-05-14 and latest release on 2025-08-11.

License in practice

BSD license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install wtforms-alchemy

from wtforms_alchemy import ModelForm

class UserForm(ModelForm):
    class Meta:
        model = User

Verify before relying

  • Whether the package supports the latest SQLAlchemy 2.x API or is limited to 1.x patterns
  • Degree of customization available for auto-generated field types and validation rules
  • Performance characteristics when generating forms from large or deeply nested models

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — SQLAlchemy, WTForms, WTForms-Components, SQLAlchemy-Utils
Maintenance actively maintained — 368 days since the last release
Last repo commit
First released
Downloads 89,011/month — #13,684 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: wtforms_alchemy-0.19.1-py3-none-any.whl

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

wtforms from sqlalchemy modelsauto-generate forms from database modelssqlalchemy form generationwtforms model integrationdatabase schema to web forms
form-generationsqlalchemy-integrationweb-framework

More Python Modules packages