Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jayqi committed Mar 25, 2024
1 parent 7583e90 commit 6481667
Show file tree
Hide file tree
Showing 10 changed files with 1,548 additions and 531 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vscode

docs/docs/examples/diagram.png
docs/docs/examples/diagram.svg
docs/site

tests/_outputs
Expand Down
9 changes: 4 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This release features significant changes to erdantic, primarily to how data is

### CLI changes

- Deprecated `--termini` option. Use the new `--terminal-model` option instead. The shorthand option `-t` remains the same.
- Deprecated `--termini` option. Use the new `--terminal-model` option instead. The shorthand option `-t` remains the same. The `--termini` option still works but will emit a deprecation warning.

### Convenience function changes

- Deprecated `termini` argument for `create`, `draw`, and `to_dot` functions. Use the new `terminal_models` argument instead.
- Deprecated `termini` argument for `create`, `draw`, and `to_dot` functions. Use the new `terminal_models` argument instead. The `termini` argument still works but will emit a deprecation warning.
- Added `graph_attr`, `node_attr`, and `edge_attr` arguments to the `draw` and `to_dot` functions that allow you to override attributes on the generated pygraphviz object for the diagram.

### Rendered content changes
Expand All @@ -28,7 +28,7 @@ A few changes have been made to the content of rendered diagrams.

### Backend changes

Significant changes have been made to the library backend to facilitate customizing diagrams and to more clearly structure the steps in creating a diagram from input models. Please see the new documentation pages ["Customizing diagrams"](http://erdantic.drivendata.org/stable/customizing/) and ["Plugins for model frameworks"](http://erdantic.drivendata.org/stable/customizing/) for details on the new design.
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"](http://erdantic.drivendata.org/stable/customizing/) and ["Plugins for model frameworks"](http://erdantic.drivendata.org/stable/customizing/) for details on the new design.

A summary of some key changes is below:

Expand All @@ -37,8 +37,7 @@ A summary of some key changes is below:
- Removed the adapter system and associated objects such as `model_adapter_registry` and `register_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 new `erdantic.plugins` module and its submodules.


## v0.8.0 (Unreleased)
### Other

- Removed support for Python 3.7. ([PR #102](https://github.com/drivendataorg/erdantic/pull/102))

Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
- [attrs](https://www.attrs.org/en/stable/)
- [dataclasses](https://docs.python.org/3/library/dataclasses.html) from the Python standard library

Features include a convenient CLI, automatic native rendering in Jupyter notebooks, and easy extensibility to other data modeling frameworks. Docstrings are even accessible as tooltips for SVG outputs. Great for adding a simple and clean data model reference to your documentation.
You can use erdantic either as a convenient CLI or as a Python library. Great for adding a simple and clean data model reference to your documentation.

<object type="image/svg+xml" data="https://raw.githubusercontent.com/drivendataorg/erdantic/main/docs/docs/examples/pydantic.svg" width="100%" typemustmatch><img alt="Example diagram created by erdantic" src="https://raw.githubusercontent.com/drivendataorg/erdantic/main/docs/docs/examples/pydantic.svg"></object>
<object type="image/svg+xml" data="./docs/docs/assets/example_diagram.svg" width="100%" typemustmatch><img alt="Example diagram created by erdantic" src="./docs/docs/assets/example_diagram.svg"></object>

> [!NOTE]
> erdantic v1.0 made big changes to the backend. If you're just using the CLI or the convenience functions like `create` or `draw`, then you probably won't notice any major changes. If you've been doing something more advanced, then you may need to update your code. See the [changelog](./HISTORY.md) for more information.
## Installation

Expand Down Expand Up @@ -61,8 +64,11 @@ erd.draw(Party, out="diagram.png")

# Or create a diagram object that you can inspect and do stuff with
diagram = erd.create(Party)
diagram.models
#> [PydanticModel(Adventurer), PydanticModel(Party), PydanticModel(Quest), PydanticModel(QuestGiver)]
list(diagram.models.keys())
#> [ 'erdantic.examples.pydantic.Adventurer',
#> 'erdantic.examples.pydantic.Party',
#> 'erdantic.examples.pydantic.Quest',
#> 'erdantic.examples.pydantic.QuestGiver']
diagram.draw("diagram.png")
```

Expand Down
911 changes: 911 additions & 0 deletions docs/docs/examples/attrs.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 6481667

Please sign in to comment.