aso824/octoprint-php-api
最新稳定版本:v0.1.3
Composer 安装命令:
composer require aso824/octoprint-php-api
包简介
OctoPrint API client written in PHP
README 文档
README
API wrapper to allow easy use of OctoPrint REST API in your PHP appplication.
Please note that library is currently in WIP status.
Requirements
- PHP ^7.4
- Symfony Serializer ^5.0
- Any PSR-18 compatible HTTP client (consider using HTTPlug)
- OctoPrint ^1.4
Installation
composer require aso824/octoprint-php-api
Usage
This simple example below assumes that you are using HTTPlug and have any compatible HTTP client.
use Http\Discovery\HttpClientDiscovery; use aso824\OctoPrintPHP\Client; use aso824\OctoPrintPHP\Configuration; $httpClient = HttpClientDiscovery::find(); $configuration = new Configuration('http://octoprint.local', 'your-api-key'); $octoClient = new Client($configuration, $httpClient); var_dump($octoClient->getVersion()->getServer()); // "1.4.2" $file = $octoClient->files->getFile('test.gcode'); var_dump($file->getGcodeAnalysis()->getEstimatedPrintTime()); // 10120 (seconds)
For list of available action please visit OctoPrint REST API documentation.
Currently implemented endpoints
| API resource | Status |
|---|---|
| Connection | ✔️ |
| Files | ✅ Without upload |
| Jobs | ❌ |
| Languages | ❌ |
| Log files | ❌ |
| Printer operations | ❌ |
| Printer profiles | ❌ |
| Settings | ❌ |
| Slicing | ❌ |
| System | ❌ |
| Timelapse | ❌ |
| Access control | ❌ |
| Util | ❌ |
Contributing
All pull requests are welcome. Please follow same convention as in already existing files.
License
This library is under MIT license.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-26