flashforge-python-api 1.0.1__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. flashforge/__init__.py +62 -29
  2. flashforge/api/__init__.py +1 -0
  3. flashforge/api/constants/__init__.py +1 -0
  4. flashforge/api/constants/commands.py +1 -0
  5. flashforge/api/constants/endpoints.py +1 -0
  6. flashforge/api/controls/__init__.py +1 -0
  7. flashforge/api/controls/control.py +64 -61
  8. flashforge/api/controls/files.py +28 -26
  9. flashforge/api/controls/info.py +84 -85
  10. flashforge/api/controls/job_control.py +120 -82
  11. flashforge/api/controls/temp_control.py +14 -11
  12. flashforge/api/misc/__init__.py +1 -1
  13. flashforge/api/network/__init__.py +2 -1
  14. flashforge/api/network/utils.py +7 -8
  15. flashforge/client.py +131 -63
  16. flashforge/discovery/__init__.py +30 -3
  17. flashforge/discovery/discovery.py +637 -308
  18. flashforge/models/__init__.py +11 -10
  19. flashforge/models/machine_info.py +220 -100
  20. flashforge/models/responses.py +103 -43
  21. flashforge/tcp/__init__.py +25 -17
  22. flashforge/tcp/a3_client.py +405 -0
  23. flashforge/tcp/ff_client.py +93 -90
  24. flashforge/tcp/gcode/__init__.py +4 -2
  25. flashforge/tcp/gcode/a3_gcode_controller.py +109 -0
  26. flashforge/tcp/gcode/gcode_controller.py +48 -36
  27. flashforge/tcp/gcode/gcodes.py +7 -1
  28. flashforge/tcp/parsers/__init__.py +11 -11
  29. flashforge/tcp/parsers/endstop_status.py +103 -132
  30. flashforge/tcp/parsers/location_info.py +26 -13
  31. flashforge/tcp/parsers/print_status.py +49 -56
  32. flashforge/tcp/parsers/printer_info.py +38 -48
  33. flashforge/tcp/parsers/temp_info.py +46 -47
  34. flashforge/tcp/parsers/thumbnail_info.py +65 -40
  35. flashforge/tcp/tcp_client.py +296 -293
  36. flashforge_python_api-1.1.0.dist-info/METADATA +305 -0
  37. flashforge_python_api-1.1.0.dist-info/RECORD +45 -0
  38. {flashforge_python_api-1.0.1.dist-info → flashforge_python_api-1.1.0.dist-info}/WHEEL +1 -1
  39. {flashforge_python_api-1.0.1.dist-info → flashforge_python_api-1.1.0.dist-info}/licenses/LICENSE +21 -21
  40. flashforge_python_api-1.0.1.dist-info/METADATA +0 -211
  41. flashforge_python_api-1.0.1.dist-info/RECORD +0 -43
  42. {flashforge_python_api-1.0.1.dist-info → flashforge_python_api-1.1.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,305 @@
1
+ Metadata-Version: 2.4
2
+ Name: flashforge-python-api
3
+ Version: 1.1.0
4
+ Summary: A comprehensive Python library for controlling FlashForge 3D printers
5
+ Project-URL: Homepage, https://github.com/GhostTypes/ff-5mp-api-py
6
+ Project-URL: Documentation, https://github.com/GhostTypes/ff-5mp-api-py#readme
7
+ Project-URL: Repository, https://github.com/GhostTypes/ff-5mp-api-py.git
8
+ Project-URL: Issues, https://github.com/GhostTypes/ff-5mp-api-py/issues
9
+ Author-email: GhostTypes <notghosttypes@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: 3d-printer,api,async,control,flashforge,python
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: aiohttp>=3.8.0
24
+ Requires-Dist: netifaces>=0.11.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Requires-Dist: requests>=2.31.0
27
+ Provides-Extra: all
28
+ Requires-Dist: black>=23.0.0; extra == 'all'
29
+ Requires-Dist: mypy>=1.0.0; extra == 'all'
30
+ Requires-Dist: pillow>=10.0.0; extra == 'all'
31
+ Requires-Dist: pre-commit>=3.0.0; extra == 'all'
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
33
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'all'
34
+ Requires-Dist: pytest>=7.0.0; extra == 'all'
35
+ Requires-Dist: ruff>=0.1.0; extra == 'all'
36
+ Provides-Extra: dev
37
+ Requires-Dist: black>=23.0.0; extra == 'dev'
38
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
39
+ Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
40
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
41
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
42
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
43
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
44
+ Provides-Extra: imaging
45
+ Requires-Dist: pillow>=10.0.0; extra == 'imaging'
46
+ Description-Content-Type: text/markdown
47
+
48
+ <div align="center">
49
+
50
+ # FlashForge Python API
51
+
52
+ **A comprehensive Python library for controlling FlashForge 3D printers**
53
+
54
+ ![PyPI](https://img.shields.io/pypi/v/flashforge-python-api?style=flat&color=3776ab) ![Python](https://img.shields.io/badge/Python-3.11%2B-3776ab?style=flat) ![License](https://img.shields.io/badge/License-MIT-brightgreen?style=flat) ![Status](https://img.shields.io/badge/Status-Stable-brightgreen?style=flat)
55
+
56
+ ![aiohttp](https://img.shields.io/badge/aiohttp-%E2%89%A53.8.0-blue?style=flat) ![pydantic](https://img.shields.io/badge/pydantic-%E2%89%A52.0.0-e92063?style=flat) ![netifaces](https://img.shields.io/badge/netifaces-%E2%89%A50.11.0-orange?style=flat) ![requests](https://img.shields.io/badge/requests-%E2%89%A52.31.0-blue?style=flat) ![pillow](https://img.shields.io/badge/pillow-%E2%89%A510.0.0-yellow?style=flat)
57
+
58
+ **Dual-protocol support with modern async/await architecture for seamless printer control and monitoring**
59
+
60
+ </div>
61
+
62
+ ---
63
+
64
+ <div align="center">
65
+
66
+ ## Features
67
+
68
+ | Capability | Details |
69
+ | --- | --- |
70
+ | **Dual Protocol Support** | Modern HTTP REST API for Adventurer 5M/5X series • Legacy TCP G-code protocol for all networked FlashForge printers |
71
+ | **Printer Discovery** | Automatic UDP broadcast discovery • Returns printer name, serial number, and IP address |
72
+ | **Full Control** | Movement and homing • Temperature control • Fan speed adjustment • LED lighting • Camera control • Air filtration system |
73
+ | **Real-time Monitoring** | Printer status and machine state • Current and target temperatures • Print progress and layer tracking • Estimated time remaining |
74
+ | **Job Management** | Start, pause, resume, and cancel print jobs • Progress monitoring |
75
+ | **File Operations** | List, upload, and download files • Extract print thumbnails • File metadata retrieval |
76
+ | **Async Architecture** | Native async/await implementation • Non-blocking network operations • Concurrent operations support |
77
+ | **Type Safety** | Full type hints for IDE autocomplete • Pydantic models for data validation • mypy strict mode compatible |
78
+ | **Model Detection** | Automatic capability detection • Runtime camera stream detection via `camera_stream_url` • Graceful degradation for older models |
79
+
80
+ </div>
81
+
82
+ ---
83
+
84
+ <div align="center">
85
+
86
+ ## Printer Testing & Coverage
87
+
88
+ | Printer Model | Support Status | Testing Status | API Type |
89
+ | --- | --- | --- | --- |
90
+ | **AD5X** | Full | Tested | HTTP (New) + TCP |
91
+ | **Adventurer 5M/Pro** | Full | Tested | HTTP (New) + TCP |
92
+ | **Adventurer 3/4** | Partial | Partial | TCP (Legacy) |
93
+
94
+ </div>
95
+
96
+ ---
97
+
98
+ <div align="center">
99
+
100
+ ## Installation
101
+
102
+ | Method | Command |
103
+ | --- | --- |
104
+ | **PyPI (Recommended)** | `pip install flashforge-python-api` |
105
+ | **Development Install** | `pip install -e ".[dev]"` |
106
+ | **With Imaging Support** | `pip install flashforge-python-api[imaging]` |
107
+ | **All Optional Dependencies** | `pip install flashforge-python-api[all]` |
108
+
109
+ </div>
110
+
111
+ ---
112
+
113
+ ## Quick Start
114
+
115
+ <div align="center">
116
+
117
+ **Important: LAN-Only Mode Required**
118
+
119
+ Your printer must be in **LAN-only mode** to communicate with this library. See the [official FlashForge guide](https://wiki.flashforge.com/en/Orca-Flashforge-and-Flashmaker/orca-flashforge-quick-start-guide#connect-via-lan-only-mode) for setup instructions and to obtain your check code.
120
+
121
+ </div>
122
+
123
+ ### Printer Discovery
124
+
125
+ Discover FlashForge printers on your local network automatically:
126
+
127
+ ```python
128
+ from flashforge import FlashForgePrinterDiscovery
129
+ import asyncio
130
+
131
+ async def discover():
132
+ discovery = FlashForgePrinterDiscovery()
133
+ printers = await discovery.discover_printers_async()
134
+
135
+ for printer in printers:
136
+ print(f"Found: {printer.name} at {printer.ip_address}")
137
+ print(f"Serial: {printer.serial_number}")
138
+
139
+ asyncio.run(discover())
140
+ ```
141
+
142
+ ### Basic Printer Control
143
+
144
+ Connect to a printer and perform basic operations:
145
+
146
+ ```python
147
+ from flashforge import FlashForgeClient
148
+ import asyncio
149
+
150
+ async def control_printer():
151
+ # Initialize client with printer credentials
152
+ client = FlashForgeClient("192.168.1.100", "SERIAL_NUMBER", "CHECK_CODE")
153
+
154
+ # Always initialize before operations
155
+ if await client.initialize():
156
+ print(f"Connected to {client.printer_name}")
157
+ print(f"Firmware: {client.firmware_version}")
158
+
159
+ # Set temperatures
160
+ await client.temp_control.set_bed_temp(60)
161
+ await client.temp_control.set_extruder_temp(220)
162
+
163
+ # Home all axes
164
+ await client.control.home_xyz()
165
+
166
+ # Turn on LED lights (AD5M/5X only)
167
+ if client.is_ad5x:
168
+ await client.control.set_led_on()
169
+
170
+ # Clean up
171
+ await client.dispose()
172
+
173
+ asyncio.run(control_printer())
174
+ ```
175
+
176
+ ### Real-time Status Monitoring
177
+
178
+ Monitor printer status, temperatures, and print progress:
179
+
180
+ ```python
181
+ from flashforge import FlashForgeClient
182
+ import asyncio
183
+
184
+ async def monitor_printer():
185
+ async with FlashForgeClient("192.168.1.100", "SERIAL", "CODE") as client:
186
+ # Get comprehensive status via HTTP
187
+ status = await client.get_printer_status()
188
+ print(f"State: {status.machine_state}")
189
+ print(f"Progress: {status.print_progress}%")
190
+
191
+ # Get real-time temperatures via TCP
192
+ temps = await client.tcp_client.get_temp_info()
193
+ if temps:
194
+ bed = temps.get_bed_temp()
195
+ extruder = temps.get_extruder_temp()
196
+ print(f"Bed: {bed.get_current()}°C / {bed.get_target()}°C")
197
+ print(f"Extruder: {extruder.get_current()}°C / {extruder.get_target()}°C")
198
+
199
+ # Check print progress via TCP
200
+ layer_p, sd_p, current_layer = await client.tcp_client.get_print_progress()
201
+ print(f"Layer Progress: {layer_p}% (Layer {current_layer})")
202
+
203
+ asyncio.run(monitor_printer())
204
+ ```
205
+
206
+ ### Camera Stream Detection
207
+
208
+ Use the printer-reported runtime camera stream URL as the OEM camera source of truth:
209
+
210
+ ```python
211
+ from flashforge import FlashForgeClient
212
+ import asyncio
213
+
214
+ async def check_camera():
215
+ async with FlashForgeClient("192.168.1.100", "SERIAL", "CODE") as client:
216
+ if not await client.initialize():
217
+ return
218
+
219
+ if client.camera_stream_url:
220
+ print(f"OEM camera stream: {client.camera_stream_url}")
221
+ else:
222
+ print("Printer is not reporting an active OEM camera stream")
223
+
224
+ # Camera power control remains Pro-only.
225
+ if client.is_pro:
226
+ await client.control.turn_camera_on()
227
+
228
+ asyncio.run(check_camera())
229
+ ```
230
+
231
+ ### File Operations and Thumbnails
232
+
233
+ List files and extract G-code thumbnails:
234
+
235
+ ```python
236
+ from flashforge import FlashForgeClient
237
+ import asyncio
238
+
239
+ async def file_operations():
240
+ async with FlashForgeClient("192.168.1.100", "SERIAL", "CODE") as client:
241
+ # List all files on printer
242
+ files = await client.files.get_file_list()
243
+ print(f"Found {len(files)} files")
244
+
245
+ for filename in files:
246
+ print(f"\nFile: {filename}")
247
+
248
+ # Extract thumbnail image
249
+ thumb = await client.tcp_client.get_thumbnail(filename)
250
+ if thumb and thumb.has_image_data():
251
+ print(f"Thumbnail: {len(thumb.get_image_bytes())} bytes")
252
+
253
+ # Save thumbnail to disk
254
+ thumb.save_to_file_sync(f"{filename}.png")
255
+ print(f"Saved thumbnail as {filename}.png")
256
+
257
+ asyncio.run(file_operations())
258
+ ```
259
+
260
+ ---
261
+
262
+ <div align="center">
263
+
264
+ ## Documentation
265
+
266
+ | Resource | Description |
267
+ | --- | --- |
268
+ | **[Client API Reference](docs/client.md)** | Complete API reference for `FlashForgeClient` and all control modules |
269
+ | **[Data Models](docs/models.md)** | Pydantic model documentation for status objects and responses |
270
+ | **[Protocols (HTTP/TCP)](docs/protocols.md)** | Understanding the dual-protocol architecture and when to use each |
271
+ | **[Advanced Usage](docs/advanced.md)** | Async patterns, error handling, concurrent operations, and best practices |
272
+ | **[Complete API Reference](docs/api_reference.md)** | Full class hierarchy and method listing |
273
+
274
+ </div>
275
+
276
+ ---
277
+
278
+ <div align="center">
279
+
280
+ ## Development
281
+
282
+ | Task | Command | Description |
283
+ | --- | --- | --- |
284
+ | **Setup Environment** | `python -m venv .venv && .venv\Scripts\activate` | Create and activate virtual environment |
285
+ | **Install Dependencies** | `pip install -e ".[dev]"` | Install package with development tools |
286
+ | **Run Tests** | `pytest` | Execute test suite |
287
+ | **Type Check** | `mypy flashforge/` | Run strict type checking with mypy |
288
+ | **Format Code** | `black flashforge/ tests/` | Format code with Black (line length: 100) |
289
+ | **Lint** | `ruff check flashforge/ tests/` | Lint code with Ruff |
290
+ | **Coverage Report** | `pytest --cov=flashforge --cov-report=html` | Generate test coverage report |
291
+ | **Build Package** | `python -m build` | Build distribution packages |
292
+ | **Run Pre-commit** | `pre-commit run --all-files` | Execute all pre-commit hooks |
293
+
294
+ </div>
295
+
296
+ ---
297
+
298
+ <div align="center">
299
+
300
+ ## License
301
+
302
+ **MIT License** - See [LICENSE](LICENSE) for details
303
+
304
+ </div>
305
+
@@ -0,0 +1,45 @@
1
+ flashforge/__init__.py,sha256=k67UUBpSPMCRlexqn43RRHIh8XyNb9Bq5yXOpwChsFo,5170
2
+ flashforge/client.py,sha256=XP_l5FsaUXKWjkRMWxbz7F1d7_8Xdh7oD5zpThtBFhM,15462
3
+ flashforge/api/__init__.py,sha256=vQz-DkG6LTH39bI4fyiUc0D9jQzemLh45pORLptSOlg,335
4
+ flashforge/api/constants/__init__.py,sha256=Q0HL2tqSBYPd4Oz49VHLS3qUvRuv__GCvTGecaLrQ-Y,163
5
+ flashforge/api/constants/commands.py,sha256=S9cBgU3pBXQm-dp3Bv4795NL059pmTY1NtxWzPA5gWU,329
6
+ flashforge/api/constants/endpoints.py,sha256=3CSCvilBJ1uAM_dZiY5NgbYl4rub1RsZZRpCBRZCqH4,271
7
+ flashforge/api/controls/__init__.py,sha256=53s-H25Pjwr0kvPk8MZ2Twy8VHGqGcO6Q6uBphhEOh4,293
8
+ flashforge/api/controls/control.py,sha256=hifFWRPs2fRvNaJMSLgDJ4ytkHrEMGqzgCazuAC6ewA,11787
9
+ flashforge/api/controls/files.py,sha256=fFjxOCVbK7q1P4GM9RcgB2tsJsywT_HiTBcL3-U0_Yo,7749
10
+ flashforge/api/controls/info.py,sha256=r_gi20ZlgpdtCJVqtoyncV714-MQcDjg4Qg4xeTWHNA,12969
11
+ flashforge/api/controls/job_control.py,sha256=uhuQE3weXJPvWBER0P7lvqWEzAVHXFNXWWBFfnZwtR8,23656
12
+ flashforge/api/controls/temp_control.py,sha256=TGkX63WHygVA9DeYfLARbktZ0o-bYX6MNyYOX6V_RB4,3034
13
+ flashforge/api/filament/__init__.py,sha256=isT2dl0hzUS0xMTXMm4Tip0GTG1gCsm8LKWa9xPu4Y8,104
14
+ flashforge/api/filament/filament.py,sha256=TtcC2G2nD9Sq4cOrCZzFLZ6Q0Ve-zfrfuEF9uQ8M3eE,1214
15
+ flashforge/api/misc/__init__.py,sha256=1AG7vOMRBZQtHp6QUzfr9alcJPeNv3JpU44NrznxDHs,211
16
+ flashforge/api/misc/scientific_notation.py,sha256=KSMTrrYhPWLv0gbcEAD6u-jEOcIwUjOCOPMBi0LiO-k,826
17
+ flashforge/api/misc/temperature.py,sha256=qeHlCdPzLyqGDEB874Ib5AgYHMR9Qtw61shnw4G095E,1066
18
+ flashforge/api/network/__init__.py,sha256=G5fBoAlq-NQPDkWp579mFIqsj0v7B1Lb2TAzO6IZA0Q,164
19
+ flashforge/api/network/fnet_code.py,sha256=BR2niVKKk4ZfXtizUDIMXzDhlCxPHzqWg5AQQIcoj3g,402
20
+ flashforge/api/network/utils.py,sha256=jwqyJaByr4q80_MJOTwS0nX8I8FZ54T_CHBwkKTXptA,1519
21
+ flashforge/discovery/__init__.py,sha256=G0WiP70EhfHdjXR1RNlv6xjhyHOdo-HWyOm9J0ds4SM,828
22
+ flashforge/discovery/discovery.py,sha256=qlyLxITY9JMKY_quONdWeZ5sbsF_pXfqRXqk7DwDGfs,26042
23
+ flashforge/models/__init__.py,sha256=MNpnXdS6Yah5kSwBB7cbA2Hd-8azffE62pgUrrKSZk4,984
24
+ flashforge/models/machine_info.py,sha256=tMec0qSq9iTVfUvLl72vL5jlDrBW2mn132dzL8842mA,14602
25
+ flashforge/models/responses.py,sha256=befMeXAc7XXiK7emF8Ep2cd1GuhZ-zyYPbbPqS2lcQI,7214
26
+ flashforge/tcp/__init__.py,sha256=g0xAZf0ZDKnH2g79tK5FeAATRo90GfDB7Lkws1LsZxU,1145
27
+ flashforge/tcp/a3_client.py,sha256=n7Kw0Dn9MYjjj0r2GPEiQFBKZfzuE9lboziuRt2bKgM,15411
28
+ flashforge/tcp/ff_client.py,sha256=CJXk0Qei2FVSpbXxZhiEQgAEcTJaBab1ouooqyC4OL4,20235
29
+ flashforge/tcp/tcp_client.py,sha256=KjymxUXiXgEp9y7mjr5tNO_Y2-bsGEyP-oG5en7rCCs,16996
30
+ flashforge/tcp/gcode/__init__.py,sha256=tFGlqCPFxVJNizXsIG4pMOK7IPFNnc_vIEMciULYkMY,271
31
+ flashforge/tcp/gcode/a3_gcode_controller.py,sha256=x84_xo_Ll5k6hMAwDWuNUo54znV-BBIfwnmeOiEa9Fs,3688
32
+ flashforge/tcp/gcode/gcode_controller.py,sha256=6K1VGgX59AcE_Kh_gm13dmxCY_kuzV_d2ooSpheONRI,10075
33
+ flashforge/tcp/gcode/gcodes.py,sha256=55Ii1JpJNJNmOnBivyF83vz3TZUPDtp01lX72NINfPQ,3658
34
+ flashforge/tcp/parsers/__init__.py,sha256=kDaJmiH0JcR5i693Fj3pwmINLWN0ipirN3LWGFvPst0,730
35
+ flashforge/tcp/parsers/endstop_status.py,sha256=4jTtodJiiAVeeU8Z5daFtETm8ExPGo5P1CQWZ9KYrfg,9815
36
+ flashforge/tcp/parsers/location_info.py,sha256=n1lUUmbk4kuuuBUbIA65dlPa4tsVGUJFlwnoeRW0yx8,2865
37
+ flashforge/tcp/parsers/print_status.py,sha256=4q9ZlJfO0c7_t1o15tgxbguMxpDjEW9pMyaFU6a0Nfk,6164
38
+ flashforge/tcp/parsers/printer_info.py,sha256=QY6LECfcOhVHSIdsvQZwJago0OjXroUwiX0H-uQaH2A,5411
39
+ flashforge/tcp/parsers/temp_info.py,sha256=9Waf68tt-4QBcChyUwfMHDwWdIzM4mmDpZAKeAzklgs,7908
40
+ flashforge/tcp/parsers/thumbnail_info.py,sha256=ZmxdEbVFOzqR1AfhXXZyjENVI66BdRdE7Q8LQ8an9FY,10201
41
+ flashforge_python_api-1.1.0.dist-info/METADATA,sha256=H9Lv3ThMilNw6H-BMtsi2-vdsL0u6f4u7QtGkh-6vlQ,11038
42
+ flashforge_python_api-1.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
43
+ flashforge_python_api-1.1.0.dist-info/entry_points.txt,sha256=AkOxlsLvQ7cvMLxn7tlzfKp_DCH2hXhbVceHIXxawpU,66
44
+ flashforge_python_api-1.1.0.dist-info/licenses/LICENSE,sha256=-cTA-hrmvlb3pqlQrBZQXUnKayhUjsLJMPb7TD91frM,1067
45
+ flashforge_python_api-1.1.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.28.0
2
+ Generator: hatchling 1.29.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 GhostTypes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 GhostTypes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,211 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: flashforge-python-api
3
- Version: 1.0.1
4
- Summary: A comprehensive Python library for controlling FlashForge 3D printers
5
- Project-URL: Homepage, https://github.com/GhostTypes/ff-5mp-api-py
6
- Project-URL: Documentation, https://github.com/GhostTypes/ff-5mp-api-py#readme
7
- Project-URL: Repository, https://github.com/GhostTypes/ff-5mp-api-py.git
8
- Project-URL: Issues, https://github.com/GhostTypes/ff-5mp-api-py/issues
9
- Author-email: GhostTypes <notghosttypes@gmail.com>
10
- License-Expression: MIT
11
- License-File: LICENSE
12
- Keywords: 3d-printer,api,async,control,flashforge,python
13
- Classifier: Development Status :: 5 - Production/Stable
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Topic :: Scientific/Engineering
22
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
- Classifier: Topic :: System :: Hardware :: Hardware Drivers
24
- Requires-Python: >=3.8
25
- Requires-Dist: aiohttp>=3.8.0
26
- Requires-Dist: netifaces>=0.11.0
27
- Requires-Dist: pydantic>=2.0.0
28
- Requires-Dist: requests>=2.31.0
29
- Provides-Extra: all
30
- Requires-Dist: black>=23.0.0; extra == 'all'
31
- Requires-Dist: mypy>=1.0.0; extra == 'all'
32
- Requires-Dist: pillow>=10.0.0; extra == 'all'
33
- Requires-Dist: pre-commit>=3.0.0; extra == 'all'
34
- Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
35
- Requires-Dist: pytest-cov>=4.0.0; extra == 'all'
36
- Requires-Dist: pytest>=7.0.0; extra == 'all'
37
- Requires-Dist: ruff>=0.1.0; extra == 'all'
38
- Provides-Extra: dev
39
- Requires-Dist: black>=23.0.0; extra == 'dev'
40
- Requires-Dist: mypy>=1.0.0; extra == 'dev'
41
- Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
42
- Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
43
- Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
44
- Requires-Dist: pytest>=7.0.0; extra == 'dev'
45
- Requires-Dist: ruff>=0.1.0; extra == 'dev'
46
- Provides-Extra: imaging
47
- Requires-Dist: pillow>=10.0.0; extra == 'imaging'
48
- Description-Content-Type: text/markdown
49
-
50
- <div align="center">
51
-
52
- # FlashForge Python API
53
-
54
- A comprehensive Python library for controlling FlashForge 3D printers.
55
-
56
- [![PyPI](https://img.shields.io/pypi/v/flashforge-python-api?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/flashforge-python-api/)
57
- [![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
58
- [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](LICENSE)
59
-
60
- </div>
61
-
62
- <div align="center">
63
-
64
- ## Features & Capabilities
65
-
66
- | Feature | Description |
67
- | :--- | :--- |
68
- | **Printer Discovery** | Automatic UDP broadcast discovery of printers on the network |
69
- | **Full Control** | Movement (G1), Homing (G28), Temperature (M104/M140), Fans, LED |
70
- | **Real-time Monitoring** | Live status (M119), Temperatures (M105), Print Progress (M27) |
71
- | **Job Management** | Start, Pause, Resume, Cancel, File Upload & Listing |
72
- | **Advanced Parsing** | Thumbnail extraction (M662), Endstop monitoring, Machine state |
73
- | **Dual Protocol** | Modern HTTP API + Legacy TCP G-code support |
74
- | **Async Support** | Native async/await implementation for all operations |
75
- | **Type Safety** | Full type hints and Pydantic models for robust development |
76
-
77
- <br>
78
-
79
- ## Supported Hardware
80
-
81
- | Model | Support Level | Connection Type |
82
- | :--- | :--- | :--- |
83
- | **FlashForge Adventurer 5M / 5M Pro** | Full Support | HTTP + TCP |
84
- | **FlashForge Adventurer 5X** | Full Support | HTTP + TCP |
85
- | **FlashForge Adventurer 3 / 4** | Partial Support | TCP (Legacy) |
86
- | **Other Networked FlashForge Printers** | Experimental | TCP (Generic) |
87
-
88
- <br>
89
-
90
- ## Compatible Slicers
91
-
92
- | Slicer | Compatibility | Notes |
93
- | :--- | :--- | :--- |
94
- | **OrcaSlicer** | High | Recommended for Adventurer 5M series |
95
- | **FlashPrint** | Full | Official FlashForge slicer |
96
- | **Orca-FlashForge** | High | Optimized for FlashForge printers |
97
- | **Cura / PrusaSlicer** | Basic | Requires correct G-code flavor |
98
-
99
- <br>
100
-
101
- ## Installation
102
-
103
- | Command |
104
- | :--- |
105
- | `pip install flashforge-python-api` |
106
-
107
- </div>
108
-
109
- <div align="center">
110
- <h2>Usage Examples</h2>
111
- </div>
112
-
113
- <div align="center">
114
- <h3>Printer Discovery</h3>
115
- Discover printers on your local network automatically.
116
- </div>
117
-
118
- ```python
119
- from flashforge import FlashForgePrinterDiscovery
120
- import asyncio
121
-
122
- async def discover():
123
- discovery = FlashForgePrinterDiscovery()
124
- printers = await discovery.discover_printers_async()
125
- for printer in printers:
126
- print(f"Found: {printer.name} at {printer.ip_address}")
127
-
128
- asyncio.run(discover())
129
- ```
130
-
131
- <div align="center">
132
- <h3>Basic Control</h3>
133
- Connect to a printer and perform basic operations like setting temperature and homing.
134
- </div>
135
-
136
- ```python
137
- from flashforge import FlashForgeClient
138
- import asyncio
139
-
140
- async def control_printer():
141
- # Initialize client with printer details
142
- client = FlashForgeClient("192.168.1.100", "SERIAL_NUMBER", "CHECK_CODE")
143
-
144
- if await client.initialize():
145
- print(f"Connected to {client.printer_name}")
146
-
147
- # Set bed temperature to 60°C
148
- await client.temp_control.set_bed_temp(60)
149
-
150
- # Home all axes
151
- await client.control.home_xyz()
152
-
153
- await client.dispose()
154
-
155
- asyncio.run(control_printer())
156
- ```
157
-
158
- <div align="center">
159
- <h3>Real-time Status Monitoring</h3>
160
- Monitor printer status, temperatures, and print progress.
161
- </div>
162
-
163
- ```python
164
- from flashforge import FlashForgeClient
165
- import asyncio
166
-
167
- async def monitor_printer():
168
- async with FlashForgeClient("192.168.1.100", "SERIAL", "CODE") as client:
169
- # Get comprehensive status
170
- status = await client.get_printer_status()
171
- print(f"Machine State: {status.machine_state}")
172
-
173
- # Get temperatures via TCP
174
- temps = await client.tcp_client.get_temp_info()
175
- if temps:
176
- bed = temps.get_bed_temp()
177
- extruder = temps.get_extruder_temp()
178
- print(f"Bed: {bed.get_current()}°C / {bed.get_target()}°C")
179
- print(f"Extruder: {extruder.get_current()}°C / {extruder.get_target()}°C")
180
-
181
- # Check print progress
182
- layer_p, sd_p, current_layer = await client.tcp_client.get_print_progress()
183
- print(f"Progress: {layer_p}% (Layer {current_layer})")
184
-
185
- asyncio.run(monitor_printer())
186
- ```
187
-
188
- <div align="center">
189
- <h3>File Operations & Thumbnails</h3>
190
- List files on the printer and extract thumbnails.
191
- </div>
192
-
193
- ```python
194
- from flashforge import FlashForgeClient
195
- import asyncio
196
-
197
- async def file_ops():
198
- async with FlashForgeClient("192.168.1.100", "SERIAL", "CODE") as client:
199
- # List files
200
- files = await client.files.get_file_list()
201
- for filename in files:
202
- print(f"File: {filename}")
203
-
204
- # Get thumbnail
205
- thumb = await client.tcp_client.get_thumbnail(filename)
206
- if thumb and thumb.has_image_data():
207
- print(f"Thumbnail found: {len(thumb.get_image_bytes())} bytes")
208
- # thumb.save_to_file_sync(f"{filename}.png")
209
-
210
- asyncio.run(file_ops())
211
- ```
@@ -1,43 +0,0 @@
1
- flashforge/__init__.py,sha256=YwiGqt8E6Q5s3_iWxT0skY-468iQwKi2bRmj9pmdDhE,4302
2
- flashforge/client.py,sha256=dkzIGgFQW37cstXKAAJEg4wmyuQiNdWxHbMgPHOsqxA,12805
3
- flashforge/api/__init__.py,sha256=Syz3l0UO1ryK5bMKnI_Neh1PTmlkl8iKgzZrdWhArc0,334
4
- flashforge/api/constants/__init__.py,sha256=JyFtW3DcynTD_VWzw3T7MCs6BYaf9Xkypi_WYUgqFA4,162
5
- flashforge/api/constants/commands.py,sha256=tcCyAueNYZ7CrYxVy92r9alF6f5AcapErBBgGL1Xqwk,328
6
- flashforge/api/constants/endpoints.py,sha256=aGDxZk2f_Qsfi_QeIujP8ocDux_wiBBYldaGUuyg8BA,270
7
- flashforge/api/controls/__init__.py,sha256=5nHCY3U6KJIknYY_VnPjLFQIiPmEEAA6QlkC14AjAzY,292
8
- flashforge/api/controls/control.py,sha256=4PEYVeHkJTvsIYq2ck_rJ9kGkozsSgJUPkFHvFEfJNk,12061
9
- flashforge/api/controls/files.py,sha256=ieQI3IaWPNwyxLoIP3Ea_xtg_bTmZkleSM460yhFgIk,7626
10
- flashforge/api/controls/info.py,sha256=5Vv879QL8Qxx6xFyGjIh4xjLzwcQlLdfjeNkxPxZgbw,12496
11
- flashforge/api/controls/job_control.py,sha256=iC3bmK00r4rS7fsAuRZR-RNWguJ8rl8dCDV1L1a-leM,23169
12
- flashforge/api/controls/temp_control.py,sha256=H4fdJXXrnRMQvvZhslhNAtAR78S-4Nk79OxDqOEHRM0,3108
13
- flashforge/api/filament/__init__.py,sha256=isT2dl0hzUS0xMTXMm4Tip0GTG1gCsm8LKWa9xPu4Y8,104
14
- flashforge/api/filament/filament.py,sha256=TtcC2G2nD9Sq4cOrCZzFLZ6Q0Ve-zfrfuEF9uQ8M3eE,1214
15
- flashforge/api/misc/__init__.py,sha256=IaHcsUieaMEYEFAWTyj-X6N7JRLiLiU7D58Cl-DttJs,211
16
- flashforge/api/misc/scientific_notation.py,sha256=KSMTrrYhPWLv0gbcEAD6u-jEOcIwUjOCOPMBi0LiO-k,826
17
- flashforge/api/misc/temperature.py,sha256=qeHlCdPzLyqGDEB874Ib5AgYHMR9Qtw61shnw4G095E,1066
18
- flashforge/api/network/__init__.py,sha256=BjrtwAMLGJ6_Q4LrZZM9KP1gfYXq4V8uHro_AxmUhD8,163
19
- flashforge/api/network/fnet_code.py,sha256=BR2niVKKk4ZfXtizUDIMXzDhlCxPHzqWg5AQQIcoj3g,402
20
- flashforge/api/network/utils.py,sha256=gpRU24eYtOajV-lWEjMdanjs110xG-jn2EirD5gIoWA,1607
21
- flashforge/discovery/__init__.py,sha256=1Dz3zqh5ltsv34ZhugWkoC4MKp8qbz3SWpxNkPSIlMU,277
22
- flashforge/discovery/discovery.py,sha256=fAY8EFw5u8R-wlh21_GrXHLL2KpAxkp0EQi8fNbgJbU,15172
23
- flashforge/models/__init__.py,sha256=qRV-iuENmwyeiO63cQYA6qFB-UYG36HadSMzgZabGPA,983
24
- flashforge/models/machine_info.py,sha256=Y7nfCepE6sc8slpPsFCFOGXdzxMzUA2Dtod3WHGk7TU,12108
25
- flashforge/models/responses.py,sha256=LbRiT74j31fra86xorcuUmeWtV27KCj6mysERlUJzZI,5143
26
- flashforge/tcp/__init__.py,sha256=JYbv_ATMJL1vJ1VP-KPcxdMM7V_aapDkZrCUhPaWLtQ,835
27
- flashforge/tcp/ff_client.py,sha256=58z6qzfolIOovtzW-C3GwgrOxZV67cOMC5vGjYnsZ7c,20787
28
- flashforge/tcp/tcp_client.py,sha256=GcTp_PAykH4n5NFf8uqCV5H7OfExJFPWordMtgujREU,17331
29
- flashforge/tcp/gcode/__init__.py,sha256=PhRg0RVxZoWQaB8lpHXSEsY1C5ZvJ29QIAUOi0vr5OY,195
30
- flashforge/tcp/gcode/gcode_controller.py,sha256=RKUwxDZkRxtn9TL4w8VS4A6xhi8kHwTche3YPJz-6tw,10053
31
- flashforge/tcp/gcode/gcodes.py,sha256=exPqr7EJbJYgtJ9aQNm8Ut7WfjPCx1i2fLnu7NpgG9c,3392
32
- flashforge/tcp/parsers/__init__.py,sha256=lOxmHv1ECvZ8npm_lfO8gwG23L6QlVSE0TRuOAw64bk,730
33
- flashforge/tcp/parsers/endstop_status.py,sha256=tuHgBjXv9bQzUdMGC6_DHU6RsF5-6LGzjSjUkoMJK64,10374
34
- flashforge/tcp/parsers/location_info.py,sha256=SfdW02nAB5Zlf-l7cPx4EetMFopJrz_IF5IxsjWwi1U,2445
35
- flashforge/tcp/parsers/print_status.py,sha256=75KlzAMMjvpR4hCvK0LbHKwE_7hm2jExCFeHO1v4Kgs,6536
36
- flashforge/tcp/parsers/printer_info.py,sha256=qur6zekWsTY_RsCt6Nndc1eElvJIhSXCpUfX0Z40ONQ,5443
37
- flashforge/tcp/parsers/temp_info.py,sha256=YaDNCJZvwYhqD3li1aJl-66nVrZ2_lkoQVgiA1x35_w,8276
38
- flashforge/tcp/parsers/thumbnail_info.py,sha256=hi-e3Dy8h8Vw1Uu5SVAodQKSJEhP0-z1NhnO3rOuYMo,9282
39
- flashforge_python_api-1.0.1.dist-info/METADATA,sha256=aI0TqrnzqTEM8P0eujjh2_wcXlNdFXIO3LCfr870Dso,7202
40
- flashforge_python_api-1.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
41
- flashforge_python_api-1.0.1.dist-info/entry_points.txt,sha256=AkOxlsLvQ7cvMLxn7tlzfKp_DCH2hXhbVceHIXxawpU,66
42
- flashforge_python_api-1.0.1.dist-info/licenses/LICENSE,sha256=lW2RvsgnKpSECUO1251Wj_EMkdmuA6Vlxea-eje7wuM,1088
43
- flashforge_python_api-1.0.1.dist-info/RECORD,,