Skip to main content

Python binding for the libusb C library.

Project description

libusb

Python binding for the libusb C library.

Overview

Python libusb module is a low-level binding for libusb C library.
It is an effort to allow python programs full access to the API implemented and provided by the well known *libusb* library.

PyPI record.

Documentation.

libusb is a lightweight Python package, based on the ctypes library.
It is fully compliant implementation of the original C libusb 1.0 API by implementing whole its functionality in a clean Python instead of C.

libusb API 1.0 documentation can be found at:

libusb-1.0 API Reference on Documentation.

libusb uses the underlying libusb C shared library as specified in libusb.cfg (included libusb-X.X.* is the default), but there is also ability to specify it programmatically by one of the following ways:

import libusb
libusb.config(LIBUSB="libusb C shared library absolute path")
# or
libusb.config(LIBUSB=None)  # included libusb-X.X.* will be used

About original libusb:

Borrowed from the original website:

libusb - A cross-platform user library to access USB devices

Overview

libusb is a C library that provides generic access to USB devices. It is intended to be used by developers to facilitate the production of applications that communicate with USB hardware.

It is portable: Using a single cross-platform API, it provides access to USB devices on Linux, OS X, Windows, Android, OpenBSD, etc.

It is user-mode: No special privilege or elevation is required for the application to communicate with a device.

It is version-agnostic: All versions of the USB protocol, from 1.0 to 3.1 (latest), are supported.

What platforms are supported?

Linux, OS X, Windows, Windows CE, Android, OpenBSD/NetBSD, Haiku.

For additional information, please consult the FAQ or the Wiki.

Requirements

  • It is a fully independent package.
    All necessary things are installed during the normal installation process.
  • ATTENTION: currently fully tested only for Windows.

Installation

Prerequisites:

To install run:

python -m pip install --upgrade libusb

Development

Prerequisites:

  • Development is strictly based on nox. To install it run:

    python -m pip install --upgrade nox

Visit Development page.

Installation from sources:

clone the sources:

git clone https://github.com/karpierz/libusb libusb

and run:

python -m pip install ./libusb

or on development mode:

python -m pip install --editable ./libusb

License

Copyright (c) 2016-2026 Adam Karpierz
Licensed under the zlib/libpng License
Please refer to the accompanying LICENSE file.

Authors

Sponsoring

If you would like to sponsor the development of this project, your contribution is greatly appreciated.
As I am now retired, any support helps me dedicate more time to maintaining and improving this work.

Donate

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libusb-1.0.29.post7.tar.gz (803.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libusb-1.0.29.post7-py3-none-any.whl (745.3 kB view details)

Uploaded Python 3

File details

Details for the file libusb-1.0.29.post7.tar.gz.

File metadata

  • Download URL: libusb-1.0.29.post7.tar.gz
  • Upload date:
  • Size: 803.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for libusb-1.0.29.post7.tar.gz
Algorithm Hash digest
SHA256 71cc0099aca12e47bf1269e9b9aa7ec86fc5b258c0bb472efe496805fc20a4e7
MD5 8d6854a60dcef80a9f31a1c66b91c016
BLAKE2b-256 fab6ec2a3fb80d32edde51031d5b53ca2a97c5fe0db8197a58ba660021f89f47

See more details on using hashes here.

File details

Details for the file libusb-1.0.29.post7-py3-none-any.whl.

File metadata

  • Download URL: libusb-1.0.29.post7-py3-none-any.whl
  • Upload date:
  • Size: 745.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for libusb-1.0.29.post7-py3-none-any.whl
Algorithm Hash digest
SHA256 7917691dbf0db1031e8b274fc761659281fb9d5681820fb24f8aba8f34c71139
MD5 1cc8e689c8daf8950723f3a4561bd964
BLAKE2b-256 3415e882ac7820ea0f2bf08ae19cfe79fb07e94659924476a83664a8c850ef21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page