# Python SDK Quick Start This page covers Python control only. Before connecting hardware for the first time, identify your product in [Choose Your Product and Manual](products/index.md) and read its interface, power and safety instructions. If you do not need to write code, use [Control Pannel](software/control-pannel.md) for direct graphical control. ## 1. Prepare - Python 3.9 or later. - Connect the hub's command/control port to your computer with a USB cable. - To control downstream USB devices, connect the upstream data port, auxiliary power and downstream devices as described in the matching user manual. After enumeration, the command port normally appears as: | System | Typical port name | | --- | --- | | Windows | `COMx` | | Linux | `/dev/ttyACM*` | | macOS | `/dev/cu.usbmodem*` | ## 2. Install the Python SDK Install the published package: ```shell python3 -m pip install smartusbhub ``` Developers can install the current source tree instead: ```shell git clone https://github.com/mixedsignal-labs/smartusbhub.git cd smartusbhub python3 -m venv .venv source .venv/bin/activate python -m pip install -e . ``` ## 3. Run your first control script The example discovers a hub, reads its product and channel list, and then enables the first channel: ```python from smartusbhub import SmartUSBHub hub = SmartUSBHub.scan_and_connect() if hub is None: raise RuntimeError("SmartUSBHub not found; check the USB connection and serial-port permissions") try: channels = list(hub.get_channels()) print("Product:", hub.get_product_name()) print("Channels:", channels) hub.set_channel_power(channels[0], state=1) finally: hub.disconnect() ``` When working from the source repository, you can also run the included example: ```shell python examples/power_control_example.py ``` ## 4. Continue - [Python examples](software/examples.md): power cycling, data switching, measurement and multi-hub control. - [Python SDK Guide](software/python-library.md): installation options, device discovery and complete feature guidance. - [Python API Reference](api/python.rst): classes, methods and parameters. - [Choose Your Product and Manual](products/index.md): open the correct manual by product image and label.