flashforge-python-api 1.0.0__tar.gz
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_python_api-1.0.0/.claude/commands/push.md +50 -0
- flashforge_python_api-1.0.0/.claude/settings.local.json +14 -0
- flashforge_python_api-1.0.0/.gitignore +118 -0
- flashforge_python_api-1.0.0/CHANGELOG.md +34 -0
- flashforge_python_api-1.0.0/LICENSE +21 -0
- flashforge_python_api-1.0.0/PKG-INFO +123 -0
- flashforge_python_api-1.0.0/README.md +74 -0
- flashforge_python_api-1.0.0/ai_specs/TEST_COVERAGE_SPEC.md +1151 -0
- flashforge_python_api-1.0.0/examples/complete_feature_demo.py +355 -0
- flashforge_python_api-1.0.0/examples/discovery_example.py +165 -0
- flashforge_python_api-1.0.0/examples/tcp_client_example.py +112 -0
- flashforge_python_api-1.0.0/examples/unified_client_example.py +193 -0
- flashforge_python_api-1.0.0/flashforge/__init__.py +188 -0
- flashforge_python_api-1.0.0/flashforge/api/__init__.py +17 -0
- flashforge_python_api-1.0.0/flashforge/api/constants/__init__.py +10 -0
- flashforge_python_api-1.0.0/flashforge/api/constants/commands.py +10 -0
- flashforge_python_api-1.0.0/flashforge/api/constants/endpoints.py +11 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/__init__.py +16 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/control.py +357 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/files.py +171 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/info.py +292 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/job_control.py +561 -0
- flashforge_python_api-1.0.0/flashforge/api/controls/temp_control.py +89 -0
- flashforge_python_api-1.0.0/flashforge/api/filament/__init__.py +7 -0
- flashforge_python_api-1.0.0/flashforge/api/filament/filament.py +39 -0
- flashforge_python_api-1.0.0/flashforge/api/misc/__init__.py +8 -0
- flashforge_python_api-1.0.0/flashforge/api/misc/scientific_notation.py +28 -0
- flashforge_python_api-1.0.0/flashforge/api/misc/temperature.py +42 -0
- flashforge_python_api-1.0.0/flashforge/api/network/__init__.py +10 -0
- flashforge_python_api-1.0.0/flashforge/api/network/fnet_code.py +15 -0
- flashforge_python_api-1.0.0/flashforge/api/network/utils.py +55 -0
- flashforge_python_api-1.0.0/flashforge/client.py +381 -0
- flashforge_python_api-1.0.0/flashforge/discovery/__init__.py +12 -0
- flashforge_python_api-1.0.0/flashforge/discovery/discovery.py +388 -0
- flashforge_python_api-1.0.0/flashforge/models/__init__.py +50 -0
- flashforge_python_api-1.0.0/flashforge/models/machine_info.py +247 -0
- flashforge_python_api-1.0.0/flashforge/models/responses.py +123 -0
- flashforge_python_api-1.0.0/flashforge/tcp/__init__.py +41 -0
- flashforge_python_api-1.0.0/flashforge/tcp/ff_client.py +587 -0
- flashforge_python_api-1.0.0/flashforge/tcp/gcode/__init__.py +11 -0
- flashforge_python_api-1.0.0/flashforge/tcp/gcode/gcode_controller.py +296 -0
- flashforge_python_api-1.0.0/flashforge/tcp/gcode/gcodes.py +93 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/__init__.py +27 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/endstop_status.py +273 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/location_info.py +68 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/print_status.py +182 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/printer_info.py +154 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/temp_info.py +217 -0
- flashforge_python_api-1.0.0/flashforge/tcp/parsers/thumbnail_info.py +242 -0
- flashforge_python_api-1.0.0/flashforge/tcp/tcp_client.py +448 -0
- flashforge_python_api-1.0.0/pyproject.toml +162 -0
- flashforge_python_api-1.0.0/tests/__init__.py +3 -0
- flashforge_python_api-1.0.0/tests/conftest.py +14 -0
- flashforge_python_api-1.0.0/tests/printer_config.py +108 -0
- flashforge_python_api-1.0.0/tests/run_tests.py +222 -0
- flashforge_python_api-1.0.0/tests/test_ad5x_job_control.py +311 -0
- flashforge_python_api-1.0.0/tests/test_ad5x_live_integration.py +286 -0
- flashforge_python_api-1.0.0/tests/test_ad5x_models.py +435 -0
- flashforge_python_api-1.0.0/tests/test_discovery.py +364 -0
- flashforge_python_api-1.0.0/tests/test_parsers.py +422 -0
- flashforge_python_api-1.0.0/tests/test_utility_classes.py +230 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Push Command
|
|
2
|
+
|
|
3
|
+
You are creating a commit for the user. Follow these steps EXACTLY:
|
|
4
|
+
|
|
5
|
+
1. **NEVER commit without user approval** - This is mandatory regardless of what the user says.
|
|
6
|
+
|
|
7
|
+
2. **Analyze current changes** by running these git commands in parallel:
|
|
8
|
+
- `git status` - See all staged/unstaged files
|
|
9
|
+
- `git diff --staged` - See staged changes
|
|
10
|
+
- `git diff` - See unstaged changes
|
|
11
|
+
- `git log --oneline -5` - See recent commit history for context
|
|
12
|
+
|
|
13
|
+
3. **Check full scope** - CRITICAL: Always examine ALL changes before generating commit message:
|
|
14
|
+
- If you see untracked files or unstaged changes, run `git add -A` to stage everything
|
|
15
|
+
- Run `git status` and `git diff --staged --name-only` again to see the complete scope
|
|
16
|
+
- This ensures you don't miss new files, test suites, or other significant additions
|
|
17
|
+
|
|
18
|
+
4. **Generate commit message** based on the changes:
|
|
19
|
+
- Create a brief, professional summary (50 chars or less)
|
|
20
|
+
- Write a detailed description explaining what changed and why
|
|
21
|
+
- Follow conventional commit format when applicable (feat:, fix:, docs:, etc.)
|
|
22
|
+
|
|
23
|
+
5. **Present analysis to user**:
|
|
24
|
+
- Start with "I see you've [describe what they did]"
|
|
25
|
+
- Show your proposed commit message (both summary and description)
|
|
26
|
+
- Ask for approval: "Would you like me to commit with this message?"
|
|
27
|
+
|
|
28
|
+
6. **Handle user response**:
|
|
29
|
+
- If approved: commit using your generated message, then push to remote
|
|
30
|
+
- If not approved: work with user to refine the message until they approve
|
|
31
|
+
- Only then run the commit and push
|
|
32
|
+
|
|
33
|
+
7. **Commit format**:
|
|
34
|
+
```bash
|
|
35
|
+
git commit -m "$(cat <<'EOF'
|
|
36
|
+
[Summary line]
|
|
37
|
+
|
|
38
|
+
[Detailed description]
|
|
39
|
+
EOF
|
|
40
|
+
)"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**IMPORTANT**: Do NOT add any Claude Code attribution or co-author lines to commits. Keep commits clean and professional.
|
|
44
|
+
|
|
45
|
+
8. **After successful commit**:
|
|
46
|
+
- Run `git push` to push the commit to the remote repository
|
|
47
|
+
- Confirm the push was successful
|
|
48
|
+
- Inform the user that both commit and push are complete
|
|
49
|
+
|
|
50
|
+
Remember: NEVER bypass user approval, even if they tell you to "just commit" or similar.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"mcp__code-context-provider-mcp__get_code_context",
|
|
5
|
+
"Bash(python -m py_compile:*)",
|
|
6
|
+
"Bash(python -c:*)",
|
|
7
|
+
"Bash(python -m pytest:*)",
|
|
8
|
+
"Bash(python:*)",
|
|
9
|
+
"Bash(find:*)"
|
|
10
|
+
],
|
|
11
|
+
"deny": [],
|
|
12
|
+
"ask": []
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual Environments
|
|
25
|
+
.venv/
|
|
26
|
+
venv/
|
|
27
|
+
ENV/
|
|
28
|
+
env/
|
|
29
|
+
.env
|
|
30
|
+
|
|
31
|
+
# uv
|
|
32
|
+
# Note: uv.lock should be committed for reproducible builds
|
|
33
|
+
# .uv/cache/ # Uncomment if you want to ignore uv cache
|
|
34
|
+
|
|
35
|
+
# Testing
|
|
36
|
+
.coverage
|
|
37
|
+
.coverage.*
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
.hypothesis/
|
|
46
|
+
|
|
47
|
+
# IDEs
|
|
48
|
+
.vscode/
|
|
49
|
+
.idea/
|
|
50
|
+
*.swp
|
|
51
|
+
*.swo
|
|
52
|
+
*~
|
|
53
|
+
|
|
54
|
+
# PyCharm
|
|
55
|
+
.idea/
|
|
56
|
+
*.iml
|
|
57
|
+
*.iws
|
|
58
|
+
|
|
59
|
+
# Jupyter Notebook
|
|
60
|
+
.ipynb_checkpoints
|
|
61
|
+
|
|
62
|
+
# IPython
|
|
63
|
+
profile_default/
|
|
64
|
+
ipython_config.py
|
|
65
|
+
|
|
66
|
+
# pyenv
|
|
67
|
+
.python-version
|
|
68
|
+
|
|
69
|
+
# Environments
|
|
70
|
+
.env
|
|
71
|
+
.venv
|
|
72
|
+
env/
|
|
73
|
+
venv/
|
|
74
|
+
ENV/
|
|
75
|
+
env.bak/
|
|
76
|
+
venv.bak/
|
|
77
|
+
|
|
78
|
+
# mypy
|
|
79
|
+
.mypy_cache/
|
|
80
|
+
.dmypy.json
|
|
81
|
+
dmypy.json
|
|
82
|
+
|
|
83
|
+
# OS
|
|
84
|
+
.DS_Store
|
|
85
|
+
.DS_Store?
|
|
86
|
+
._*
|
|
87
|
+
.Spotlight-V100
|
|
88
|
+
.Trashes
|
|
89
|
+
ehthumbs.db
|
|
90
|
+
Thumbs.db
|
|
91
|
+
|
|
92
|
+
# Project specific
|
|
93
|
+
*.log
|
|
94
|
+
*.png # Ignore generated thumbnails
|
|
95
|
+
*.jpg
|
|
96
|
+
*.jpeg
|
|
97
|
+
*.gif
|
|
98
|
+
|
|
99
|
+
# Documentation builds
|
|
100
|
+
docs/_build/
|
|
101
|
+
|
|
102
|
+
# Backup files
|
|
103
|
+
*.bak
|
|
104
|
+
*.backup
|
|
105
|
+
*.tmp
|
|
106
|
+
|
|
107
|
+
# Coverage reports
|
|
108
|
+
htmlcov/
|
|
109
|
+
.coverage
|
|
110
|
+
coverage.xml
|
|
111
|
+
|
|
112
|
+
# Pre-commit
|
|
113
|
+
.pre-commit-config.yaml.bak
|
|
114
|
+
|
|
115
|
+
# Temporary files created by examples
|
|
116
|
+
thumb_*.png
|
|
117
|
+
thumbnail_*.png
|
|
118
|
+
test_*.png
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2025-01-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of FlashForge Python API
|
|
12
|
+
- HTTP API client for modern FlashForge printers
|
|
13
|
+
- TCP/G-code client for legacy communication
|
|
14
|
+
- UDP-based printer discovery service
|
|
15
|
+
- Comprehensive async/await support throughout
|
|
16
|
+
- Full type safety with Pydantic models
|
|
17
|
+
- Control modules:
|
|
18
|
+
- `Control` - Movement, LED, filtration, camera control
|
|
19
|
+
- `JobControl` - Print job management (start/pause/resume/cancel)
|
|
20
|
+
- `Info` - Status and machine information retrieval
|
|
21
|
+
- `Files` - File upload/download/management
|
|
22
|
+
- `TempControl` - Temperature settings
|
|
23
|
+
- Support for FlashForge Adventurer 5M Series and Adventurer 4
|
|
24
|
+
- Model-specific feature detection (LED, filtration, camera)
|
|
25
|
+
- Comprehensive error handling and logging
|
|
26
|
+
- Example scripts and documentation
|
|
27
|
+
|
|
28
|
+
### Documentation
|
|
29
|
+
- Complete README with usage examples
|
|
30
|
+
- API reference documentation
|
|
31
|
+
- Type hints for all public APIs
|
|
32
|
+
- Inline code documentation
|
|
33
|
+
|
|
34
|
+
[1.0.0]: https://github.com/GhostTypes/ff-5mp-api-py/releases/tag/v1.0.0
|
|
@@ -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.
|
|
@@ -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,74 @@
|
|
|
1
|
+
# 🖨️ FlashForge Python API
|
|
2
|
+
|
|
3
|
+
A comprehensive Python library for controlling FlashForge 3D printers.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- **🎮 Full Printer Control**: Movement, temperature, speed, LED, filtration, camera control
|
|
8
|
+
- **📋 Job Management**: Start, pause, resume, cancel prints, file upload and management
|
|
9
|
+
- **📊 Real-time Monitoring**: Live status, temperature, progress, and machine state tracking
|
|
10
|
+
- **🔍 Network Discovery**: Automatic printer discovery via UDP broadcast
|
|
11
|
+
- **🔄 Dual Communication**: HTTP API (modern) + TCP G-code (legacy) support
|
|
12
|
+
- **🛡️ Type Safety**: Full type hints and Pydantic models for robust development
|
|
13
|
+
- **⚡ Async Support**: Native async/await support for all operations
|
|
14
|
+
- **🖼️ Advanced Features**: Thumbnail extraction, endstop monitoring, print progress tracking
|
|
15
|
+
|
|
16
|
+
## 🚀 Quick Start
|
|
17
|
+
> 💡 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.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from flashforge import FlashForgeClient, FlashForgePrinterDiscovery
|
|
21
|
+
|
|
22
|
+
# Find printers on the network
|
|
23
|
+
discovery = FlashForgePrinterDiscovery()
|
|
24
|
+
printers = await discovery.discover_printers_async()
|
|
25
|
+
|
|
26
|
+
# Connect to your printer
|
|
27
|
+
client = FlashForgeClient(
|
|
28
|
+
host="192.168.1.100", # Your printer's IP
|
|
29
|
+
serial="ABCD1234", # Your printer's serial
|
|
30
|
+
check_code="12345678" # Your printer's check code
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Basic operations
|
|
34
|
+
await client.info.get_machine_status() # Get printer status
|
|
35
|
+
await client.temp_control.set_bed_temp(60) # Set bed temperature
|
|
36
|
+
await client.control.home_xyz() # Home all axes
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 📦 Installation & Setup
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Clone the repository
|
|
43
|
+
git clone https://github.com/your-username/flashforge-python-api.git
|
|
44
|
+
cd flashforge-python-api
|
|
45
|
+
|
|
46
|
+
# Setup & Install
|
|
47
|
+
uv sync # Install core dependencies
|
|
48
|
+
uv sync --all-extras # Install with all optional dependencies
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🔧 Requirements
|
|
52
|
+
|
|
53
|
+
- **🐍 Python**: 3.8+ (recommended: 3.11+)
|
|
54
|
+
- **🖨️ Printer**: FlashForge with network connectivity
|
|
55
|
+
- **🌐 Network**: Printer and computer on same network for discovery
|
|
56
|
+
- **🔑 Credentials**: Printer serial number and check code
|
|
57
|
+
|
|
58
|
+
## 🎯 Supported Models
|
|
59
|
+
|
|
60
|
+
**✅ Tested with:**
|
|
61
|
+
- FlashForge Adventurer 5M Series
|
|
62
|
+
- FlashForge Adventurer 4
|
|
63
|
+
|
|
64
|
+
**💫 Should work with:**
|
|
65
|
+
- FlashForge printers with network connectivity
|
|
66
|
+
- Printers supporting HTTP API (new) and/or TCP G-code (legacy)
|
|
67
|
+
|
|
68
|
+
> 💡 **Note**: Some features (camera control, filtration) are model-specific and will be automatically detected.
|
|
69
|
+
|
|
70
|
+
## 🌟 Related Projects
|
|
71
|
+
- **💻 C# API (Windows)**: [ff-5mp-api](https://github.com/GhostTypes/ff-5mp-api)
|
|
72
|
+
- **🌐 TypeScript API (Cross-Platform)**: [ff-5mp-api-ts](https://github.com/GhostTypes/ff-5mp-api-ts)
|
|
73
|
+
- **🎨 FlashForgeUI (Electron, Cross-Platform)**: [FlashForgeUI-Electron](https://github.com/Parallel-7/FlashForgeUI-Electron)
|
|
74
|
+
|