Skip to main content

pydobotlab

This project was created out of necessity as an alternative to the heavy DobotLab software officially provided by Dobot. It is designed specifically for the Dobot Magician and provides full coverage of the 28 Python API entries documented in the official DobotLab Magician manual. It uses the documented function names and arguments for motion, I/O, sensors, end effectors, the slideway, and the conveyor. It runs on Windows and Linux (tested on Ubuntu 24 and 26), and may also run on macOS, although macOS has not yet been tested.

The official DobotLab software, which is implemented with compiled DLLs, is heavy and creates an unfriendly barrier to accessing the robot for educational purposes. This project implements the available commands directly in pure Python using the original protocol (Dobot Communication Protocol V1.1.5). Because the robot connects via USB, the project can run on any operating system that supports Python and can communicate with the robot.

This project uses pyserial to communicate with the robot, so no vendor DLL or DobotStudio installation is required. Arm specifications and workspace information are available in the Dobot Magician V2 User Guide (DobotLab-based) V2.3.1.

In addition, this project:

  • Provides a Qt-based panel that mimics the DobotLab control panel and operates without interfering with other programs communicating with the robot.
  • Supports communication with one robot or more, allowing several robots to be controlled from a single workstation.
  • Implements a simulator that can be used to test the robot's behavior without having one connected.

Documentation & homepage · API reference · GitHub · Changelog · Report an issue

Installation

Requires Python 3.11 or newer. Install in a virtual environment:

python -m pip install "pydobotlab[gui]"

The gui extra installs the PySide6 control panel, pydobotlab-panel, and this is the highly recommended setting: scripts connect through the control panel by default. The base library alone (python -m pip install pydobotlab) requires only pyserial; scripts then open the serial port directly. Default settings are read from a per-user configuration file. See the installation guide for virtual environments, Windows drivers, and Linux serial-port permissions. The project has been used on Ubuntu and Windows; macOS hardware has not been verified.

Quick start

With the arm connected and its workspace clear, start the control panel and keep it running while scripts run:

pydobotlab-panel

Then run a script; it connects through the panel:

from pydobotlab import Magician

with Magician() as robot:  # auto-discover; or specify "/dev/ttyUSB0" / "COM3"
    robot.set_home()  # homes also from an alarm, as in DobotLab
    robot.ptp(mode=1, x=220, y=0, z=50, r=0)  # MOVJ_XYZ; returns when the arm arrives
    pose = robot.get_pose()
    print(pose)

print(pose) displays x, y, z, r, and all four joint angles:

Pose(x=220.00, y=0.00, z=50.00, r=0.00, joints=[0.00, 30.00, 45.00, 0.00])

The values above illustrate the format; actual joint angles depend on the robot's pose. Access individual values with pose.x, pose.y, pose.z, pose.r, or pose.joints. Positions are in millimetres and angles are in degrees.

Dobot is also available as an alias for Magician. The documented DobotLab method names and parameters are preserved for existing scripts.

As in DobotLab, ptp and the other commands return True once the arm has executed them, so each command starts after the previous one has ended. When the arm reports an alarm, such as an unreachable target, the command raises an exception that names the alarm and its fix, and the program stops.

with Magician() as robot:
    robot.ptp(mode=1, x=220, y=0, z=50, r=0)  # MOVJ_XYZ
    robot.ptp(mode=2, x=220, y=40, z=50, r=0)  # MOVL_XYZ
    robot.set_endeffector_suctioncup(enable=True, on=True)

See DobotLab compatibility for the complete function list and return-value conventions.

Try it without hardware

pydobotlab-panel --simulator

Or use the simulator from Python:

from pydobotlab import Magician
from pydobotlab.simulator import install_simulator, stop_all

install_simulator(arms=1)
try:
    with Magician("/dev/sim0", via_broker=False) as robot:
        robot.ptp(mode=1, x=220, y=0, z=50, r=0)  # MOVJ_XYZ
        print(robot.get_pose())
finally:
    stop_all()

The simulator supports offline examples and tests. It approximates motion and firmware behavior; it does not validate a real robot's trajectory.

Features and examples

  • Cartesian and joint motion, jogging, homing, speed settings, and continuous paths.
  • Suction cup, gripper, laser, digital I/O, sensors, and conveyor commands.
  • Structured alarms, motion-failure exceptions, and live pose streaming.
  • Firmware queue control and with robot.batch() for accumulating commands.
  • Multiple robot connections and a local broker for sharing a port between the GUI and scripts.

Start with pick and place, smiley drawing, or two arms with live panels. The user guide covers the API, control panel, broker, and wire protocol.

License

MIT.

Maintained by Tal Eylon, taleylon1@gmail.com.

Metadata

Release files for pydobotlab 0.2.1

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

Source distribution (sdist)

Source distribution for pydobotlab 0.2.1
File Size Uploaded
pydobotlab-0.2.1.tar.gz 161.2 kB Details

Built distribution (wheel)

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

Total release size: 241.2 kB

Release files / pydobotlab-0.2.1.tar.gz

Download URL pydobotlab-0.2.1.tar.gz
Size 161.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b36a0cfd1882e1de58c196078f8d080dc078c095907d3f9bebaa6bf044a554e
BLAKE2b-256 checksum
How to use checksums
3cf8d7e938168551e6b753dbcecaaef20e4f90a06d3621422b32c3d50ead6c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / pydobotlab-0.2.1-py3-none-any.whl

Download URL pydobotlab-0.2.1-py3-none-any.whl
Size 80.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c2372e0de802464ae66c2f79831306502a0e90fb1c5dfc8d3fb1ec30f8a58b2
BLAKE2b-256 checksum
How to use checksums
f900de0b1777990886fdb8f9411240597160cf3254819556c13d8265f79fe2b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2

2 release files

0.1.0

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