Metadata-Version: 2.4
Name: simple-viz-prashasti
Version: 0.1.0
Summary: Opinionated, communication-first charts telling the Pinterest 2025 data story.
Author-email: Prashasti Srivastava <psrivastava7@dons.usfca.edu>
License: MIT License
        
        Copyright (c) 2026 Prashasti Srivastava
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/prashasti9/comms_data_science
Project-URL: Repository, https://github.com/prashasti9/comms_data_science
Keywords: visualization,matplotlib,pandas,data-storytelling,charts
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib>=3.5
Requires-Dist: pandas>=1.3
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# simple_viz

**Opinionated, communication-first charts that tell one data story.**

`simple_viz` is a small Python visualization library built for a communication
course. Every function is the right chart for one specific question and makes
deliberate design decisions, so the whole set reads as one system. The running
example is **Pinterest's 2025 results** — a company with a huge global audience
but very unevenly distributed revenue.

Each function returns a matplotlib `Figure`, so you can `savefig` it in any
format (PNG, PDF, SVG).

## Why it looks the way it does

The design is the point, not an afterthought:

- **One highlight colour.** Pinterest red (`#E60023`) marks the one thing the
  reader should look at; everything else is muted grey. Colour directs
  attention instead of decorating.
- **Titles state the takeaway.** "Rest of World is 58% of users but just 7% of
  revenue" — not "Users and revenue by region." The chart answers *so what?*
  before you read the axes.
- **Honest axes.** Bars and lines start at zero; percentages are normalised to
  100% so composition is compared fairly.
- **No chartjunk.** Top/right spines removed, tick marks dropped, gridlines a
  single very light grey, values labelled directly on the marks so legends and
  busy axes disappear.

## Install

From PyPI:

```bash
pip install simple-viz-prashasti
```

Or from source (editable), run from the project root:

```bash
python -m pip install -e .
```

Either way, you then `import simple_viz`. Dependencies: `matplotlib`, `pandas`.

## Use

```python
import pandas as pd
import simple_viz

mau = pd.read_csv("data/pinterest_mau.csv")
fig = simple_viz.growth_line(
    mau, "year", "maus_millions",
    title="Pinterest's audience hit a record 619M in 2025",
    subtitle="Global monthly active users, Q4 of each year (millions)",
    annotate=(2021, "users fell as pandemic\nlockdowns eased"),
)
fig.savefig("mau.png", dpi=150, bbox_inches="tight")
```

Generate the whole gallery (5 charts + a combined PDF) at once:

```bash
python examples/simple_viz_gallery.py
```

## The library

| Function | Chart type | Answers |
| --- | --- | --- |
| `big_number(value, unit, label, ...)` | Single important number | How big is the headline? |
| `growth_line(df, x, y, ...)` | Change over time | Which way is the trend going? |
| `revenue_bar(df, category, value, ...)` | Comparison | Who contributes the most? |
| `share_gap(df, category, part_a, part_b, ...)` | Parts of a whole | Where do users and revenue diverge? |
| `revenue_per_user(df, category, revenue, users, ...)` | Comparison / ratio | How well is each region monetised? |

## Data

All figures are **real**, from Pinterest's Q4 & Full-Year 2025 earnings report
(released February 12, 2026). See [`data/SOURCES.md`](data/SOURCES.md) for the
exact numbers and citations.

## Tests

```bash
python -m pip install -e ".[dev]"
python -m pytest
```

## License

[MIT](LICENSE)
