Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

CircuitPython USB host driver for cameras

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Adafruit Fruit Jam

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-usb-host-camera

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-usb-host-camera

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install adafruit-circuitpython-usb-host-camera

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install adafruit_usb_host_camera

Or the following command to update an existing version:

circup update

Usage Example

import time

import adafruit_usb_host_camera

camera = None
while camera is None:
    try:
        # Finds the camera among the attached devices (a keyboard, a mouse...)
        camera = adafruit_usb_host_camera.UVCCamera()
    except ValueError:
        print("Plug a USB camera into the USB host port")
        time.sleep(2)

print("Camera modes:", camera.modes)
mode = camera.find_mode(640, 480)
print("Using", mode)
camera.start(mode)
frame = camera.capture()
camera.stop()

camera.save_jpeg("/saves/photo.jpg", frame)
print("Saved /saves/photo.jpg,", len(frame), "bytes")

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for adafruit-circuitpython-usb-host-camera 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adafruit-circuitpython-usb-host-camera 1.0.0
File Size Uploaded
adafruit_circuitpython_usb_host_camera-1.0.0.tar.gz 30.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-usb-host-camera 1.0.0
File Interpreter ABI Platform
adafruit_circuitpython_usb_host_camera-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.8 kB

Release files / adafruit_circuitpython_usb_host_camera-1.0.0.tar.gz

Download URL adafruit_circuitpython_usb_host_camera-1.0.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
290d89bbce468aee41885a7af48aa315a69d32b41e73395d353a8db0d2884993
BLAKE2b-256 checksum
How to use checksums
4277909c0e84f22394432baa8191d8746b2cb20310b390ba39efa6fe36293be0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / adafruit_circuitpython_usb_host_camera-1.0.0-py3-none-any.whl

Download URL adafruit_circuitpython_usb_host_camera-1.0.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f04d946e7aae285cad981aec9cbe4e38f573a4260bafa545ce4f2a82f7135e7
BLAKE2b-256 checksum
How to use checksums
8756085cfc8c7b5e19e7b426b602246cb271992f784052b64ed60d9dc17c2fc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page