Repository navigation
docs: add a five-frameworks image and generate it from the examples - #176
Merged
Merged
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 7f8cf30 | Docs | View more details | Give us feedback! |
The README and the docs home page opened with the bare ERD under a caption claiming five frameworks — the picture never showed them. Replace it with a composite: the same User/Order schema in SQLModel, SQLAlchemy, Django, Pydantic and dataclasses, converging on the one diagram they all produce. The snippets are trimmed from the runnable examples in `docs/examples/`, and the entity boxes use the primary/foreign-key colours `generator.py` emits, so the illustration matches real output rather than approximating it. `frameworks.svg` is the editable source and carries a header comment saying so, including the one-liner to re-export the PNG. Drop the now-unreferenced `docs/examples/erd.png`.
FabianClemenz
force-pushed
the
docs/framework-comparison-image
branch
from
September 14, 2026 11:43
4b3bc7f to
7f8cf30
Compare
7 tasks done
FabianClemenz
added a commit
that referenced
this pull request
Sep 14, 2026
…oter (#178) ## Summary Two small fixes to the launch image, one cosmetic and one an actual defect. ### 1. `frameworks.svg` was not well-formed XML When the generator script was dropped in #176, I added a header comment to the SVG documenting how to re-export the PNG. That comment contained `uv run --group docs …` — and **XML comments may not contain a double hyphen**, so the file stopped parsing. Invisible on the site, which serves the PNG, and `mkdocs build --strict` never noticed because it treats the SVG as an opaque asset. But the file I documented as "the editable source" would not open in a browser or a vector editor. Found while re-rendering it. The comment is rewritten without literal flags, spells the re-export out as Python instead, and says why: ``` Note: XML comments may not contain a double hyphen, so command line flags are spelled out in prose above rather than shown literally. ``` `xml.etree.ElementTree.parse()` now accepts the file. ### 2. The footer arithmetic The headline reads **"Five frameworks. One diagram."** while the footer listed **six** items: > SQLModel · SQLAlchemy · Django · Pydantic · dataclasses · SQL DDL Both were defensible — SQL DDL is an input format, not a Python model framework — but a reader scanning a thumbnail counts the footer and sees a number that contradicts the headline. On an image whose job is to be trusted in two seconds, that is an own goal. Now: `… dataclasses · **and raw SQL DDL**`. The "and" marks it as a different category, so the count reads as five frameworks *plus* something else. ### The claim itself is still correct Checked rather than assumed. `MODEL_SOURCES` is unchanged at exactly five, and every classification path returns one of them: ```python MODEL_SOURCES = ("sqlmodel", "sqlalchemy", "django", "dataclass", "pydantic") ``` `--base-classes` (#173) did **not** add a sixth: a `ninja.Schema` subclass is classified as `pydantic`. django-ninja support rides on an existing framework rather than being a new one, so "five" is right and "six" would have been wrong. The README already says "5 Python Frameworks + SQL DDL" and the docs home says "five frameworks plus raw SQL DDL" — both precise. Only the image blurred the distinction. ## Type of change - [x] Bug fix - [x] Documentation ## Verification `xml.etree.ElementTree.parse()` on the SVG succeeds (it did not before). PNG re-rendered at 1600×840 and inspected. `mkdocs build --strict` passes; full `pre-commit run --all-files` clean. ## Checklist - [x] Tests added or updated for the change — n/a, docs asset - [x] `uv run pytest` passes locally - [x] `uv run ruff check src/ tests/` and `uv run mypy src/` pass - [x] Docs/README updated if behavior changed - [x] `CHANGELOG.md` updated under `[Unreleased]`
Merged
6 tasks done
FabianClemenz
added a commit
that referenced
this pull request
Sep 14, 2026
## Summary Patch release. `[Unreleased]` → `[0.14.1]` with the compare link, version bump, `uv lock`, and the documented pre-commit `rev:` moved to `v0.14.1`. ### What ships **Fixed — ninja `ModelSchema` no longer drawn as an empty entity** (#179). Behaviour introduced hours ago in 0.14.0: anyone passing `--base-classes ModelSchema` got an empty box beside the real table. Now detected, skipped, and explained on stderr. **Fixed — `frameworks.svg` is valid XML again**, and the image footer no longer makes the headline's "five" look like a miscount (#178). **Changed — the README and docs home open with the five-frameworks image** (#176–#178). ### One reclassification worth noting The `ModelSchema` entry moved from `### Added` to `### Fixed`. It stops erdify producing a wrong entity rather than adding a capability — and getting that right is what makes this a **patch** rather than a minor. A reader scanning the changelog for "do I need this?" gets a truthful answer either way, but the version number only lines up under `Fixed`. ### Why release now rather than sit on it Two reasons, and the second is the stronger one: 1. **It fixes output that is wrong today.** `--base-classes` shipped in 0.14.0, so the empty-entity bug is live for anyone who reaches for `ModelSchema`. 2. **The PyPI page is a launch landing page, and it is stale.** PyPI renders the README from the sdist at publish time. 0.14.0 was published *before* the five-frameworks image and the comparison table landed, so pypi.org/project/erdify currently shows neither. With Show HN and r/Python next on the list, the page people hit from those posts should be the current one. Nothing in here is risky: one narrow parser guard with 7 tests, and documentation. ## Type of change - [x] Refactor / maintenance ## Verification ``` uv run pytest 348 passed uv run ruff check / mypy clean uv run erdify --version erdify 0.14.1 mkdocs build --strict passes pre-commit run --all-files clean ``` `uv.lock` re-synced in the same commit. ## After merge Same flow as before: I tag `v0.14.1`, publish the GitHub release and post the announcement Discussion. The PyPI publish then waits in the gated `pypi` environment for your **Review deployments → Approve**. ## Checklist - [x] Tests added or updated for the change — n/a, release mechanics - [x] `uv run pytest` passes locally - [x] `uv run ruff check src/ tests/` and `uv run mypy src/` pass - [x] Docs/README updated if behavior changed - [x] `CHANGELOG.md` updated under `[Unreleased]`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The README and the docs home page opened with
examples/erd.png— the bareUser/OrderERD — under a caption reading "The same ERD from all five frameworks". The picture never showed the five frameworks; the claim lived entirely in the caption. This is the image the launch posts need, and it didn't exist.Replaced with a composite: the same schema written in SQLModel, SQLAlchemy 2.0, Django, Pydantic and dataclasses, five lines converging on the one diagram they all produce.
Two things keep it honest rather than decorative
docs/examples/*— the same files the docs and the integration tests already use. Real code, not a plausible-looking mock-up.generator.pyemits —#b8861bfor primary keys, the grey for foreign keys, from its!defineblock. The illustration matches real erdify output instead of approximating it.No generator script. I initially shipped one and removed it on review, correctly: unlike
scripts/gen_cli_docs.py, nothing would enforce that its output matches the committed SVG. The first time anyone nudges the SVG in a vector editor, the script silently regenerates over their edit — a generator you can't trust is worse than none.frameworks.svgis the editable source and carries a header comment saying so, plus the one-liner to re-export the PNG (CairoSVG already ships with thedocsgroup).Where it's used
README.mddocs/index.mddocs/frameworks/index.mddocs/examples/erd.pngBoth PNG and SVG are committed: the SVG is the editable artefact, the PNG is what social cards and PyPI can actually render.
Type of change
Verification
mkdocs build --strictpasses;pytest(341),ruff check/format,mypy src/and the fullpre-commit run --all-filesare clean. The image is 1600×840 (1.91:1, the Open Graph ratio), 71 KB.I rendered and inspected it, then fixed three things that first pass showed: SVG was collapsing the leading whitespace in every snippet (needs
xml:space="preserve", otherwise all five code blocks flatten to one indent level), the converging lines bulged into a lens shape instead of meeting cleanly, and there was dead space under the diagram.Not done here
The GitHub repo's social preview image is a repository setting, not a file — worth pointing at this PNG in Settings → General → Social preview so links to the repo itself get the same card.
Checklist
uv run pytestpasses locallyuv run ruff check src/ tests/anduv run mypy src/passCHANGELOG.mdupdated under[Unreleased]