Add unique daily stat uploads lineplot

This commit is contained in:
Marty Oehme 2025-09-28 21:50:30 +02:00
parent efa08b4b54
commit 499a819c90
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -202,10 +202,37 @@ def _(df_lazy: pl.LazyFrame):
caption="Downloads aggregated per month of the year.",
)
)
_()
return
@app.cell
def _():
df_unique_downloads = (
pl.scan_ndjson("data/daily/*", include_file_paths="file")
.head(LIMIT_ROWS) # FIXME: take out after debug
.with_columns(
pl.col("file")
.str.replace(r"data/daily/(\d{4}-\d{2}-\d{2}).json", "${1}")
.str.to_date()
.alias("date")
)
.select(["date", "UniqueInstalls"])
.collect()
)
(
lp.ggplot(df_unique_downloads, lp.aes("date", "UniqueInstalls"))
+ lp.geom_line()
+ lp.geom_smooth()
+ lp.labs(
title="Unique daily uploads",
caption="Daily number of unique providers for package update statistics opting in to popcorn.",
)
)
return
@app.cell
def _():
mo.md(