flashforge-python-api 1.0.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.
- flashforge/__init__.py +188 -0
- flashforge/api/__init__.py +17 -0
- flashforge/api/constants/__init__.py +10 -0
- flashforge/api/constants/commands.py +10 -0
- flashforge/api/constants/endpoints.py +11 -0
- flashforge/api/controls/__init__.py +16 -0
- flashforge/api/controls/control.py +357 -0
- flashforge/api/controls/files.py +171 -0
- flashforge/api/controls/info.py +292 -0
- flashforge/api/controls/job_control.py +561 -0
- flashforge/api/controls/temp_control.py +89 -0
- flashforge/api/filament/__init__.py +7 -0
- flashforge/api/filament/filament.py +39 -0
- flashforge/api/misc/__init__.py +8 -0
- flashforge/api/misc/scientific_notation.py +28 -0
- flashforge/api/misc/temperature.py +42 -0
- flashforge/api/network/__init__.py +10 -0
- flashforge/api/network/fnet_code.py +15 -0
- flashforge/api/network/utils.py +55 -0
- flashforge/client.py +381 -0
- flashforge/discovery/__init__.py +12 -0
- flashforge/discovery/discovery.py +388 -0
- flashforge/models/__init__.py +50 -0
- flashforge/models/machine_info.py +247 -0
- flashforge/models/responses.py +123 -0
- flashforge/tcp/__init__.py +41 -0
- flashforge/tcp/ff_client.py +587 -0
- flashforge/tcp/gcode/__init__.py +11 -0
- flashforge/tcp/gcode/gcode_controller.py +296 -0
- flashforge/tcp/gcode/gcodes.py +93 -0
- flashforge/tcp/parsers/__init__.py +27 -0
- flashforge/tcp/parsers/endstop_status.py +273 -0
- flashforge/tcp/parsers/location_info.py +68 -0
- flashforge/tcp/parsers/print_status.py +182 -0
- flashforge/tcp/parsers/printer_info.py +154 -0
- flashforge/tcp/parsers/temp_info.py +217 -0
- flashforge/tcp/parsers/thumbnail_info.py +242 -0
- flashforge/tcp/tcp_client.py +448 -0
- flashforge_python_api-1.0.0.dist-info/METADATA +123 -0
- flashforge_python_api-1.0.0.dist-info/RECORD +43 -0
- flashforge_python_api-1.0.0.dist-info/WHEEL +4 -0
- flashforge_python_api-1.0.0.dist-info/entry_points.txt +2 -0
- flashforge_python_api-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flashforge-python-api
|
|
3
|
+
Version: 1.0.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.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
|
+
# 🖨️ FlashForge Python API
|
|
51
|
+
|
|
52
|
+
A comprehensive Python library for controlling FlashForge 3D printers.
|
|
53
|
+
|
|
54
|
+
## ✨ Features
|
|
55
|
+
|
|
56
|
+
- **🎮 Full Printer Control**: Movement, temperature, speed, LED, filtration, camera control
|
|
57
|
+
- **📋 Job Management**: Start, pause, resume, cancel prints, file upload and management
|
|
58
|
+
- **📊 Real-time Monitoring**: Live status, temperature, progress, and machine state tracking
|
|
59
|
+
- **🔍 Network Discovery**: Automatic printer discovery via UDP broadcast
|
|
60
|
+
- **🔄 Dual Communication**: HTTP API (modern) + TCP G-code (legacy) support
|
|
61
|
+
- **🛡️ Type Safety**: Full type hints and Pydantic models for robust development
|
|
62
|
+
- **⚡ Async Support**: Native async/await support for all operations
|
|
63
|
+
- **🖼️ Advanced Features**: Thumbnail extraction, endstop monitoring, print progress tracking
|
|
64
|
+
|
|
65
|
+
## 🚀 Quick Start
|
|
66
|
+
> 💡 The "new" HTTP API requires LAN-mode, and a check code for authentication. [This](https://www.youtube.com/watch?v=krdEGccZuKo) video shows how to set up LAN-mode, and get the code.
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from flashforge import FlashForgeClient, FlashForgePrinterDiscovery
|
|
70
|
+
|
|
71
|
+
# Find printers on the network
|
|
72
|
+
discovery = FlashForgePrinterDiscovery()
|
|
73
|
+
printers = await discovery.discover_printers_async()
|
|
74
|
+
|
|
75
|
+
# Connect to your printer
|
|
76
|
+
client = FlashForgeClient(
|
|
77
|
+
host="192.168.1.100", # Your printer's IP
|
|
78
|
+
serial="ABCD1234", # Your printer's serial
|
|
79
|
+
check_code="12345678" # Your printer's check code
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Basic operations
|
|
83
|
+
await client.info.get_machine_status() # Get printer status
|
|
84
|
+
await client.temp_control.set_bed_temp(60) # Set bed temperature
|
|
85
|
+
await client.control.home_xyz() # Home all axes
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 📦 Installation & Setup
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Clone the repository
|
|
92
|
+
git clone https://github.com/your-username/flashforge-python-api.git
|
|
93
|
+
cd flashforge-python-api
|
|
94
|
+
|
|
95
|
+
# Setup & Install
|
|
96
|
+
uv sync # Install core dependencies
|
|
97
|
+
uv sync --all-extras # Install with all optional dependencies
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 🔧 Requirements
|
|
101
|
+
|
|
102
|
+
- **🐍 Python**: 3.8+ (recommended: 3.11+)
|
|
103
|
+
- **🖨️ Printer**: FlashForge with network connectivity
|
|
104
|
+
- **🌐 Network**: Printer and computer on same network for discovery
|
|
105
|
+
- **🔑 Credentials**: Printer serial number and check code
|
|
106
|
+
|
|
107
|
+
## 🎯 Supported Models
|
|
108
|
+
|
|
109
|
+
**✅ Tested with:**
|
|
110
|
+
- FlashForge Adventurer 5M Series
|
|
111
|
+
- FlashForge Adventurer 4
|
|
112
|
+
|
|
113
|
+
**💫 Should work with:**
|
|
114
|
+
- FlashForge printers with network connectivity
|
|
115
|
+
- Printers supporting HTTP API (new) and/or TCP G-code (legacy)
|
|
116
|
+
|
|
117
|
+
> 💡 **Note**: Some features (camera control, filtration) are model-specific and will be automatically detected.
|
|
118
|
+
|
|
119
|
+
## 🌟 Related Projects
|
|
120
|
+
- **💻 C# API (Windows)**: [ff-5mp-api](https://github.com/GhostTypes/ff-5mp-api)
|
|
121
|
+
- **🌐 TypeScript API (Cross-Platform)**: [ff-5mp-api-ts](https://github.com/GhostTypes/ff-5mp-api-ts)
|
|
122
|
+
- **🎨 FlashForgeUI (Electron, Cross-Platform)**: [FlashForgeUI-Electron](https://github.com/Parallel-7/FlashForgeUI-Electron)
|
|
123
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
flashforge/__init__.py,sha256=YwiGqt8E6Q5s3_iWxT0skY-468iQwKi2bRmj9pmdDhE,4302
|
|
2
|
+
flashforge/client.py,sha256=4Rl6U30zH-p4R1hTTN3KLejbb-Dm7VTgKqLTtMR99vY,12773
|
|
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=1-W4qmCvy80Z_IJAOFB25vHht0sQ-rGVONIKdGitQNc,6824
|
|
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=1Vry0BKHRR4T9_Eo-FudeHUQwt--qpUvegi4NDIobOw,12102
|
|
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.0.dist-info/METADATA,sha256=CpxLhCrr-UC1IChGYUWbENnLzxUnLe56aS3kXoRoskE,5083
|
|
40
|
+
flashforge_python_api-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
41
|
+
flashforge_python_api-1.0.0.dist-info/entry_points.txt,sha256=AkOxlsLvQ7cvMLxn7tlzfKp_DCH2hXhbVceHIXxawpU,66
|
|
42
|
+
flashforge_python_api-1.0.0.dist-info/licenses/LICENSE,sha256=lW2RvsgnKpSECUO1251Wj_EMkdmuA6Vlxea-eje7wuM,1088
|
|
43
|
+
flashforge_python_api-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +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.
|