This is a very basic scraper for decware order list. They provide this list for folks to use so ;)
Please be kind to decware they are a small shop hand-crafting electronics.
First and foremost - this is a little utility I wrote on a whim. It's probably not great python code. It's probably got some innefficicies in it.
I wrote this because I was bored, the weather sucked and I got curious. I wanted to know where I was in line, how long it was going to take to get my amp made etc.
The code I have written only hits their api once a day. It is hopefully a non-issue for them. I'm sure there are people checking more frequently than that.
I have a mongo free tier instance backing the data. I wrote a dashboard up with some stats.
I was going to use mongo locally on a raspberry pi but the arm image produced won't run there. Ditto with the docker image. Mongo has a free tier and I'm not dealing with a lot of data so I punted and went with a free cloudy thing.
There are a few things missing:
- easy to consume stats
- The stats are logged
- The stats are also persisted to a mongo collection
- I may write a simple web app to replace using mongodb's dashboard
- The scraper.py code is pretty inefficient in spots
- The db comparison takes like 3 minutes for some reason. It may be because of the free tier db and slow queries
- The scraper.py code has a few hard-coded things
- The scraper.py code is very lacking in using method calls for things
So, if you want to set this up for yourself there are a few things to do:
- You need a mongo database
- You need python, I wrote this against python 3.13
- You need a virtualenv
- You need a place to run the scraper
- You need a config file
Reference the example_config.yaml
The only thing you should need to change about it is the mongo_uri
value. This needs to conform to a valid pymongo / mongo uri. If you use the mongodb free tier like I did they give you a connection uri just use that.
The value in the example config is great for local debugging / running.