FlashForge Python API
Python library for controlling FlashForge 3D printers with async support for the modern HTTP API and the legacy TCP protocol.
Supported Printers
| Printer | Support |
|---|---|
| Adventurer 5M | Full |
| Adventurer 5M Pro | Full |
| AD5X | Full |
| Creator 5 | Full (HTTP-only) |
| Creator 5 Pro | Full (HTTP-only) |
| Adventurer 3 / 4 | Dedicated TCP clients |
Installation
pip install flashforge-python-api
Quick Start
Modern LAN-mode HTTP printers require:
- printer IP address
- serial number
- check code (per-printer credential, not returned by discovery)
import asyncio
import os
from flashforge import FlashForgeClient, FiveMClientConnectionOptions, PrinterDiscovery
async def main():
check_code = os.getenv("FLASHFORGE_CHECK_CODE", "").strip()
if not check_code:
print("Set FLASHFORGE_CHECK_CODE before running this example")
return
discovery = PrinterDiscovery()
printers = await discovery.discover()
if not printers:
print("No printers found")
return
printer = printers[0]
if not printer.serial_number:
print("Discovered printer did not report a serial number")
return
options = FiveMClientConnectionOptions(
http_port=printer.event_port,
tcp_port=printer.command_port,
)
async with FlashForgeClient(
printer.ip_address,
printer.serial_number,
check_code,
options=options,
) as client:
status = await client.get_printer_status()
if not status:
return
await client.init_control()
status = await client.get_printer_status()
print(f"Printer: {client.printer_name}")
print(f"State: {status.machine_state if status else 'unknown'}")
await client.control.home_axes()
asyncio.run(main())
Main Entry Points
FlashForgeClient: primary client for modern printersPrinterDiscovery: recommended discovery APIFlashForgeA4Client: documented TCP client for Adventurer 4 Lite / Pro printersFlashForgeA3Client: documented TCP client for Adventurer 3 printersFlashForgeTcpClientandclient.tcp_client: lower-level TCP access for direct commands and generic legacy workflows
Capabilities
- printer discovery
- printer status and machine information
- job control
- file listing, uploads, and thumbnails
- temperature and motion control, including per-nozzle and chamber temperature control (Creator 5)
- LED, camera, and filtration control where supported
- AD5X and Creator 5 / Creator 5 Pro material-station, slot configuration, and material mapping
Documentation
Metadata
Release files for flashforge-python-api 1.5.0
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 | |
|---|---|---|---|---|
| flashforge_python_api-1.5.0.tar.gz | 1.7 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flashforge_python_api-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.8 MB
Release files / flashforge_python_api-1.5.0.tar.gz
| Download URL | flashforge_python_api-1.5.0.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e525b7fa49a171cab3e782f5961a3c5710384b2c2a7f20e7f6a620fd5f59fa5a
|
|
BLAKE2b-256 checksum How to use checksums |
96932aa4d4744d0d6b3a1b59b68c73e2ad37fc5d5512f8e3c681187596b8326f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / flashforge_python_api-1.5.0-py3-none-any.whl
| Download URL | flashforge_python_api-1.5.0-py3-none-any.whl |
|---|---|
| Size | 100.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05d7970218b2ef37bc26da3829117f6353cded9c446bfebe3f3e5b9e44c7f82c
|
|
BLAKE2b-256 checksum How to use checksums |
c6406a1ae40d3661b300744e5933c66bfd61fccc785abde2a45d2707e350fd11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for flashforge-python-api 1.5.0
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.