From 082788eb5d6b2d90d39ba7be957f93dfc006741e Mon Sep 17 00:00:00 2001 From: Eric Ihli Date: Thu, 20 Apr 2023 22:06:08 -0700 Subject: [PATCH] Update readme --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index dcd8bc1..cdc69ac 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,25 @@ # Parsing of lottery websites +- Parses scratchoff lottery ticket data from state websites. +- Writes game and remaining prize info to stdout as json. +- Writes errors to stderr. + +``` text +➜ lottery_data_scraper git:(main) ✗ python3 -m lottery_data_scraper.louisiana 2> /tmp/louisiana.log | jq | head -n 50 +[ + { + "state": "la", + "game_id": "1450", + "prizes": [ + { + "prize": "$200,000", + "available": 2, + "value": 200000, + "claimed": 3 + }, +# ... +``` + ## Demo The following script should put you in a state where the last line will make a @@ -23,6 +43,12 @@ formatted output by piping it to `jq` (and redirecting STDERR to /dev/null). PY_LOG_LVL=DEBUG USE_CACHE=true python3 -m lottery_data_scraper.pennsylvania 2> /dev/null | jq ``` +Or, if you want to capture error logs: + +``` sh +python3 -m lottery_data_scraper.louisiana 2> /tmp/louisiana.log | jq +``` + ## Data models We're using [`marshmallow`](https://marshmallow.readthedocs.io/en/stable/index.html) to validate and serialize data.