{"id":26433759,"url":"https://github.com/charlysan/pyrfidhid","last_synced_at":"2025-04-13T00:21:43.055Z","repository":{"id":46924025,"uuid":"117624323","full_name":"charlysan/pyrfidhid","owner":"charlysan","description":"Python library to control Chinese USB HID 125Khz RFID Reader/Writer","archived":false,"fork":false,"pushed_at":"2020-11-17T02:00:28.000Z","size":106,"stargazers_count":146,"open_issues_count":2,"forks_count":34,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-26T18:12:53.195Z","etag":null,"topics":["125khz","cli","drivers","idrw","python","reverse-engineering","rfid","rfid-reader","sniffing","state-machine","usb","usb-hid","usb-reader","wireshark"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charlysan.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}},"created_at":"2018-01-16T03:05:42.000Z","updated_at":"2025-03-20T16:00:33.000Z","dependencies_parsed_at":"2022-08-26T08:01:09.935Z","dependency_job_id":null,"html_url":"https://github.com/charlysan/pyrfidhid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fpyrfidhid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fpyrfidhid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fpyrfidhid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlysan%2Fpyrfidhid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlysan","download_url":"https://codeload.github.com/charlysan/pyrfidhid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248648468,"owners_count":21139305,"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":["125khz","cli","drivers","idrw","python","reverse-engineering","rfid","rfid-reader","sniffing","state-machine","usb","usb-hid","usb-reader","wireshark"],"created_at":"2025-03-18T07:18:41.126Z","updated_at":"2025-04-13T00:21:43.032Z","avatar_url":"https://github.com/charlysan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyrfidhid\n\nPython library to control Chinese USB HID 125Khz RFID Reader/Writer \n\n\n## Introduction\n\nThis library is the result of reverse-engineering the communication protocol of a Chinese USB 125Khz RFID Reader/Writer. A detailed document describing the whole procedure can be found at the wiki section of this project:\n\n[How to reverse engineer a USB HID RFID Reader/Writer](https://github.com/charlysan/pyrfidhid/wiki/Reverse-Engineering-A-USB-HID-RFID-Reader-Writer)\n\nThe library can be used to control the USB RFID device under Linux or MacOS, and it uses [pyusb](https://github.com/pyusb/pyusb) and [libusb](http://libusb.info/) to communicate through the USB port.\n\n## Installation (using pip)\n\nYou will need `Python 2.7.x` or greater, and [pip](https://pip.pypa.io/en/stable/). \n\n### MacOS\n \n```bash\n$ brew install libusb\n$ pip install pyusb\n$ pip install --upgrade pyrfidhid\n```\n\n\n### Linux\n\n```bash\n$ sudo apt-get install libusb-1.0-0-dev\n$ sudo pip install pyusb\n$ sudo pip install --upgrade pyrfidhid\n```\n\n## Manual Installation\n\nIf you can't install the library using pip, then try to install it using `setup.py` script. Just clone this repo, install the dependencies and run the `setup.py` script: \n\n```bash\n$ python setup.py install\n```\n\n\n## Usage\n\nThe library should work with both Python 2.7.x and 3.x. After running the `setup.py` script you should be able to import and use the library within your project like this:\n\n```python\nfrom rfidhid.core import RfidHid\n\ntry:\n    # Try to open RFID device using default vid:pid (ffff:0035)\n    rfid = RfidHid()\nexcept Exception as e:\n    print(e)\n    exit()\n\npayload_response = rfid.read_tag()\nuid = payload_response.get_tag_uid()\n\nrfid.beep()\nprint(uid)\n```\n\nThe above script should try to connect to the device, read a Tag (if it is already close to the device), print the UID and beep.\n\nFor more complex read/write examples, please check out the [examples](https://github.com/charlysan/pyrfidhid/tree/master/examples) folder.\n\nYou can also check the [API documentation](documentation/apidoc.txt) for a list of exported methods.\n\n\n## RFID CLI Tool\n\nA command line tool called `rfid_cli` is also included with the library, and it can be used to read, write and clone tags. For a complete documentation please check [rfid_cli documentation](cli/README.md)\n\n\n## Final notes\n\nIf you are looking for an Android tool similar to `IDRW V3` you can check [this project](https://github.com/NiceLabs/usb-125khz-idrw)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlysan%2Fpyrfidhid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlysan%2Fpyrfidhid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlysan%2Fpyrfidhid/lists"}