This project is a Python-based crawler that fetches occupancy data from multiple sources:
- Bazény Lužánky (Pool): Fetches the number of people from bazenyluzanky.starez.cz.
- Hangar Brno (Climbing Gym): Fetches the occupancy status (e.g., "Open!", "Busy!") from hangarbrno.cz.
Data is logged to separate CSV files in the data/ directory.
- Python 3.x
- Google Chrome installed (for Selenium)
-
Clone the repository (if applicable) or navigate to the project directory.
-
Create a virtual environment:
python3 -m venv .venv
-
Activate the virtual environment:
source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
To run the crawler manually, use the src/main.py script. You can specify which source to crawl.
python src/main.py --source all# Only Luzanky Pool
python src/main.py --source luzanky
# Only Hangar Brno
python src/main.py --source hangar- Luzanky: Data is appended to
data/luzanky.csv(Timestamp, Occupancy Number). - Hangar: Data is appended to
data/hangar.csv(Timestamp, Occupancy Status).
You can visualize the collected crowd data for Hangar Brno using the included script.
python3 visualize_hangar_crowd.py --file data/hangar.csvThis will:
- Generate
hangar_plots.pngcontaining:- A time-series plot of crowd levels.
- Average occupancy by hour of the day.
- Average occupancy by day of the week.
- Print a summary analysis to the console, including optimal visiting times.
You can automate the crawler using cron on Linux.
-
Open the crontab editor:
crontab -e
-
Add a line to schedule the job. Replace
/path/to/projectwith the absolute path to your project directory.Run every 1 hour (at minute 0):
0 * * * * cd /path/to/project && .venv/bin/python src/main.py --source all >> cron.log 2>&1
Run every 10 minutes:
*/10 * * * * cd /path/to/project && .venv/bin/python src/main.py --source all >> cron.log 2>&1
-
Save and exit.
This project was vibecoded using Antigravity. It was easy to do, and I will definitely keep using LLMs for making small tools like this.