{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Adds a `.to_dict()` method to SQLAlchemy model instances, converting them to dictionaries with support for nested relationships, custom field rules, and timezone handling.","skillfed_tags":["orm-serialization","json-export","rest-api"],"use_cases":["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."],"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.\n\nThe 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.","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a common problem\u2014model serialization\u2014with 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."},"id":"sqlalchemy-serializer","links":{"html":"https://skillfed.io/packages/sqlalchemy-serializer","md":"https://skillfed.io/packages/sqlalchemy-serializer.md","pypi":"https://pypi.org/project/sqlalchemy-serializer/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-18","license_spdx":null,"license_treatment":"permissive","name":"sqlalchemy-serializer","python_support":"supports_current","summary":"Mixin for SQLAlchemy models serialization without pain"},"popularity":{"monthly_downloads":163975,"position":10558,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.6.3"}
