$npx skillfedfor your agent

sqlmodel

SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.

Worth itPyPI InternetReleased Jun 202621.0M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sqlmodel-0.0.39-py3-none-any.whl
v0.0.39 · released 2026-06-25 · Python >=3.10 · 3 runtime deps: SQLAlchemy, pydantic, typing-extensions

Yes. SQLModel is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real pain point—eliminating duplicate model definitions. It's well-suited for FastAPI projects and SQLAlchemy migrations. The 0.0.39 version number signals beta status, so production use should account for potential API changes, but the library is widely used and stable in practice.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low friction install with only three runtime dependencies (SQLAlchemy, pydantic, typing-extensions).
  • Active maintenance with a recent release and 18266 repository stars; supports current Python versions from 3.10 onward.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.

last release 2026-06-25 (50 days) · last repo commit 2026-08-12 · 18,266 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 21,035,871 downloads/mo, #1,017 on PyPI

Verify before relying

pip install sqlmodel

from sqlmodel import Field, Session, SQLModel, create_engine

class Hero(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    name: str
    age: int | None = None

engine = create_engine("sqlite:///database.db")
SQLModel.metadata.create_all(engine)

with Session(engine) as session:
    hero = Hero(name="Example")
    session.add(hero)
    session.commit()
  • Whether async/await support is available for database operations beyond the AsyncIO framework classifier.
  • Performance characteristics compared to raw SQLAlchemy or other hybrid ORM solutions.
  • Maturity level and backward-compatibility guarantees given the 0.0.39 version number.
Same gist for agents: .md · .json

What it is and what it does

SQLModel is a thin layer bridging SQLAlchemy and Pydantic, letting you write a single Python class that simultaneously acts as a SQL table definition, an ORM model, and a data validator. Instead of maintaining separate SQLAlchemy models and Pydantic schemas, you annotate class attributes with types and Field() declarations, and SQLModel handles both database persistence and request/response validation. It's built for FastAPI applications but works in any Python codebase that needs SQL databases.

The library handles the boilerplate of mapping Python objects to database rows and back, with full editor autocompletion and type checking throughout. You create instances of your model class to represent rows, pass them to a Session for database operations, and query using SQLAlchemy's select() syntax. Because the same class serves dual duty, you avoid duplicating field definitions and validation logic.

Use it for

  • Build FastAPI applications where request/response models and database models are the same class, cutting model definition code in half.
  • Migrate existing SQLAlchemy projects to gain Pydantic validation without rewriting your ORM layer.
  • Define type-safe database schemas with Python type hints, getting IDE autocompletion for both model creation and query results.
  • Reduce boilerplate in data-heavy applications by using one model definition for validation, serialization, and persistence.
  • Prototype database-backed services quickly with minimal schema duplication between API contracts and storage.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

SQLModel is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real pain point—eliminating duplicate model definitions. It's well-suited for FastAPI projects and SQLAlchemy migrations. The 0.0.39 version number signals beta status, so production use should account for potential API changes, but the library is widely used and stable in practice.

Install

sqlmodel on PyPI

Before you install

Low friction install with only three runtime dependencies (SQLAlchemy, pydantic, typing-extensions). Active maintenance with a recent release and 18266 repository stars; supports current Python versions from 3.10 onward.

Requires Python 3.10 or later.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install sqlmodel

from sqlmodel import Field, Session, SQLModel, create_engine

class Hero(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    name: str
    age: int | None = None

engine = create_engine("sqlite:///database.db")
SQLModel.metadata.create_all(engine)

with Session(engine) as session:
    hero = Hero(name="Example")
    session.add(hero)
    session.commit()

Verify before relying

  • Whether async/await support is available for database operations beyond the AsyncIO framework classifier.
  • Performance characteristics compared to raw SQLAlchemy or other hybrid ORM solutions.
  • Maturity level and backward-compatibility guarantees given the 0.0.39 version number.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
SQLAlchemypydantictyping-extensions
MaintenanceActively maintained 50 days since the last release
Last repo commit
First released
Downloads21,035,871 / month, #1,017 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaFramework :: AsyncIOIntended Audience :: DevelopersIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTopic :: Database :: Database Engines/ServersTopic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTyping :: Typed

Evidence: sqlmodel-0.0.39-py3-none-any.whl

Tags

Capabilities
SQL ORM with pydantic validationSQLAlchemy pydantic integrationtyped SQL models pythondatabase models with type hintsfastapi database ormreduce orm model duplicationpython sql table classes
Topics
ormfastapi-integrationtype-safe-sql

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “SQL ORM with pydantic validation”

  • sqlmodelSQLModel combines SQLAlchemy and Pydantic to let you define SQL…
  • ormarAn async ORM for Python that unifies database models with pydantic…
  • peeweePeewee is a lightweight ORM that maps Python classes to database…

Give your agent the search over MCP, or paste the wish link into any chat.

More Internet packages

botocore Worth it
PyPI · Internet · released Aug 2026

Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.

Install it if you need programmatic access to AWS services.

permissive licensepure Python · 3.10+
1.5Bdownloads / mo
aiobotocore Worth it
PyPI · Internet · released Aug 2026

Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.

Install it if you need to call AWS services from async Python code; it is the standard way to do so.

Apache-2.0pure Python · 3.10+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
filelock Worth it
PyPI · Libraries · released Aug 2026

Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.

MITpure Python · 3.10+
717.1Mdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
googleapis-common-protos Worth it
PyPI · Internet · released Aug 2026

Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.

Apache-2.0pure Python · 3.10+
513.7Mdownloads / mo

See also ormar · py-automapper · redis-om · sqladmin · SQLAlchemy · databricks-sqlalchemy · prisma · sqlacodegen · sqlalchemy-jdbcapi · PyPika