Metadata-Version: 2.4
Name: webcam-security
Version: 0.3.6
Summary: A webcam security monitoring system with Telegram notifications
Home-page: https://github.com/JavierOramas/webcam-security
Author: Javier Oramas
Author-email: Javier Oramas <javiale2000@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/JavierOramas/webcam-security
Project-URL: Repository, https://github.com/JavierOramas/webcam-security
Project-URL: Issues, https://github.com/JavierOramas/webcam-security/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python>=4.5.0
Requires-Dist: imutils>=0.5.4
Requires-Dist: requests>=2.25.0
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: sounddevice>=0.4.0
Requires-Dist: soundfile>=0.12.0
Requires-Dist: ffmpeg-python>=0.2.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: setuptools>=61.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-mock>=3.10.0; extra == "test"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Webcam Security

[![PyPI version](https://img.shields.io/pypi/v/webcam-security.svg?style=flat-square)](https://pypi.org/project/webcam-security/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/yourusername/webcam-security/ci.yml?branch=main&style=flat-square)](https://github.com/yourusername/webcam-security/actions)
[![License](https://img.shields.io/github/license/yourusername/webcam-security?style=flat-square)](LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/webcam-security.svg?style=flat-square)](https://pypi.org/project/webcam-security/)
[![Downloads](https://img.shields.io/pypi/dm/webcam-security?style=flat-square)](https://pypi.org/project/webcam-security/)

A Python package for webcam security monitoring with Telegram notifications. This package provides motion detection capabilities with configurable monitoring hours and automatic video recording.

## Features

- 🎥 Real-time motion detection using webcam
- 📱 Telegram notifications with snapshots and device identification
- ⏰ Configurable monitoring hours (default: 10 PM - 6 AM)
- 🔧 Telegram bot commands for remote configuration
- 🚨 Force monitoring on/off via Telegram
- 🎬 Automatic video recording on motion detection
- 🎵 Audio recording with video (combined MP4 format)
- 🧹 Automatic cleanup of old recordings
- 🖥️ Live preview with monitoring status
- 🚀 Easy-to-use CLI interface
- 🔄 Self-update mechanism
- ⚡ UV-powered for faster builds and dependency management

## Telegram Bot Commands

Once the monitoring is running, you can control it remotely via Telegram commands:

### Status & Control
- `/start` - Welcome message and command list
- `/status` - Show current configuration and monitoring status
- `/help` - Show detailed help and command reference
- `/force_on` - Force monitoring ON (ignores time schedule)
- `/force_off` - Force monitoring OFF (returns to normal schedule)

### Configuration
- `/set_hours <start> <end>` - Set monitoring hours (24h format)
  - Example: `/set_hours 22 6` (10 PM to 6 AM)
  - Example: `/set_hours 0 24` (24/7 monitoring)

### System
- `/update` - Check for software updates

## Usage

### Quick Start

1. **Initialize configuration:**
   ```bash
   webcam-security init --bot-token "YOUR_BOT_TOKEN" --chat-id "YOUR_CHAT_ID" --device-id "MyCamera" --media-path "~/my-recordings"
   ```

2. **Start monitoring:**
   ```bash
   webcam-security start
   ```

3. **Control remotely via Telegram:**
   - Send `/start` to your bot for command list
   - Use `/force_on` to enable monitoring immediately
   - Use `/set_hours 22 6` to set monitoring hours

### Device Identification

All media sent to Telegram includes a device identifier:
- If you specify `--device-id` during init, that name will be used
- Otherwise, the system hostname will be used automatically
- This helps identify which camera sent the alert when you have multiple systems

### Media Storage

Recordings and snapshots are stored in a configurable location:
- **Default**: `~/webcam-security` (in your home directory)
- **Custom**: Use `--media-path` during init or `/set_media_path` via Telegram
- **Examples**: 
  - `~/Documents/security` - Store in Documents folder
  - `/var/security/recordings` - Store in system directory
  - `~/Desktop/camera1` - Store on desktop with device name

### Available Commands

- `webcam-security init` - Initialize configuration
- `webcam-security start` - Start monitoring
- `webcam-security status` - Show current configuration
- `webcam-security clean` - Manually clean old recordings
- `webcam-security update` - Check for and install updates

## Installation

### Using pip (traditional)
