Skip to main content

Client library to access racs api server

Project description

RACS python client library

Simple client which uses requests to interact with the racs-api server.

Install

pip install racs-python

Usage

Make sure an instance of racs-api server is running

from racs_python import RacsClient

client = RacsClient("http://localhost:8742/api/v1")

# discover devices
devices = client.get_devices()
print(f"Found {len(devices.available)} available devices.")

if devices.available:
        target_id = devices.available[0].id
        
        # 2. Connection
        client.connect_device(target_id)
        print(f"Connected to device {target_id}")

        # 3. Read/Write Settings
        width = client.get_device_gc_node_value(target_id, "Width")
        print(f"Current Width: {width}")
        
        client.set_device_gc_node_value(target_id, "Width", "1920")

        # 4. Grab an image
        jpg_data = client.grab_jpg_frame(target_id)
        with open("frame.jpg", "wb") as f:
            f.write(jpg_data)

        # 5. Cleanup
        client.disconnect_device(target_id)

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

racs_python-0.0.2.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

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

racs_python-0.0.2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file racs_python-0.0.2.tar.gz.

File metadata

  • Download URL: racs_python-0.0.2.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for racs_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d00717e3aa5371e84caccb72b347963f2affc7ff0f582898b0683e67eaa83fd3
MD5 f0b7d9d584320f0a1460329ec9a4ec3e
BLAKE2b-256 918723547873f60a91210a9696c17bfa8827366cea26b377656f6b618cb0413e

See more details on using hashes here.

File details

Details for the file racs_python-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: racs_python-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for racs_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 007edacf19b055e4fa9cf8f4a76d88775a5b93eddbbc01be022f846a31b509db
MD5 f6ec6ce40a605e1e79ff0301d83aa767
BLAKE2b-256 f4138563747529d6a5f1ed3d9e31b4d91fb1debb8565416523e3c33027cc8935

See more details on using hashes here.

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