Metadata-Version: 2.4
Name: amcp-pylib
Version: 0.3.0b2
Summary: AMCP (Advanced Media Control Protocol) Client Library
Author-email: Daniel Dolejska <dolejskad@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/dolejska-daniel/amcp-pylib
Project-URL: Repository, https://github.com/dolejska-daniel/amcp-pylib
Project-URL: Issues, https://github.com/dolejska-daniel/amcp-pylib/issues
Project-URL: Changelog, https://github.com/dolejska-daniel/amcp-pylib/blob/master/CHANGELOG.md
Keywords: amcp,casparcg,client,video
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.md
Provides-Extra: test
Requires-Dist: pytest<9,>=7; extra == "test"
Provides-Extra: build
Requires-Dist: build>=1; extra == "build"
Requires-Dist: setuptools-scm>=8; extra == "build"
Requires-Dist: twine>=6; extra == "build"
Provides-Extra: lint
Requires-Dist: ruff>=0.8; extra == "lint"
Provides-Extra: dev
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: pytest<9,>=7; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: setuptools-scm>=8; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Dynamic: license-file

# Python AMCP Client Library
> v0.3.0

[![CI](https://github.com/dolejska-daniel/amcp-pylib/actions/workflows/ci.yml/badge.svg)](https://github.com/dolejska-daniel/amcp-pylib/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/dm/amcp-pylib.svg)](https://pypi.org/project/amcp-pylib/)
[![PyPI](https://img.shields.io/pypi/l/amcp-pylib.svg)](https://pypi.org/project/amcp-pylib/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/amcp-pylib.svg)](https://pypi.org/project/amcp-pylib/)
[![Support Project](https://img.shields.io/badge/support_project-PayPal-blue.svg)](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
```shell
pip install amcp-pylib
```

AMCP PyLib supports Python 3.9 and newer.

## Quickstart

Create commands directly when you want to inspect or log the AMCP message before sending it:

```python
from amcp_pylib.module.query import VERSION

command = VERSION(component="server")
print(str(command))
```

```shell
VERSION "server"
```

### 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()

# with command syntax of "VERSION {[component:string]}"
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=[],                       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)._

## Public API

The stable public API is documented in [docs/public-api.md](docs/public-api.md).

Most users should import clients from `amcp_pylib.core`, command factories from `amcp_pylib.module` or its command-category modules, and response base/factory classes from `amcp_pylib.response`.
