$npx skillfedfor your agent

marshmallow-sqlalchemy

SQLAlchemy integration with the marshmallow (de)serialization library

Worth itPyPI DatabaseReleased Apr 202612.2M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — marshmallow_sqlalchemy-1.5.0-py3-none-any.whl
v1.5.0 · released 2026-04-01 · Python >=3.10 · 2 runtime deps: marshmallow, SQLAlchemy

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a standard problem in database-backed applications. It's widely used (top 5000 on PyPI) and permissively licensed. Install it if you're building APIs or services that need to serialize SQLAlchemy models.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python >= 3.10, marshmallow >= 3.18.0, and SQLAlchemy >= 1.4.40.
  • Models must be declared before schemas are instantiated.
  • Low friction: pure Python wheel with only two runtime dependencies (marshmallow and SQLAlchemy).

License · maintenance · safety

permissive license (permissive) — MIT licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.

last release 2026-04-01 (135 days) · last repo commit 2026-08-08 · 581 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 12,176,068 downloads/mo, #1,337 on PyPI

Verify before relying

pip install marshmallow-sqlalchemy

from marshmallow_sqlalchemy import SQLAlchemyAutoSchema

class AuthorSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = Author
        load_instance = True

schema = AuthorSchema()
author_dict = schema.dump(author_instance)
author_obj = schema.load(author_dict, session=db_session)
  • Whether auto-generated schemas handle all SQLAlchemy column types and relationships correctly
  • Performance characteristics when serializing large result sets or deeply nested relationships
Same gist for agents: .md · .json

What it is and what it does

marshmallow-sqlalchemy bridges SQLAlchemy ORM models and the marshmallow serialization library, letting you define schemas that automatically map database columns and relationships to serializable fields. Instead of writing field definitions by hand, you declare a schema class pointing to your SQLAlchemy model, and the library generates the fields for you—optionally including relationships and foreign keys. You can then use the schema to dump model instances to dictionaries (for JSON APIs) or load dictionaries back into model instances.

The package handles the common pattern of building REST APIs or other services that need to convert between database objects and wire formats. It integrates with SQLAlchemy sessions to manage object loading and validation, and supports both explicit field declaration (auto_field) and full automatic schema generation (SQLAlchemyAutoSchema). The library is lightweight, with no dependencies beyond marshmallow and SQLAlchemy themselves.

Use it for

  • Build REST APIs that serialize SQLAlchemy models to JSON responses and validate incoming request data
  • Generate API documentation schemas automatically from your database model definitions
  • Validate and deserialize incoming data directly into ORM instances within a session
  • Export database records to JSON or other formats for reporting or data migration
  • Decouple your API contract from your internal model structure using schema field customization

Worth the install?

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

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, low install friction, and solves a standard problem in database-backed applications. It's widely used (top 5000 on PyPI) and permissively licensed. Install it if you're building APIs or services that need to serialize SQLAlchemy models.

Install

marshmallow-sqlalchemy on PyPI

Before you install

Low friction: pure Python wheel with only two runtime dependencies (marshmallow and SQLAlchemy). Actively maintained with recent commits and releases spanning since 2015.

Requires Python >= 3.10, marshmallow >= 3.18.0, and SQLAlchemy >= 1.4.40. Models must be declared before schemas are instantiated.

License in practice

MIT licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install marshmallow-sqlalchemy

from marshmallow_sqlalchemy import SQLAlchemyAutoSchema

class AuthorSchema(SQLAlchemyAutoSchema):
    class Meta:
        model = Author
        load_instance = True

schema = AuthorSchema()
author_dict = schema.dump(author_instance)
author_obj = schema.load(author_dict, session=db_session)

Verify before relying

  • Whether auto-generated schemas handle all SQLAlchemy column types and relationships correctly
  • Performance characteristics when serializing large result sets or deeply nested relationships

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
marshmallowSQLAlchemy
MaintenanceActively maintained 135 days since the last release
Last repo commit
First released
Downloads12,176,068 / month, #1,337 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Evidence: marshmallow_sqlalchemy-1.5.0-py3-none-any.whl

Tags

Capabilities
sqlalchemy schema generationserialize database modelsmarshmallow sqlalchemy integrationorm to json serializationdatabase model validation
Topics
orm-serializationrest-apidata-validation

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 › “serialize database models”

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

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also marshmallow-mongoengine · sqlalchemy-serializer · marshmallow · marshmallow-jsonapi · flask-marshmallow · sqlalchemy-repr · amundsen-common · graphene-sqlalchemy · marshmallow-jsonschema · marshmallow-union