Easy, minimal, PDF-able data reports with python and markdown.
Project description
bored-charts
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:
pip install bored-charts uvicorn
Create your app
# main.py
from pathlib import Path
import plotly.express as px
import plotly.graph_objects as go
from boredcharts import FigureRouter, boredcharts
figures = FigureRouter()
@figures.chart("population")
async def population(country: str) -> go.Figure:
df = px.data.gapminder().query(f"country=='{country}'")
fig = px.bar(df, x="year", y="pop")
return fig
app = boredcharts(pages=Path(__file__).parent, figures=figures)
Write a markdown report
<!-- populations.md -->
## Populations
USA's population has been growing linearly for the last 70 years:
{{ figure("population", country="United States") }}
Run your app
uvicorn main:app --reload
🎉Now you can view your reports at http://localhost:8000!
Going further
A more full project structure might look like this (see the full example here):
my-reports
├── analysis <-- do your analysis and define your figures
│ ├── __init__.py
│ ├── figures.py
│ └── ...
├── pages <-- write your markdown reports
│ ├── example.md
│ └── ...
├── app.py <-- spin up the bored-charts app
├── pyproject.toml
└── README.md
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.
Roadmap
See the Github repo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bored_charts-0.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 416c37b725152a8c5ec7e7059573a25be453a3f30f2b37ad8fb6d3e04629f483 |
|
MD5 | 85d181cbc3469ca86ab96ffec58508c7 |
|
BLAKE2b-256 | 3e58f3bed5d6f6015e0616b7c1a4710ce358aa1b14437301d1d4661e4137ad71 |