Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom parser for cleaned data #2

Open
dunderrrrrr opened this issue Feb 19, 2025 · 0 comments
Open

Add custom parser for cleaned data #2

dunderrrrrr opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@dunderrrrrr
Copy link
Owner

dunderrrrrr commented Feb 19, 2025

It would be nice to add an argument to at that returns a cleaned json. Currently, at() just returns the raw results. You should atleaset have an option to have everything returned in a cleaned way.

Example:

>>> from skolmaten import SchoolFood
>>> food = SchoolFood(school="0b4d4d77-7b27-4591-a03e-28309e039b1e")
>>> food.at(2025, 10) # returns a huge json with some irrelevant data
>>> food.at(2025, 10, cleaned=True)
{
    "2025-01-01": ["Hamburgare", "Köttbullar och potatismos"]
    "2025-01-02": ["Korvstroganoff och ris", "Plankstek"]
    ...
}

or just some object

>>> food.at(2025, 10, cleaned=True)
{
    Food(...),
    Food(...),
    Food(...),

}
@dunderrrrrr dunderrrrrr added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant