Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

CircuitPython library for running DuckyScript

DuckyScript

You can find the DuckyScript Documentation here

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-ducky

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-ducky

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ducky

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install adafruit_ducky

Or the following command to update an existing version:

circup update

Usage Example

Here is an example of using the Ducky library. First you will need to import the libraries

import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import adafruit_ducky

Once this is done, define the keyboard layout and initialize the Ducky object.

time.sleep(1)  # Sleep for a bit to avoid a race condition on some systems
keyboard = Keyboard(usb_hid.devices)
keyboard_layout = KeyboardLayoutUS(keyboard)  # We're in the US :)

duck = adafruit_ducky.Ducky('duckyscript.txt', keyboard, keyboard_layout)

Now, set up a loop which will run a line of the script every time loop is called.

result = True
while result is not False:
    result = duck.loop()

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for adafruit-circuitpython-ducky 1.5.6

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

Source distribution (sdist)

Source distribution for adafruit-circuitpython-ducky 1.5.6
File Size Uploaded
adafruit_circuitpython_ducky-1.5.6.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-ducky 1.5.6
File Interpreter ABI Platform
adafruit_circuitpython_ducky-1.5.6-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / adafruit_circuitpython_ducky-1.5.6.tar.gz

Download URL adafruit_circuitpython_ducky-1.5.6.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f43bbdd69e0a45d0530ce444a8e40cb4b8effbc51322c342e9986dbc923874d1
BLAKE2b-256 checksum
How to use checksums
b728466170cad2cb69b0951b6766f6aea1317daf04059e2c85d7b63d910ad73f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / adafruit_circuitpython_ducky-1.5.6-py3-none-any.whl

Download URL adafruit_circuitpython_ducky-1.5.6-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6d4a02b8b7227f00b72ae66ac80c6195b5e046307d4897e8b8a8415931fa8b9
BLAKE2b-256 checksum
How to use checksums
d6e72fd722740de23b2283df09274048dbc916e2baffffe04811bedb6aa25c14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.5.6 This release

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

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