## Dependency update summary Generated: 2026-05-25 09:01 UTC ### Vulnerability scan No vulnerabilities found. ### Outdated packages The following packages were updated: Was: version = "26.5.0" Updated: version = "26.5.1" Was: version = "2026.4.22" Updated: version = "2026.5.20" Was: version = "8.4.0" Updated: version = "8.4.1" Was: version = "3.5.0" Updated: version = "3.5.1" Was: version = "3.15" Updated: version = "3.16" Was: python-versions = ">=3.8" Updated: python-versions = ">=3.9" Was: version = "2.4.5" Updated: version = "2.4.6" Was: version = "3.4.11" Updated: version = "3.4.12" Was: version = "2.0.49" Updated: version = "2.0.50" --------- Co-authored-by: Gitea CI <ci@gitea.com> Reviewed-on: #31
BirdCam: A Flask-Based Camera Monitoring System
A lightweight, Python-based system for monitoring and managing Raspberry Pi cameras using Flask, SQLAlchemy, and modern Python best practices.
🚀 Overview
BirdCam is a simple yet robust application designed to monitor camera status and log events in real time. Built with Flask and SQLAlchemy, it provides:
- Real-time camera status tracking (
runningstate). - Event logging for camera actions (
start,stop) with IP addresses and timestamps. - A clean, maintainable architecture using modern Python 3.12 features and type hints.
It's ideal for hobbyists, developers, or IoT projects where you need to track camera activity from a central dashboard or script.
🔧 Key Features
- ✅ Real-time camera status (e.g., whether a camera is running or not).
- ✅ Event logging with full metadata (action, IP address, timestamp).
- ✅ Automatic creation of status records if missing.
- ✅ Type-safe, well-documented code with full type hints.
- ✅ Modern Python practices:
- Uses Python 3.12 with
__future__.annotations. - Leverages
dataclasses-like patterns withMappedandmapped_column. - Includes comprehensive linting via Black, Ruff, and Mypy.
- Uses Python 3.12 with
- ✅ Automated test coverage with
pytestandpytest-cov.
📦 Dependencies
| Package | Version | Purpose |
|---|---|---|
Flask |
^3.0 |
Web framework for serving the app |
Flask-SQLAlchemy |
^3.1.1 |
ORM for database interactions |
Pillow |
^12.1.1 |
Image processing (for camera previews) |
Gunicorn |
^25.1.0 |
Production WSGI server |
Pytest |
^9.0.3 |
Testing framework |
Pytest-Cov |
^7.1.0 |
Test coverage reporting |
Black / Ruff |
^26.0 / ^0.4 |
Code formatting and linting |
Mypy |
^1.10 |
Static type checking |
✅ All dependencies are pinned for stability and compatibility.
🛠️ Setup & Installation
-
Clone the repository:
git clone https://gitea.letteka.com/letteka/birdcam.git cd birdcam -
Install dependencies:
pip install -e . -
Run the app:
gunicorn -w 1 -b 0.0.0.0:5000 app:appOr use Flask’s built-in dev server:
flask run
📝 How It Works
Camera Status
- The
CameraStatusmodel tracks a single camera’s running state. - On startup, it ensures a status record exists (ID = 1).
- The
get()andset_running()methods allow safe access and updates.
Camera Events
- Every time a camera action occurs (
startorstop), an event is logged. - Events include:
- Action type (
start/stop) - Client IP address
- Timestamp with timezone support
- Action type (
- The
recent()method allows retrieval of the latest events (e.g., for logging or dashboard display).
🧪 Testing
The project includes full test coverage using pytest with coverage reporting:
pytest --cov=src --cov-report=term-missing
Tests are located in the tests/ directory and cover:
- Status retrieval and updates.
- Event logging and retrieval.
- Edge cases (e.g., missing status records).
📝 Development Workflow
✅ Code is formatted with Black and linted with Ruff.
✅ Static type checking is enforced using Mypy.
✅ All code uses consistent naming and formatting.
✅ All public APIs are documented with docstrings.
⚙️ Future Improvements
- Add support for multiple cameras.
- Integrate with a web dashboard (e.g., using Vue.js or Streamlit).
- Add camera preview functionality via HTTP endpoints.
- Support for MQTT or other event-driven systems.
- Add user authentication or role-based access.
📚 License
This project is open-source and available under the MIT License.
🙌 Contributing
Contributions are welcome! Please open an issue or submit a pull request with clear descriptions and tests. 📬 Contact: Andrew Kettel andrew.kettel@gmail.com