Skip to main content

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

Supported charting libraries

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 with existing solutions (e.g., adding authentication).

Roadmap

See the Github repo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bored_charts-0.13.1.tar.gz (161.7 kB view details)

Uploaded Source

Built Distribution

bored_charts-0.13.1-py3-none-any.whl (165.3 kB view details)

Uploaded Python 3

File details

Details for the file bored_charts-0.13.1.tar.gz.

File metadata

  • Download URL: bored_charts-0.13.1.tar.gz
  • Upload date:
  • Size: 161.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for bored_charts-0.13.1.tar.gz
Algorithm Hash digest
SHA256 e129458a7f68fcd10dd5e9b498e9484db45c6c18d1084c879d27f5dce3d77bbb
MD5 2a9ca734efd8090b11eb623793d1ee3d
BLAKE2b-256 ae2fdbf3690fdc4e3f41074224b3db3a6ef9035086b14255dc1a8e297c6645fd

See more details on using hashes here.

File details

Details for the file bored_charts-0.13.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bored_charts-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 585c8daadd12ca8c5809a7f88fa1cc1b4cf0039231d7b6d398b969ed2a10e6f8
MD5 54d99a33a403b24f2c7fc33d0030d411
BLAKE2b-256 ba06e640404ff9b452a06a0d1691900e0c41365fac3c41c982f2b9d6ac647ded

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page