Quickstart: Python
eunoia is the Python binding. You hand euler() a dict of set sizes, it fits an area-proportional diagram, and .plot() renders it with matplotlib.
The diagram fitted by the first example below.
Install
Wheels ship for all common platforms, so no Rust toolchain is needed. Plotting uses matplotlib (a dependency).
Fit a Diagram
=
# residual table + goodness-of-fit metrics
The input dict is keyed by combination expression: a single set ("A") or sets joined with & ("A&B"). Values are exclusive by default: the part of A outside B is 5, the overlap is 1.5. Pass input="inclusive" if your numbers are full set sizes and the core will decompose them:
=
The result carries the fitted geometry and fit statistics:
# fitted Circle, Ellipse, Square, Rectangle, or RotatedRectangle objects
# objective value (lower is better)
# largest single-region error
Pick a Different Shape
=
shape is one of "circle" (default), "ellipse", "square", "rectangle", or "rotated_rectangle". Ellipses are more flexible and often fit three or more sets noticeably better. Rotated rectangles add an angle to the width and height and use derivative-free fitting; see Shapes.
Customize the Plot
eunoia.options(...) sets defaults for every subsequent plot; reset_options() reverts to the built-ins.
Venn Diagrams
For a fixed, non-proportional Venn template (every intersection shown regardless of size), use venn(); it accepts a set count, a list of names, or a mapping:
=
Ellipse Venn diagrams support 1–5 sets; circle, square, and rectangle support 1–3, and rotated rectangles support 1–4:
Next Steps
Browse the Python API reference for the complete public interface. The eunoia-py docs site retains the longer Python guides. For how the fit works across all bindings, see the Fitter Pipeline and Goodness of Fit chapters.
