{"id":20785399,"url":"https://github.com/o-murphy/pydfuutil","last_synced_at":"2025-05-05T14:43:03.071Z","repository":{"id":172453115,"uuid":"648251485","full_name":"o-murphy/pydfuutil","owner":"o-murphy","description":"PyDfuUtil - Pure python realisation of dfu-util wrappers to libusb","archived":false,"fork":false,"pushed_at":"2025-03-24T12:24:24.000Z","size":136,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T13:48:44.969Z","etag":null,"topics":["dfu","dfu-util","dfuutil","libusb","pydfu","pydfuutl","python","python3","pyusb"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pydfuutil","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o-murphy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-01T14:38:26.000Z","updated_at":"2025-03-30T05:06:54.000Z","dependencies_parsed_at":"2024-01-15T16:33:17.979Z","dependency_job_id":"8c4ccf2a-d214-47e0-92f5-aef435c9dd4a","html_url":"https://github.com/o-murphy/pydfuutil","commit_stats":null,"previous_names":["o-murphy/pydfuutil"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-murphy%2Fpydfuutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-murphy%2Fpydfuutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-murphy%2Fpydfuutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-murphy%2Fpydfuutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o-murphy","download_url":"https://codeload.github.com/o-murphy/pydfuutil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516280,"owners_count":21760749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dfu","dfu-util","dfuutil","libusb","pydfu","pydfuutl","python","python3","pyusb"],"created_at":"2024-11-17T14:45:26.348Z","updated_at":"2025-05-05T14:43:03.045Z","avatar_url":"https://github.com/o-murphy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyDfuUtil - Pure python fork of **[dfu-util](https://dfu-util.sourceforge.net/)** wrappers to **[libusb](https://github.com/libusb/libusb)**\n\n[![PyPI Version](https://img.shields.io/pypi/v/pydfuutil?label=PyPI\u0026logo=pypi)](https://pypi.org/project/pydfuutil/)\n\n## Table of contents\n* **[Introduction](#introduction)**\n* **[Requirements](#requirements-and-platform-support)**\n* **[Installing](#installing)**\n* **[Usage](#installing)**\n  + [**Manual page**](https://dfu-util.sourceforge.net/dfu-util.1.html)\n  + [**dfu-util** (pydfuutil-util)](#pydfuutil)\n  + [**dfu-suffix** (pydfuutil-suffix)](#pydfuutil-suffix)\n  + [**dfu-prefix** (pydfuutil-prefix)](#pydfuutil-prefix)\n  + [**lsusb** (pydfuutil-lsusb)](#pydfuutil-lsusb)\n* **[Todos](#todos)**\n* **[Getting help](#getting-help)**\n* **[About](#about)**\n* **[Footnotes](#footnotes)**\n\n\n## Introduction\n\n* **PyDFUUtil** provides for easy access to the devices that supports **DFU** interface over host machine's **Universal Serial Bus (USB)**\nsystem for Python 3.\n* **PyDFUUtil** is an open realisation of original **[dfu-util](https://dfu-util.sourceforge.net/)**\nand thin wrapper over **[libusb](https://github.com/libusb/libusb)** _(uses **[PyUsb](https://github.com/pyusb/pyusb)** library as a backend)_.\n\n\u003e [!WARNING]\n\u003e The current status of the project is BETA version.\n\u003e Use it for your own risk\n\n\u003e [!IMPORTANT]\n\u003e Current version implements but not tested with real `dfuse` devices!\n\n\u003e [!TIP]\n\u003e Searching for contributors for testing the library\n\n## Requirements and platform support\n\n* Since **PyDFUUtil** uses the **[libusb](https://github.com/libusb/libusb)** library it has similar dependencies for using **[libusb](https://github.com/libusb/libusb)**\n* **PyDFUUtil** primarily tested on Linux and Windows, \nbut also can work on each platform where **[PyUsb](https://github.com/construct/construct)** library are available, including MacOS\n\n\n## Installing\n\n**PyDFUUtil** is generally installed through pip\n\n    # the latest official release\n    python -m pip install pydfuutil\n\n    # install a specific version (e.g. 0.0.1b1)\n    python -m pip install pydfuutil==0.0.1b1\n\n## Usage\n\n### pydfuutil\n```Bash\npydfuutil -h \n# or\npython -m pydfuutil -h\n\n####### usage:\nusage: pydfuutil [-h] [-V] [-v] [-l] [-e] [-E \u003cseconds\u003e]\n                 [-d \u003cvid\u003e:\u003cpid\u003e[,\u003cvid_dfu\u003e:\u003cpid_dfu\u003e]] [-n \u003cdnum\u003e] [-p \u003cbus-port. ... .port\u003e]\n                 [-c \u003cconfig_nr\u003e] [-i \u003cintf_nr\u003e] [-S \u003cserial_str\u003e[,\u003cserial_str_dfu\u003e]]\n                 [-a \u003calt\u003e] [-t \u003csize\u003e] [-U \u003cfile\u003e] [-Z \u003cbytes\u003e] [-D \u003cfile\u003e] [-R] [-w]\n                 [-s \u003caddress\u003e\u003c:...\u003e]\n\nPython implementation of DFU-Util tools\n\noptions:\n  -h, --help            show this help message and exit\n  -V, --version         Print the version number\n  -v, --verbose         Print verbose debug statements\n  -l, --list            List the currently attached DFU capable USB devices\n  -e, --detach          Detach the currently attached DFU capable USB devices\n  -E \u003cseconds\u003e, --detach-delay \u003cseconds\u003e\n                        Time to wait before reopening a device after detach\n  -d \u003cvid\u003e:\u003cpid\u003e[,\u003cvid_dfu\u003e:\u003cpid_dfu\u003e], --device \u003cvid\u003e:\u003cpid\u003e[,\u003cvid_dfu\u003e:\u003cpid_dfu\u003e]\n                        Specify Vendor/Product ID(s) of DFU device\n  -n \u003cdnum\u003e, --devnum \u003cdnum\u003e\n                        Match given device number (devnum from --list)\n  -p \u003cbus-port. ... .port\u003e, --path \u003cbus-port. ... .port\u003e\n                        Specify path to DFU device\n  -c \u003cconfig_nr\u003e, --cfg \u003cconfig_nr\u003e\n                        Specify the Configuration of DFU device\n  -i \u003cintf_nr\u003e, --intf \u003cintf_nr\u003e\n                        Specify the DFU Interface number\n  -S \u003cserial_str\u003e[,\u003cserial_str_dfu\u003e], --serial \u003cserial_str\u003e[,\u003cserial_str_dfu\u003e]\n                        Specify Serial String of DFU device\n  -a \u003calt\u003e, --alt \u003calt\u003e\n                        Specify the Altsetting of the DFU Interface\n  -t \u003csize\u003e, --transfer-size \u003csize\u003e\n                        Specify the number of bytes per USB Transfer\n  -U \u003cfile\u003e, --upload \u003cfile\u003e\n                        Read firmware from device into \u003cfile\u003e\n  -Z \u003cbytes\u003e, --upload-size \u003cbytes\u003e\n                        Read firmware from device into \u003cfile\u003e\n  -D \u003cfile\u003e, --download \u003cfile\u003e\n                        Read firmware from device into \u003cfile\u003e\n  -R, --reset           Issue USB Reset signalling once we`re finished\n  -w, --wait            Wait for device to appear\n  -s \u003caddress\u003e\u003c:...\u003e, --dfuse-address \u003caddress\u003e\u003c:...\u003e\n                        ST DfuSe mode string, specifying target\n                        address for raw file download or upload\n                        (not applicable for DfuSe file (.dfu) downloads).\n                        Add more DfuSe options separated with ':'\n\n                        leave\n                                Leave DFU mode (jump to application)\n                        mass-erase\n                                Erase the whole device (requires \"force\")\n                        unprotect\n                                Erase read protected device (requires \"force\")\n                        will-reset\n                                Expect device to reset (e.g. option bytes write)\n                        force\n                                You really know what you are doing!\n                        \u003clength\u003e\n                                Length of firmware to upload from device\n```\n\n### pydfuutil-suffix\n```Bash\npydfuutil-suffix -h\n# or \npython -m pydfuutil.suffix -h\n\n####### usage:\nusage: dfu-suffix [-h] [-V] (-c | -a | -D) [-p \u003cproductID\u003e] [-v \u003cvendorID\u003e] [-d \u003cdeviceID\u003e] [-s \u003caddress\u003e] [-T] \u003cfile\u003e\n\npositional arguments:\n  \u003cfile\u003e                Target filename\n\noptions:\n  -h, --help            Print this help message\n  -V, --version         Print the version number\n  -c, --check           Check DFU suffix of \u003cfile\u003e\n  -a, --add             Add DFU suffix to \u003cfile\u003e\n  -D, --delete          Delete DFU suffix from \u003cfile\u003e\n  -p \u003cproductID\u003e, --pid \u003cproductID\u003e\n                        Add product ID into DFU suffix in \u003cfile\u003e\n  -v \u003cvendorID\u003e, --vid \u003cvendorID\u003e\n                        Add vendor ID into DFU suffix in \u003cfile\u003e\n  -d \u003cdeviceID\u003e, --did \u003cdeviceID\u003e\n                        Add device ID into DFU suffix in \u003cfile\u003e\n  -s \u003caddress\u003e, --stellaris-address \u003caddress\u003e\n                        Specify lmdfu address for LMDFU_ADD\n  -T, --stellaris       Set lmdfu mode to LMDFU_CHECK\n```\n\n### pydfuutil-prefix\n```Bash\npydfuutil-prefix -h\n# or \npython -m pydfuutil.prefix -h\n\n####### usage:\nusage: pydfuutil-prefix [-h] [-V] (-c | -D | -a) [-s \u003caddress\u003e] [-T]\n                        [-L]\n                        \u003cfile\u003e\n\n\npositional arguments:\n  \u003cfile\u003e                Target filename\n\noptions:\n  -h, --help            show this help message and exit\n  -V, --version         Print the version number\n  -c, --check           Check DFU suffix of \u003cfile\u003e\n  -D, --delete          Delete DFU suffix from \u003cfile\u003e\n  -a, --add             Add DFU suffix to \u003cfile\u003e\n\nIn combination with -a:\n  -s \u003caddress\u003e, --stellaris-address \u003caddress\u003e\n                        Add TI Stellaris address prefix to \u003cfile\u003e\n\nIn combination with -a or -D or -c:\n  -T, --stellaris       Act on TI Stellaris address prefix of \u003cfile\u003e\n\nIn combination with -a or -D or -c:\n  -L, --lpc-prefix      Use NXP LPC DFU prefix format\n```\n\n### pydfuutil-lsusb\n```Bash\npydfuutil-lsusb -h\n# or \npython -m pydfuutil.lsusb -h\n\n####### usage:\nusage: pydfuutil-prefix [-v] [-s [[bus]:][devnum]]\n                        [-d vendor:[product]] [-D device] [-t] [-V]    \n                        [-h]\n\noptions:\n  -v, --verbose        Increase verbosity (show descriptors)\n  -s [[bus]:][devnum]  Show only devices with specified device and/or  \n                       bus numbers (in decimal)\n  -d vendor:[product]  Show only devices with the specified vendor     \n                       and product ID numbers (in hexadecimal)\n  -D device            Selects which device lsusb will examine by      \n                       UNIX-like path simulate\n  -t, --tree           Simulate UNIX-like physical USB device\n                       hierarchy\n  -V, --version        Print the version number\n  -h, --help           Show this help message and exit\n```\n\n#### Done:\n- [x] dfu\n- [x] dfu_file\n- [x] dfu_load\n- [x] portable\n- [x] quirks\n- [x] suffix\n- [x] usb_dfu\n- [x] lmdfu\n- [x] dfuse_mem\n- [x] dfuse\n- [x] dfu-util\n\n#### Todo\n- [x] Update sources to latest original version \"dfu-util-0.11\"\n\n[//]: # (https://dfu-util.sourceforge.net/)\n[//]: # (- https://sourceforge.net/p/dfu-util/dfu-util/ci/master/tree/)\n\n\n## Getting help\n* To report a bug or propose a new feature, use our issue tracker. But please search the database before opening a new issue.\n\n## About\nDfu-util - Device Firmware Upgrade Utilities\n\nDfu-util is the host side implementation of the \n[DFU 1.0](http://www.usb.org/developers/devclass_docs/usbdfu10.pdf) and \n[DFU 1.1](http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf)\nspecification of the USB forum.\n\nDFU is intended to download and upload firmware to devices connected over\nUSB. It ranges from small devices like micro-controller boards up to mobile\nphones. With dfu-util you are able to download firmware to your device or\nupload firmware from it.\n\ndfu-util has been tested with Openmoko Neo1973 and Freerunner and many\nother devices.\n\n* **[The official website](https://dfu-util.sourceforge.net/)**\n* **[DFU 1.0 spec](http://www.usb.org/developers/devclass_docs/usbdfu10.pdf)**\n* **[DFU 1.1 spec](http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf)**\n\n## RISK NOTICE\n\u003e [!IMPORTANT]\n\u003e THE CODE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n\n## Footnotes\n* On systems that still default to Python 2, replace python with python3\n* Project is in develop, it fulls issues not according to original **[dfu-util](https://github.com/Stefan-Schmidt/dfu-util)**!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-murphy%2Fpydfuutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo-murphy%2Fpydfuutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-murphy%2Fpydfuutil/lists"}