An app to capture and process webcam data.
Project description
Camera Capture
A Python application to periodically capture images from a set of webcams of the Aero Club of east Africa: Kenya webcams (https://webcams.aeroclubea.com/index.html), saving them in a structured folder hierarchy. The configuration is managed via a simple CLI and a config file in your user profile.
Requirements
- Python 3.7+
- Depends on:
requests,pandas,beautifulsoup4
Installing
pip install camera-capture
[!CAUTION]
When installing on Windows, preferable make sure Python is installed from https://python.org. When Python is installed from the Microsoft Store,
pip install camera-capturewill install, but not fully adjust thePathenvironment variable. The installation issues a warning (the exact path is likely not the same, but it should look similar):WARNING: The script normalizer.exe is installed in
<userprofile\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scriptswhich is not onPATH. Consider adding this directory toPATHor, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script capture.exe is installed in<userprofile>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scriptswhich is not onPATH. Consider adding this directory toPATHor, if you prefer to suppress this warning, use --no-warn-script-location.To make full use of the
camera-capturefeature consider following this advice.
How the App Works
-
Configuration
The app uses a configuration file (camera.config) in your user profile directory to store settings such as the root folder for saving images, capture interval, and start/end times. -
Camera Locations
Camera URLs and location names are loaded from a user provided CSV file (default =camera_locations.txt). Each row should have aurland alocationcolumn. The user is free to add/remove locations at will. -
Image Capture
For each camera, the app downloads the latest image and saves it in a folder structure:
root_folder/location/YYYY/MM/DD/The root_folder is read from the configuration file when starting the app. -
Scheduling
The app can run once, repeat for the current day, or repeat indefinitely, based on your command line options. For all locations the scheduled start and end time per day are equal.The capture moments are equally spaced after the
starttime and will stop on or before theendtime, never after. -
CLI Configuration
You can list and update configuration settings using the CLI.
Command Line Options
The app provides several commands and subcommands:
Main Commands
-
run
Capture images from all cameras once.capture runOr, as fallback (see the caution above)
python -m camera run -
run_repeat
Repeat capturing images at the configured interval for the current day.capture run_repeatOr
python -m camera run_repeat -
run_repeat_no_limit
Repeat capturing images at the configured interval indefinitely.capture run_repeat_no_limitOr
python -m camera run_repeat_no_limit
Config Subcommands
-
config list
List current configuration settings.capture config list -
config update
Update a configuration setting.
Example: change the image save pathcapture config update image_save_path D:/CameraImagesExample: change the capture interval to 60 minutes
capture config update interval 60Example: change the start time to 07:00
capture config update start 07:00Example: change the end time to 19:00
capture config update end 19:00
Configuration File
The configuration file (camera.config) is stored in your user profile folder (e.g., C:\Users\<username>\camera.config).
When the app is first started the configuration file will be created if it does not yet exist.
The config file is stored in JSON format. Below is an example file with all currently accepted keys:
{
"image_save_path": "D:/CameraImages",
"start": "06:30",
"end": "18:30",
"interval": 30,
"locations_file":"camera_locations.txt",
"verbose":False
}
Currently these keys are supported:
- image_save_path: The root folder for saving all the captured images.
- start: local time to start the capture (HH:MM)
- end: local time to end the capture (HH:MM)
- interval: time in minutes between captures.
- locations_file: name of the file containing the names of camera locations and their URLs. The file is expected in the current folder.
- verbose: enable verbose output for debugging and information
You can use the CLI to update these values, or manually edit the file.
Folder Structure
Images are saved in a hierarchy:
<image_save_path>/<location>/<year>/<month>/<day>/<location>_<timestamp>.jpg
The timestamp is in local time.
Example Usage
-
Capture all cameras once:
capture run -
List configuration:
capture config list -
Update interval:
capture config update interval 60
Logging
Logs are written to camera_capture.log in the current directory.
Troubleshooting
- Use
capture config listto check your configuration. - Use
capture config update <key> <value>to fix any settings. - Ensure
camera_locations.txtexists and hasurlandlocationcolumns.
Example camera_locations.txt file:
url,location
https://webcams.aeroclubea.com/Nairobi/nbo_wilsonE.html,Wilson Airport E
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camera_capture-1.0.5.tar.gz.
File metadata
- Download URL: camera_capture-1.0.5.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10e1dd01e15c79d1b460ab1578be99752fc98e9fa1eebc421ecad20356e7a9ea
|
|
| MD5 |
1cddf1a1c4b6f4e41051b22bfa8afd5d
|
|
| BLAKE2b-256 |
d37730f28349969e87891d98b54f89e8cc77c8fc6e627aed5f1b87538b8f83cd
|
File details
Details for the file camera_capture-1.0.5-py3-none-any.whl.
File metadata
- Download URL: camera_capture-1.0.5-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286deb2e33b8a888a59fb4aa639247e5e9f00e53451f6916280ba7f35ebaebaf
|
|
| MD5 |
5d0dc5e5c72974b78bfca7c493466835
|
|
| BLAKE2b-256 |
136e3dbdb7e1bf07e6ed9389991fc558bb70284b605366a2f79783508b62fa91
|