Skip to content

DynamicDevices/jean-claude-van-damme

Repository files navigation

Jean-Claude's Webcam - Agentic Tools Demo 🎬

A simple webcam streaming server that demonstrates agentic tools by:

  1. Setting up a local web server
  2. Streaming webcam video
  3. Using browser automation to display it
  4. CI/CD pipeline for code quality and testing

Quick Start

  1. Install dependencies:
pip3 install -r requirements.txt
  1. Run the server:
python3 webcam_server_simple.py
  1. Open http://localhost:5000 in your browser

The server will stream video from your default webcam (usually /dev/video0) at 640x480 resolution.

Features

  • Real-time MJPEG video streaming
  • Beautiful gradient UI with Jean Claude Van Damme "Timecop" theme
  • Thread-safe camera access
  • Automatic camera initialization
  • Graceful shutdown handling
  • Automated CI/CD with linting and testing

CI/CD Pipeline

This project includes a GitHub Actions CI pipeline that:

  • Lints code with flake8 and pylint
  • Runs tests with pytest and coverage reporting
  • Tests on multiple Python versions (3.8, 3.9, 3.10, 3.11)
  • Checks code formatting with black

Pre-commit Hooks

This repository uses pre-commit hooks to automatically lint and format code before each commit. The hooks will:

  • ✅ Remove trailing whitespace
  • ✅ Fix end-of-file issues
  • ✅ Format Python code with black
  • ✅ Lint with flake8
  • ✅ Sort imports with isort
  • ✅ Check for security issues with bandit

First-time setup:

pip3 install pre-commit
pre-commit install

After installation, hooks will run automatically on every git commit. You can also run them manually:

# Run on all files
pre-commit run --all-files

# Run on staged files only (default)
pre-commit run

Running CI Checks Locally

You can run the same checks locally before pushing:

./scripts/run_ci_checks.sh

Or manually:

# Lint
flake8 . --max-line-length=127
pylint webcam_server_simple.py

# Test
pytest test_webcam_server.py -v

# Format check
black --check .

CI Status

The CI pipeline runs automatically on:

  • Every push to main branch
  • Every pull request

Check the Actions tab to see the latest CI status.

Testing

Run the test suite:

python3 test_webcam_server.py
# or
pytest test_webcam_server.py -v

The tests verify:

  • All required modules can be imported
  • Server files exist
  • Configuration files are present

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors