Metadata-Version: 2.4
Name: telegen-shims-picamera
Version: 0.1.0.dev6
Summary: Shims for the PiCamera library for the CounterFit virtual IoT device app
Home-page: https://github.com/CounterFit-IoT/CounterFit
Author: Jim Bennett
License: MIT
Keywords: iot picamera camera virtual hardware
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Hardware
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.14
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: telegen-connection
Requires-Dist: pillow
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# CounterFit Shims - Picamera

![Picamera Shim](https://img.shields.io/badge/Platform-Python-green) [![PyPI](https://img.shields.io/pypi/v/telegen-shims-picamera)](https://pypi.org/project/telegen-shims-picamera)

Shims for the Picamera to read from a virtual camera

See the [Picamera Docs](https://picamera.readthedocs.io/) for the API documentation.

## Getting started

To use these shims, you will need to install [CounterFit](https://github.com/CounterFit-IoT/CounterFit) and have it running, with the appropriate camera hardware created. Create the camera with a name of `Picamera`.

* Install this package from pip:

    ```sh
    pip install telegen-shims-picamera
    ```

* Import Picamera using the `counterfit_shims_picamera` package instead of the `picamera` package, as well as importing the `TeleGenConnection` from the `counterfit_connection` module:

    ```python
    from counterfit_connection import TeleGenConnection
    import counterfit_shims_picamera
    ```

* Configure the connection to the CounterFit app. Change the hostname and port to where you are running it:

    ```python
    TeleGenConnection.init('127.0.0.1', 5000)
    ```

* Write your Picamera code as usual.

    For example, to capture an image as a JPEG:

    ```python
    camera = PiCamera()
    image = io.BytesIO()
    camera.capture(image, 'jpeg')
    ```
