Bored Charts 0.13.1 | Coderz Repository

bored-charts 0.13.1

Last updated:

0 purchases

bored-charts 0.13.1 Image
bored-charts 0.13.1 Images

Free

Languages

Categories

Add to Cart

Description:

boredcharts 0.13.1

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

matplotlib
plotly
vega-altair
seaborn

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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.