erdantic Changelog¶
v1.0.4 (2024-07-16)¶
- Fixed handling of typing.Annotatedin cases where it's not the outermost generic type. (Issue #122, PR #123)
v1.0.3 (2024-05-10)¶
- Fixed StopIterationerror when rendering a model that has no fields. (Issue #120, PR #121)
v1.0.2 (2024-04-11)¶
- Fixed AttributeErrorwhen adding a model that has a field annotated with certain typing special forms likeAny,Literal, orTypeVarinstances. (Issue #114, PR #115)
v1.0.1 (2024-04-10)¶
- Fixed ModuleNotFoundErrorwhen importing fromerdantic.exampleswithout attrs installed.
v1.0.0.post2 (2024-04-10)¶
- Fixed missing LICENSE file in sdist.
v1.0.0.post1 (2024-04-09)¶
- Fixed outdated note in README.
v1.0.0 (2024-04-09)¶
Important
This release features significant changes to erdantic, primarily to the backend process of analyzing models and representing data. If you have been primarily using the CLI or the convenience functions create, draw, and to_dot, then your code may continue to work without any changes. If you are doing something more advanced, you may need to update your code.
CLI changes¶
- Deprecated --terminioption. Use the new--terminal-modeloption instead. The shorthand option-tremains the same. The--terminioption still works but will emit a deprecation warning.
Convenience function changes¶
- Deprecated terminiargument forcreate,draw, andto_dotfunctions. Use the newterminal_modelsargument instead. Theterminiargument still works but will emit a deprecation warning.
- Added graph_attr,node_attr, andedge_attrarguments to thedrawandto_dotfunctions that allow you to override attributes on the generated pygraphviz object for the diagram.
Visual changes¶
A few changes have been made to the visual content of rendered diagrams.
- Changed the extraction of type names to use the typenames library. This should generally produce identical rendered outputs as before, with the following exception:- Removed the special case behavior for rendering enum classes. Enums now just show the class name without inheritance information.
 
- Changed collection fields (e.g., List[TargetModel]) to display as a "many" relationship (crow) instead of a "zero-or-many" relationship (odot + crow), treating the modality of the field as unspecified. A field will only be displayed as "zero-or-many" (odot + crow) if it is explicitly optional, likeOptional[List[TargetModel]].
- Fixed incorrect representation of manyness for type annotations where the outermost annotation wasn't a collection type. (Issue #105)
Support for attrs¶
- Added support for attrs classes, i.e., classes decorated by attrs.define. The source code for attrs support can be found in the new moduleerdantic.plugins.attrs.
- Added new example module erdantic.examples.attrs.
Backend changes¶
Significant changes have been made to the library backend to more strongly separate the model analysis process, the extracted data, and the diagram rendering process. We believe this more structured design facilitates customizing diagrams and simplifies the implementation for each data modeling framework. Please see the new documentation pages "Customizing diagrams" and "Extending or modifying erdantic" for details on the new design.
A summary of some key changes is below:
- Removed the adapter base classes ModelandFieldand the conrete adaptersDataClassModel,DataClassField,PydanticModel, andPydanticField.
- Added new Pydantic models ModelInfoandFieldInfoto replace the adapter system. These new models hold static data that have been extracted from models that erdantic analyzed.
- Removed the adapter system and associated objects such as model_adapter_registryandregister_model_adapter.
- Added new plugin system to replace the adapter system as the way that modeling frameworks are supported. Plugins must implement two functions—a predicate function and a field extractor function—and be registered using register_plugin. All objects related to plugins can be found in the newerdantic.pluginsmodule and its submodules.
- Renamed erdantic.typingmodule toerdantic.typing_utils.
Other¶
- Added PEP 561 py.typedmarker file to indicate that the package supports type checking.
- Added IPython special method for pretty-print string representations of EntityRelationshipDiagraminstances.
- Removed support for Python 3.7. (PR #102)
v0.7.1 (2024-04-09)¶
This will be the last version that supports Python 3.7.
- Added version typer version ceiling of < 0.10.0due to incompatibility with a fix introduced in that version.
v0.7.0 (2024-02-11)¶
- Added support for Pydantic V1 legacy models. These are models created from the pydantic.v1namespace when Pydantic V2 is installed. (PR #94 from @ursereg)
v0.6.0 (2023-07-09)¶
- Added support for Pydantic V2.
- Removed support for Pydantic V1.
- Changed the init signature for PydanticFieldto work with Pydantic V2's API.
- Added is_manyandis_nullablefunctions toerdantic.typing.
v0.5.1 (2023-07-04)¶
- Changed Pydantic dependency to be < 2. This will be the final version of erdantic that supports Pydantic V1.
- Changed to pyproject.toml-based build.
v0.5.0 (2022-07-29)¶
- Removed support for Python 3.6. (Issue #51, PR #56)
- Added support for modules as inputs to all entrypoints to diagram creation (create,draw,to_dot, CLI). For all modules passed, erdantic will find all supported data model classes in each module. (Issue #23, PR #58)- Added new parameter limit_search_models_toto all entrypoints to allow for limiting which data model classes will be yielded from searching a module.
 
- Added new parameter 
v0.4.1 (2022-04-08)¶
- Fixed error when rendering a data model that has field using typing.Literal. (PR #49)
v0.4.0 (2021-11-06)¶
- Added support for showing field documentation from Pydantic models with descriptions set with Field(description=...)in SVG tooltips. This will add an "Attributes" section to the tooltip using Google-style docstring format and lists fields where thedescriptionkeyword argument is used. (Issue #8, PR #42)
v0.3.0 (2021-10-28)¶
- Fixed handling of forward references in field type declarations. Evaluated forward references will be properly identified. Forward references not converted to typing.ForwardRefwill throw aStringForwardRefErrorwith instructions for how to resolve. Unevaluated forward references will throw anUnevaluatedForwardRefErrorwith instructions for how to resolve. See new documentation for more details. (Issue #40, PR #41)
- Changed name of erdantic.errorsmodule toerdantic.exceptions. (PR #41)
- Added new ErdanticExceptionbase class from which other exceptions raised within the erdantic library are subclassed from. Changed several existingValueErrorexceptions to new exception classes that subclass bothErdanticExceptionandValueError. (PR #41)
- Changed __lt__method onModelandEdgeto returnNotImplementedinstead of raising an exception to follow typical convention for unsupported input types. (PR #41)
v0.2.1 (2021-02-16)¶
- Fixed runtime error when rendering a data model that had a field containing typing.Any. (Issue #25, PR #26)
v0.2.0 (2021-02-14)¶
- Added option to specify models as terminal nodes. This allows you to truncate large diagrams and split them up into smaller ones. (PR #24)
v0.1.2 (2021-02-10)¶
- Fixed bug where Pydantic fields were missing generics in their type annotations. (PR #19)
- Added tests against static rendered DOT output. Change adapter tests to use parameterized fixtures. (PR #21)
v0.1.1 (2021-02-10)¶
- Fixed rendered example image in the package description on PyPI. (PR #18)
v0.1.0 (2021-02-10)¶
Initial release! 🎉