Skip to main content

pydualsense

control your dualsense through python. using the hid library this package implements the report features for controlling your PS5 controller.

Documentation

You can find the documentation at docs

Installation

Windows

Download hidapi and place the x64 .dll file into your Workspace. After that install the package from pypi.

pip install --upgrade pydualsense

Linux

On Linux based system you first need to add a udev rule to let the user access the PS5 controller without requiring root privileges.

sudo cp 70-ps5-controller.rules /etc/udev/rules.d
sudo udevadm control --reload-rules
sudo udevadm trigger

Then install the hidapi through your package manager of your system.

On an Ubuntu system the package libhidapi-dev is required.

sudo apt install libhidapi-dev

After that install the package from pypi.

pip install --upgrade pydualsense

usage

from pydualsense import pydualsense, TriggerModes

def cross_pressed(state):
    print(state)

ds = pydualsense() # open controller
ds.init() # initialize controller

ds.cross_pressed += cross_pressed
ds.light.setColorI(255,0,0) # set touchpad color to red
ds.triggerL.setMode(TriggerModes.Rigid)
ds.triggerL.setForce(1, 255)
ds.close() # closing the controller

See examples or examples docs folder for some more ideas

Help wanted

Help wanted from people that want to use this and have feature requests. Just open a issue with the correct label.

dependecies

  • hidapi-usb >= 0.3

Credits

Most stuff for this implementation were provided by and used from:

Coming soon

  • add multiple controllers
  • add documentation using sphinx

Release files for pydualsense 0.7.5

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

Source distribution (sdist)

Source distribution for pydualsense 0.7.5
File Size Uploaded
pydualsense-0.7.5.tar.gz 101.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydualsense 0.7.5
File Interpreter ABI Platform
pydualsense-0.7.5-py3-none-any.whl Python 3 none any Details

Total release size: 201.3 kB

Release files / pydualsense-0.7.5.tar.gz

Download URL pydualsense-0.7.5.tar.gz
Size 101.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6205fc0091387fca7b81e293df19420f432587519cc87a41cf8ac422a7702a0b
BLAKE2b-256 checksum
How to use checksums
7af3fda9e70a6707119766e22a640d5fe4696670ddba44991de096d5dee5be52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / pydualsense-0.7.5-py3-none-any.whl

Download URL pydualsense-0.7.5-py3-none-any.whl
Size 100.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83f6171199be9c6e1cfefe9fd09dff0697ebc5b96e2bef3a87c82363bb633365
BLAKE2b-256 checksum
How to use checksums
51f630102b59075dcedb2223f82467d626e5fcfffd0bff3bd8e490506ec55294
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.7.5 This release

2 release files

0.7.3

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6

2 release files

0.5.5

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.1

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