amcp-pylib-0.2.2
توضیحات
AMCP (Advanced Media Control Protocol) Client Library
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | amcp-pylib-0.2.2 |
| نام | amcp-pylib |
| نسخه کتابخانه | 0.2.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Daniel Dolejska |
| ایمیل نویسنده | dolejskad@gmail.com |
| آدرس صفحه اصلی | https://github.com/dolejska-daniel/amcp-pylib |
| آدرس اینترنتی | https://pypi.org/project/amcp-pylib/ |
| مجوز | MIT |
# Python AMCP Client Library
> v0.2.1
[](https://travis-ci.org/dolejska-daniel/amcp-pylib)
[](https://pypi.org/project/amcp-pylib/)
[](https://pypi.org/project/amcp-pylib/)
[](https://www.paypal.me/dolejskad)
## Introduction
Welcome to the AMCP client library repository for Python!
The goal of this library is to provide simple and understandable interface for communication with CasparCG server.
## Installation
```
pip install amcp_pylib
```
## Usage examples
Below you can see various usage examples.
### Connecting to server
```python
from amcp_pylib.core import Client
client = Client()
client.connect("caspar-server.local", 6969) # defaults to 127.0.0.1, 5250
```
Built-in support for `asyncio` module:
```python
import asyncio
from amcp_pylib.core import ClientAsync
client = ClientAsync()
asyncio.new_event_loop().run_until_complete(client.connect("caspar-server.local", 6969))
```
### Sending commands
```python
from amcp_pylib.core import Client
from amcp_pylib.module.query import VERSION, BYE
client = Client()
client.connect()
response = client.send(VERSION(component="server"))
print(response)
response = client.send(BYE())
print(response)
```
```shell
<SuccessResponse(data=['2.0.7.e9fc25a Stable'], code=201, code_description='VERSION')>
<InfoResponse( data=['SERVER SENT NO RESPONSE'], code=0, code_description='EMPTY')>
```
All supported protocol commands are listed and documented on CasparCG's [wiki pages](https://github.com/CasparCG/help/wiki/AMCP-Protocol#table-of-contents).
_Some commands may not be supported yet (in that case, please create issue (or pull ;) request)._
نحوه نصب
نصب پکیج whl amcp-pylib-0.2.2:
pip install amcp-pylib-0.2.2.whl
نصب پکیج tar.gz amcp-pylib-0.2.2:
pip install amcp-pylib-0.2.2.tar.gz