parse platenzaak deals
This commit is contained in:
13
apps/vinyl/src/platenzaak/parse.py
Normal file
13
apps/vinyl/src/platenzaak/parse.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import polars as pl
|
||||
|
||||
|
||||
def parse(df: pl.LazyFrame) -> pl.LazyFrame:
|
||||
"""Parse the Platenzaak DataFrame."""
|
||||
return df.with_columns(
|
||||
date=pl.col("date").cast(pl.Date),
|
||||
artist=pl.col("artist").str.strip_chars().str.to_lowercase(),
|
||||
title=pl.col("album").str.strip_chars().str.to_lowercase(),
|
||||
release=pl.lit(None),
|
||||
price=pl.col("current_price").cast(pl.Float64),
|
||||
url=pl.format("https://platenzaak.nl{}", pl.col("id")),
|
||||
)
|
||||
Reference in New Issue
Block a user