Skip to main content

AMCP (Advanced Media Control Protocol) Client Library

Project description

Python AMCP Client Library

v0.3.0

CI PyPI PyPI PyPI - Python Version Support Project

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

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:

from amcp_pylib.module.query import VERSION

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

Connecting to server

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:

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

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)
<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. 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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amcp_pylib-0.3.0b2.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amcp_pylib-0.3.0b2-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file amcp_pylib-0.3.0b2.tar.gz.

File metadata

  • Download URL: amcp_pylib-0.3.0b2.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amcp_pylib-0.3.0b2.tar.gz
Algorithm Hash digest
SHA256 b63ff4a22a8612e8c18875a1abedf0639c457c81fc55f42e3fc5afaca1733a3c
MD5 9aab33f2fdc521b5bad483d7c3db0e8d
BLAKE2b-256 8de272d6a1f4280db7602dacb7f7acecd4abc99c2a29ad047c145f0549d11035

See more details on using hashes here.

Provenance

The following attestation bundles were made for amcp_pylib-0.3.0b2.tar.gz:

Publisher: python-publish.yml on dolejska-daniel/amcp-pylib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amcp_pylib-0.3.0b2-py3-none-any.whl.

File metadata

  • Download URL: amcp_pylib-0.3.0b2-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amcp_pylib-0.3.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 21c0f5d80e777af6856396086628472cb5f2ce7f861b688bba3071cdf3b57a07
MD5 722a9d7630f7dcb1148808507eccb9c3
BLAKE2b-256 029815b72fc8fe3ada2a9806459143b28e79a7f41a4e5f38186de44451c4e19f

See more details on using hashes here.

Provenance

The following attestation bundles were made for amcp_pylib-0.3.0b2-py3-none-any.whl:

Publisher: python-publish.yml on dolejska-daniel/amcp-pylib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page