Skip to main content

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 printers
  • PrinterDiscovery: recommended discovery API
  • FlashForgeA4Client: documented TCP client for Adventurer 4 Lite / Pro printers
  • FlashForgeA3Client: documented TCP client for Adventurer 3 printers
  • FlashForgeTcpClient and client.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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flashforge_python_api-1.4.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flashforge_python_api-1.4.0-py3-none-any.whl (99.4 kB view details)

Uploaded Python 3

File details

Details for the file flashforge_python_api-1.4.0.tar.gz.

File metadata

  • Download URL: flashforge_python_api-1.4.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for flashforge_python_api-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f1cce3c83a2827d3825a39d413d4ef61d02edab0eedaad12e52efde3fa9145f8
MD5 684fe334fed8051c80ece548b9669225
BLAKE2b-256 4e4ceb0933b4a55acd7ef71b05cc264f73d4a2998c975d4221914ec63c085bf1

See more details on using hashes here.

File details

Details for the file flashforge_python_api-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flashforge_python_api-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc6017d7f8498a9da8c3db97cea08fbb3d4c7977b68fc2f9c745eca709b2398
MD5 ab8ea0d3ef7bf27c3e6aa96d488bfb60
BLAKE2b-256 8c186255d94203b3415bd1d946e9dcca2b90c334bdac637a8802b6c9367c55ca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page