$npx skillfedfor your agent

sqlalchemy-serializer

Mixin for SQLAlchemy models serialization without pain

Worth itPyPI DatabaseReleased Apr 2026164.0K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sqlalchemy_serializer-1.6.3-py3-none-any.whl
v1.6.3 · released 2026-04-18 · Python >=3.10 · 4 runtime deps: SQLAlchemy, psycopg2-binary, pytz, setuptools

Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a common problem—model serialization—with minimal dependencies and low install friction. It's well-suited for Flask/FastAPI applications and other projects where lightweight, ad-hoc model-to-dict conversion is needed. Install it if you want to avoid the boilerplate of schema libraries for straightforward serialization tasks.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low friction: pure Python wheel with four runtime dependencies (SQLAlchemy, psycopg2-binary, pytz, setuptools).
  • Actively maintained with recent releases; last commit 2026-05-11 and 201 repository stars indicate steady upkeep.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) allows use in commercial and proprietary projects with minimal restrictions—include a copy of the license and attribute the original author.

last release 2026-04-18 (118 days) · last repo commit 2026-05-11 · 201 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 163,975 downloads/mo, #10,558 on PyPI

Verify before relying

from sqlalchemy_serializer import SerializerMixin

class MyModel(db.Model, SerializerMixin):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(256))

item = MyModel.query.first()
result = item.to_dict()
  • Whether psycopg2-binary is required for all use cases or only when using PostgreSQL backends.
  • Performance characteristics when serializing deeply nested relationships or large model graphs.
Same gist for agents: .md · .json

What it is and what it does

SQLAlchemy-serializer is a mixin that adds a `.to_dict()` method to SQLAlchemy model instances, turning them into dictionaries suitable for JSON responses or data export. It handles nested relationships automatically, includes support for both traditional and modern SQLAlchemy 2.0 annotation styles, and offers fine-grained control over which fields to include or exclude via `rules`, `only`, and `exclude_values` parameters.

The package is designed for developers who need simple model-to-dict conversion without the overhead of schema libraries like marshmallow. It supports custom serialization logic per column, timezone handling via pytz, recursion depth limits to prevent infinite loops, and the ability to include non-SQLAlchemy fields or method results in the output. Runtime dependencies are SQLAlchemy, psycopg2-binary, pytz, and setuptools.

Use it for

  • Convert SQLAlchemy model instances to dictionaries for JSON API responses without defining separate serialization schemas.
  • Exclude sensitive fields (passwords, tokens) from serialized output using negative rules or custom serializers.
  • Serialize nested relationships and foreign-key references in a single call with configurable depth limits.
  • Add computed or non-database fields to serialized output by including methods or properties in the rules.
  • Filter out null or empty values from the serialized dictionary to reduce payload size in API responses.

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, uses a permissive MIT license, and solves a common problem—model serialization—with minimal dependencies and low install friction. It's well-suited for Flask/FastAPI applications and other projects where lightweight, ad-hoc model-to-dict conversion is needed. Install it if you want to avoid the boilerplate of schema libraries for straightforward serialization tasks.

Install

sqlalchemy-serializer on PyPI

Before you install

Low friction: pure Python wheel with four runtime dependencies (SQLAlchemy, psycopg2-binary, pytz, setuptools). Actively maintained with recent releases; last commit 2026-05-11 and 201 repository stars indicate steady upkeep.

Requires Python 3.10 or later.

License in practice

MIT license (permissive) allows use in commercial and proprietary projects with minimal restrictions—include a copy of the license and attribute the original author.

Quickstart

from sqlalchemy_serializer import SerializerMixin

class MyModel(db.Model, SerializerMixin):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(256))

item = MyModel.query.first()
result = item.to_dict()

Verify before relying

  • Whether psycopg2-binary is required for all use cases or only when using PostgreSQL backends.
  • Performance characteristics when serializing deeply nested relationships or large model graphs.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
SQLAlchemypsycopg2-binarypytzsetuptools
MaintenanceActively maintained 118 days since the last release
Last repo commit
First released
Downloads163,975 / month, #10,558 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Evidence: sqlalchemy_serializer-1.6.3-py3-none-any.whl

Tags

Capabilities
sqlalchemy model to dictserialize sqlalchemy objectssqlalchemy to jsonsqlalchemy model serializationconvert sqlalchemy to dictionarysqlalchemy mixin serializersqlalchemy json export
Topics
orm-serializationjson-exportrest-api
PyPI keywords
sqlalchemyserializeto_dictJSON

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 › “sqlalchemy model to dict”

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-sqlalchemy · sqlalchemy-json · sqlalchemy-easy-softdelete · sqlalchemy-mixins · drf-writable-nested · voluptuous-serialize · marshmallow-jsonapi · sqlalchemy-repr · sqlacodegen · drf-jsonschema-serializer