Skip to content

Releases: emiliano-go/schemap

schemap v0.7.0

Choose a tag to compare

@emiliano-go emiliano-go released this 12 Sep 23:40
cba774e

TL;DR

schemap v0.7.0 is a quality polish release. Version is now sourced from pyproject.toml via importlib.metadata. The codebase has been cleaned up with stale build artifacts removed from tracking, comprehensive .gitignore, complete pyproject.toml metadata, a test CI workflow, and all documentation code snippets now include their missing imports.

Test suite: 108 passed.


Version sourcing

__version__ in __init__.py now reads from importlib.metadata.version("schemap") instead of a hardcoded string. pyproject.toml is the single source of truth. No more version mismatches between the two.

Build hygiene

Removed stale dist/ artifacts (v0.5.0 wheels), orphaned __pycache__/ directories, .pytest_cache/, and empty .benchmarks/ from git tracking. Updated .gitignore with comprehensive entries for testing caches, linting caches, coverage output, and environment files.

pyproject.toml metadata

Added Documentation and Changelog project URLs. Added Python 3.13 and 3.14 classifiers, Operating System :: OS Independent, and Topic :: Software Development :: Libraries.

Test CI

Added .github/workflows/test.yml that runs the full test suite on push and pull requests across Python 3.12, 3.13, and 3.14 using uv.

Documentation fixes

All code snippets in docs/mixins.md, docs/examples.md, and docs/tutorial.md now include their from sqlalchemy.orm import Mapped, mapped_column imports. Fixed broken installation/ link in llms.txt. Fixed domain mismatch: llms.txt and generate_llms_full.py now use schemap.emiliano-go.com instead of the old domain.

Code cleanup

Extracted duplicated _mapped_keys_cache and from_schema logic from base.py and decorator.py into shared utils/schema.py. Removed unused imports in test files. Removed redundant @dataclass(repr=True, eq=True) defaults. Fixed createdby.py forward ref type hint from "User" to "DeclarativeBase". Added docs site badge to README. Moved Requirements section near install instructions.

schemap v0.6.1

Choose a tag to compare

@emiliano-go emiliano-go released this 12 Sep 20:57
43d9d37

TL;DR

schemap v0.6.1 is a patch release that fixes the publishing workflow. The publish.yml workflow has been renamed to publishing.yml and now correctly targets the pypi environment for trusted publisher authentication.


Changes

Renamed GitHub Actions workflow from publish.yml to publishing.yml. The workflow triggers on GitHub release publication and builds sdist and wheel artifacts before publishing to PyPI via trusted publisher (OIDC). No token required when configured on PyPI side.

Publishing

To publish, create a new release via gh release create v0.6.1 with the release body. The workflow will automatically build and push to PyPI.

schemap v0.6.0

Choose a tag to compare

@emiliano-go emiliano-go released this 12 Sep 20:37
7482bbb

TL;DR

schemap v0.6.0 is the first public release of the automatic Pydantic v2 schema generator for SQLAlchemy 2.0 ORM models. Define your model once and get four schemas for free: full, create, update, and public. The release includes nine built-in mixins (timestamps, soft delete, primary keys, UUID, archivable, status, versioning, created/updated by), per-model customization via SchemaConfig, Enum extraction, callable defaults, and comprehensive docstrings with runnable examples on every public API surface.

Test suite: 108 passed.


Four-variant generation

Schemap reads your SQLAlchemy columns and generates four Pydantic schemas with built-in exclusion rules. Primary keys are excluded from CreateSchema. All fields become optional in UpdateSchema for partial updates. Fields prefixed with __ are filtered from PublicSchema. No configuration required; these rules are baked in.

The generator handles Enums (extracted as concrete classes), callable defaults (converted to default_factory), JSON columns (mapped to Any), and Numeric types (with precision and scale preserved).

Three API modes

AutoBase inheritance for new projects. @auto_schema decorator for existing models without changing their base class. build_schema standalone for generating schemas without modifying the model at all. All three produce identical results.

SchemaConfig customization

Attach a SchemaConfig to any model to override field types, exclude fields from specific variants, force required or optional status, add custom validators, and set a custom schema_type. Configuration is validated at definition time with clear error messages. Field overrides accept a dict of field name to Pydantic FieldInfo.

Nine built-in mixins

TimestampMixin (created_at, updated_at), SoftDeleteMixin (deleted_at, is_deleted with query helpers), UUIDPrimaryKeyMixin, IntPrimaryKeyMixin, ArchivableMixin (archived_at, is_archived), StatusMixin (Status enum with ACTIVE/INACTIVE/PENDING/ARCHIVED), VersionMixin (version integer for optimistic locking), CreatedByMixin and UpdatedByMixin (foreign key user tracking with user_table examples).

Type system

Enum columns are extracted as concrete Python Enum classes. Callable defaults (like uuid.uuid4) are converted to Pydantic default_factory. JSON columns map to Any. Numeric columns preserve precision and scale. for_update schema respects server_default exclusion.

Developer experience

PEP 561 py.typed marker for type checker support. MIT license. Comprehensive docstrings with >>> examples on every public class, method, property, enum, mixin, and type alias. Config validation uses ValueError for hard errors at definition time.

Bug fixes

Validators correctly skip None values for optional fields. Validators skip fields excluded from the current schema variant. from_schema accepts dicts directly. schema_type defaults to "full" for the full variant. Column iteration merged to avoid duplicate processing.

Test coverage

Full suite: 108 passed. Coverage includes edge cases for extra validators, callable defaults, Enum extraction, dict from_schema, config validation conflicts, non-mapped class errors, and all nine mixins.