How clvlabs/pyatemmax works
Project type and purpose
• PyATEMMax is an open-source Python library (SDK) designed to monitor and control Blackmagic Design ATEM video switchers over the network. It provides a programmatic interface for exchanging commands and state updates with ATEM hardware.
• There is no “frontend” or “backend” in the web-app sense—instead there is a layered library that exposes connection management, protocol parsing/serialization, command handlers, state-data objects, and utility functions. Consumers are Python scripts or applications (the “examples” folder) that import PyATEMMax, connect to an ATEM switcher, issue commands, and react to events.
File structure
• Top-level directories:
• PyATEMMax/ – the core library
– ATEMConnectionManager.py: opens and manages the TCP/UDP socket
– ATEMBuffer.py, ATEMProtocol.py, ATEMProtocolEnums.py: low-level framing and parsing
– ATEMCommandHandlers.py & ATEMSetterMethods.py: high-level API for sending commands
– ATEMSwitcherState.py & StateData/: classes representing the switcher’s state (audio mixer, video mixer, macros, etc.)
– ATEMUtils.py, ATEMValueDict.py, ATEMConstant.py, ATEMException.py: shared constants, error types, and helpers
• docs/: static site (Jekyll) for online docs—separate from the runtime library
• examples/: sample Python programs showing how to use the library
• setup.py, setup.cfg, README-*.md: packaging and project metadata
• Patterns: layered architecture (Network → Protocol → Command API → State Model → Client code)
README for additional insights
• Purpose: port of an Arduino library to Python
• Provides online docs via GitHub Pages
• Clients (scripts and applications) import PyATEMMax, create a connection, subscribe to state changes, and invoke setter methods
Summary
• Important modules within each layer, and note any threading or callback mechanisms between Network and State Model