Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlambson committed Aug 22, 2024
1 parent 02a0ce8 commit 41b931c
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions bored-charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Build easy, minimal, PDF-able data reports with markdown and python.

The idea is you do your analysis in Python, as you normally would, and dumping your
figures into a nice report written in markdown is now super low-effort: you decorate
the function to generate the figure (that you already wrote when doing your analysis)
and it becomes available to bored-charts so you can present your findings clearly.

## Minimal example

Install bored-charts and uvicorn:
Expand All @@ -10,10 +15,10 @@ Install bored-charts and uvicorn:
pip install bored-charts uvicorn
```

Create your app:
### Create your app

```python
# app.py
# main.py
from pathlib import Path

import plotly.express as px
Expand All @@ -39,34 +44,41 @@ app = boredcharts(
)
```

Write a markdown report:
### Write a markdown report

```md
<!-- pages/populations.md -->

## Populations

USA's population has been growing linearly for the last 70 years:

{{ figure("usa_population") }}
```

Run your app:
### Run your app

```bash
uvicorn app:app --reload
uvicorn main:app --reload
```

🎉Now you can view your reports at [http://localhost:8000](http://localhost:8000)!

## Going further

A more full project structure might look like this:

```
my-reports
├── myreports
│   ├── pages <-- put your markdown reports here
│   ├── pages <-- put your markdown reports here
│   │   └── example.md
│   ├── **init**.py
│   ├── app.py <-- spin up the app here
│   └── figures.py <-- define your figures here
│   ├── __init__.py
│   ├── app.py <-- spin up the app here
│   └── figures.py <-- define your figures here
├── README.md
└── pyproject.toml
```

## Extensibility

The bored-charts app is just a FastAPI (ASGI) app,
so you can integrate it into your existing projects or extend it as needed.

0 comments on commit 41b931c

Please sign in to comment.