Metadata-Version: 2.4
Name: kamera
Version: 1.0.0
Summary: Realtime webcam streaming and video processing with a FastAPI UI
Author-email: Mert Cobanov <mertcobanov@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/cobanov/kamera
Project-URL: Repository, https://github.com/cobanov/kamera
Project-URL: Issues, https://github.com/cobanov/kamera/issues
Keywords: camera,opencv,fastapi,streaming,webcam
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.115.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: opencv-python>=4.9.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: uvicorn>=0.30.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: pytest>=8.2.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Dynamic: license-file

# Kamera

Kamera streams your webcam in real time and gives you a fast control panel for
brightness, rotation, grayscale, mirroring, and filters.

## Install

```bash
pip install kamera
```

## Run

```bash
kamera
```

Then open `http://127.0.0.1:4141`.

## What is new in v1.0.0

- Refactored backend architecture with explicit camera lifecycle management.
- New API-driven UI state sync and reset workflow.
- Improved stream resilience for temporary camera read failures.
- Improved filter behavior (`edges` now handles color input safely).
- Added automated tests and modern project metadata in `pyproject.toml`.
- Added `uv` workflow and lockfile for reproducible local development.

## Breaking changes in v1.0.0

- Recommended Python version range is now `>=3.10`.
- JSON API endpoints are now primary:
  - `GET /api/settings`
  - `POST /api/settings`
  - `POST /api/settings/reset`
- Legacy `POST /settings` still works for form clients, but new integrations
  should migrate to `/api/settings`.

## API

### `GET /video_feed`

Returns an MJPEG stream from the active webcam.

### `GET /api/settings`

Returns current settings:

```json
{
  "rotate": 0,
  "brightness": 1.0,
  "grayscale": false,
  "mirror": false,
  "filter_name": "none"
}
```

### `POST /api/settings`

Updates one or more settings.

Example:

```bash
curl -X POST http://127.0.0.1:4141/api/settings \
  -H "content-type: application/json" \
  -d '{"rotate":90,"brightness":1.3,"grayscale":true,"filter_name":"sepia"}'
```

### `POST /api/settings/reset`

Resets all settings to defaults.

```bash
curl -X POST http://127.0.0.1:4141/api/settings/reset
```

## Development with uv

```bash
uv sync --extra dev
uv run pytest
uv run kamera
```

## Release checklist

```bash
uv sync --extra dev
uv run pytest
uv build
uv run python -m pip install --force-reinstall dist/*.whl
kamera
```

Publish to PyPI:

```bash
uv run twine check dist/*
uv run twine upload dist/*
```

## License

MIT
