ajoycon
Modern async Python driver for Nintendo Switch Joy-Con controllers
Fork of tokoroten-lab/joycon-python
Install
Using uv (recommended)
uv add ajoycon
Using pip
pip install ajoycon
Linux Setup
1. Install system dependencies
sudo apt install libhidapi-dev libudev-dev
2. Install hidapi with hidraw backend support
The default hidapi package doesn't support Bluetooth HID devices properly. Install from source:
Using uv:
uv remove hidapi
uv add hidapi --no-binary hidapi
Using pip:
pip uninstall hidapi
pip install hidapi --no-binary hidapi
3. Setup udev rules
Use the provided installation script:
./install_udev.sh
Or manually:
sudo cp 50-nintendo-switch.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
4. Blacklist the kernel hid_nintendo driver
The kernel driver conflicts with hidapi access:
echo "blacklist hid_nintendo" | sudo tee /etc/modprobe.d/blacklist-nintendo.conf
sudo rmmod hid_nintendo # Unload the module (or reboot)
5. Connect your Joy-Cons
Pair and connect your Joy-Cons via Bluetooth, then reconnect them after completing the setup above.
Usage
import asyncio
from ajoycon import discover_joycons
async def main():
joycons = discover_joycons()
if not joycons:
return
async with joycons[0].connect() as joycon:
status = joycon.status
print(f"Battery: {status.battery.level.name}")
print(f"Buttons: {status.buttons}")
print(f"Sticks: {status.stick_l}, {status.stick_r}")
print(f"IMU: {status.imu}")
asyncio.run(main())
Requirements
- Python 3.13+
- hidapi (built with hidraw backend for Linux Bluetooth support)
- pyglm
System Dependencies (Linux)
- libhidapi-dev
- libudev-dev
License
MIT
Metadata
Release files for ajoycon 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ajoycon-1.0.1.tar.gz | 20.1 kB | Without provenance | Details for ajoycon-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ajoycon-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for ajoycon-1.0.1-py3-none-any.whl |
Total release size: 32.7 kB
Release files / ajoycon-1.0.1.tar.gz
| Download URL | ajoycon-1.0.1.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a546751a48204e8974d2722262d5eabaf712b303e3dcf7cd4dfec9286cb5be5e
|
|
BLAKE2b-256 checksum How to use checksums |
22503f05ed2e0b48a7bc10d283c710d95f9f97377ba3f581dffe998449956deb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Release files / ajoycon-1.0.1-py3-none-any.whl
| Download URL | ajoycon-1.0.1-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ecca16e907eb190c05249cca6fed9bc5f976ec0344f27dca9bd9dae83caf197
|
|
BLAKE2b-256 checksum How to use checksums |
b3d961eaf23d39e95b9272821c3e6198a5ae150cb8835168b594e49009cea685
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Security for ajoycon 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.