Metadata-Version: 2.4
Name: eunoia
Version: 1.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Matplotlib
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Typing :: Typed
Requires-Dist: matplotlib>=3.8
Requires-Dist: narwhals>=1.9
Requires-Dist: numpy>=1.26
Requires-Dist: sphinx>=7 ; extra == 'docs'
Requires-Dist: furo ; extra == 'docs'
Requires-Dist: myst-nb ; extra == 'docs'
Requires-Dist: sphinx-copybutton ; extra == 'docs'
Requires-Dist: sphinx-autobuild ; extra == 'docs'
Requires-Dist: plotly>=5.0 ; extra == 'plotly'
Requires-Dist: fonttools>=4.0 ; extra == 'plotly'
Provides-Extra: docs
Provides-Extra: plotly
License-File: LICENSE
Summary: Area-proportional Euler and Venn diagrams
Keywords: euler,venn,diagram,visualization,set
Author-email: Johan Larsson <johan@jolars.co>
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://jolars.github.io/eunoia-py
Project-URL: Issues, https://github.com/jolars/eunoia-py/issues
Project-URL: Repository, https://github.com/jolars/eunoia-py

# Eunoia <img src='https://raw.githubusercontent.com/jolars/eunoia-py/refs/heads/main/docs/_static/logo.png' align="right" width="139" />

[![CI](https://github.com/jolars/eunoia-py/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jolars/eunoia-py/actions/workflows/ci.yml)
[![pypi](https://img.shields.io/badge/pypi-blue?logo=python&logoColor=white)](https://pypi.org/project/eunoia/)
[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.20650005-blue)](https://doi.org/10.5281/zenodo.20650005)

Python bindings for the [Eunoia](https://eunoia.bz), a Rust library for fitting
area-proportional Euler and Venn diagrams. Sister package to the R package
[eulerr](https://github.com/jolars/eulerr).

![Euler circles, ellipses, and a Venn diagram fitted with
Eunoia](https://raw.githubusercontent.com/jolars/eunoia-py/refs/heads/main/docs/_static/hero.png)

## Install

```bash
pip install eunoia
```

## Quickstart

```python
import eunoia as eu
import matplotlib.pyplot as plt

# Disjoint (per-region) input is the default.
fit = eu.euler({"A": 10, "B": 5, "A&B": 3})
print(fit)
# EulerFit (2 circles, diag_error=2.776e-17, stress=5.887e-33, loss=5.887e-33)
#                  original      fitted    residual regionError
#   A                    10          10           0           0
#   B                     5           5           0           0
#   A&B                   3           3   8.882e-16   2.776e-17

fit.plot()
plt.show()
```

`euler()` also accepts inclusive counts, DataFrames, and NumPy arrays; `shape=`
switches between circles, ellipses, squares, and rectangles; `venn()` draws
topological diagrams; `plot(glyphs=True)` adds one countable dot per unit;
`plot(members={"mode": "packed"})` packs retained member names into their
regions; and `eunoia.options(...)` sets global plotting defaults. See the
documentation for the full API.

## Documentation

Full documentation, including narrative guides and the API reference, lives at
[jolars.github.io/eunoia-py](https://jolars.github.io/eunoia-py).

## Ecosystem

This package is the Python member of the [Eunoia](https://eunoia.bz) family. The
same Rust core powers bindings in several other languages:

  | Language   | Package                                                                                                               | Install                      |
  | ---------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
  | Rust       | [`eunoia`](https://crates.io/crates/eunoia) ([repo](https://github.com/jolars/eunoia))                                | `cargo add eunoia`           |
  | JavaScript | [`@jolars/eunoia`](https://www.npmjs.com/package/@jolars/eunoia) ([repo](https://github.com/jolars/eunoia))           | `npm install @jolars/eunoia` |
  | Julia      | [`Eunoia.jl`](https://platform.juliahub.com/ui/Packages/General/Eunoia) ([repo](https://github.com/jolars/Eunoia.jl)) | `] add Eunoia`               |
  | R          | [`eulerr`](https://cran.r-project.org/package=eulerr) ([repo](https://github.com/jolars/eulerr))                      | `install.packages("eulerr")` |

Documentation for the whole family lives at
[eunoia.bz/docs/](https://eunoia.bz/docs/); the Rust API reference is at
[docs.rs/eunoia](https://docs.rs/eunoia/).

## Citation

If you use Eunoia for Python in your research, please cite the paper:

> Larsson, J., & Lee, N. M. (2026). *Eunoia: Area-Proportional Euler and Venn
> Diagrams in Rust, Julia, Python, R, and JavaScript* (arXiv:2611.02198). arXiv.
> <https://doi.org/10.48550/arXiv.2611.02198>

```bibtex
@misc{larsson2026f,
  title         = {Eunoia: {{Area}}-Proportional {{Euler}} and {{Venn}} Diagrams in {{Rust}}, {{Julia}}, {{Python}}, {{R}}, and {{JavaScript}}},
  shorttitle    = {Eunoia},
  author        = {Larsson, Johan and Lee, Nicole M.},
  year          = {2026},
  month         = nov,
  number        = {arXiv:2611.02198},
  eprint        = {2611.02198},
  primaryclass  = {stat.CO},
  publisher     = {arXiv},
  doi           = {10.48550/arXiv.2611.02198},
  archiveprefix = {arXiv}
}
```

<details>
<summary>BibLaTeX</summary>

```bibtex
@online{larsson2026f,
  title       = {Eunoia: {{Area}}-Proportional {{Euler}} and {{Venn}} Diagrams in {{Rust}}, {{Julia}}, {{Python}}, {{R}}, and {{JavaScript}}},
  shorttitle  = {Eunoia},
  author      = {Larsson, Johan and Lee, Nicole M.},
  date        = {2026-11-01},
  eprint      = {2611.02198},
  eprinttype  = {arXiv},
  eprintclass = {stat.CO},
  doi         = {10.48550/arXiv.2611.02198},
  pubstate    = {prepublished}
}
```

</details>

For reproducibility, also cite the software release you used. Select that
release in the [Zenodo archive](https://doi.org/10.5281/zenodo.20650005) and
export its citation. The concept DOI `10.5281/zenodo.20650005` identifies Eunoia
for Python across all releases.

[CITATION.cff](CITATION.cff) contains the software metadata and preferred paper
citation. The [Eunoia citation page](https://eunoia.bz/cite/) renders the paper
in APA, BibTeX, BibLaTeX, and other formats.

## License

[MIT](LICENSE)

