Python interface to Duet REST API
Project description
DuetWebAPI
Python interface to Duet RepRap V3 firmware via Http REST API.
- Works over IP network.
- Does not support passwords on the printer.
- Supported boards:
- Duet 3 + SBC
- Duet 3 standalone
- Duet 2 standalone
Install
pip install duetwebapi
Alternatively:
pip install -e "git+https://github.com/AndyEveritt/DuetWebAPI.git@master#egg=duetwebapi"
Usage
- See 'examples.py' for examples.
from duetwebapi import DuetWebAPI
printer = DuetWebAPI(f'http://{printer_hostname})
REST API
The REST API allows for the following operations:
Method | Description |
---|---|
get_model(key: str = None) -> Dict |
Get Duet object model. RRF3 only |
send_code(code: str) -> Dict |
Send G/M/T-code to Duet |
get_file(filename: str, directory: str = 'gcodes') -> str |
Download file from Duet |
upload_file(file: str, directory: str = 'gcodes') -> Dict |
Upload file to Duet |
get_fileinfo(filename: str = None, directory: str = 'gcodes') -> Dict |
Get file info |
delete_file(filename: str, directory: str = 'gcodes') -> Dict |
Delete file on Duet |
move_file(from_path: str, to_path: str, force: bool = False) -> Dict |
Move file on Duet, can be used to rename files |
get_directory(directory: str) -> List[Dict] |
Get a list of all the files & directories in a directory |
create_directory(directory: str) -> Dict |
Create a new directory |
Wrapper
An additional wrapper is provided to make repetative tasks easier
Method | Description |
---|---|
get_coords() |
return the current position of all the movement axes |
get_layer() |
return the current layer number of the print |
get_num_extruders() |
return the number of extruders currently configured |
get_num_tools() |
return the number of tools currently configured |
get_status() |
return the current Duet status |
get_temperature() |
return a list of all the analog sensors and their value |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
duetwebapi-1.1.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for duetwebapi-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c32f98064c679d45f7a561dc20f4b2f24d85e06e6fe0ea153b029689a642e416 |
|
MD5 | de7361ce38688604b97d8e30ce245d0a |
|
BLAKE2b-256 | b425f631318a151970dbf744946808b43d8ee6420fb493e535ab533fc85d203a |