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.2.0.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.2.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: racs_python-0.2.0.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.2.0.tar.gz
Algorithm Hash digest
SHA256 317b5ef1e8f7195bc22d25ac9d37cc5bf3e2b268aee0e5bf9b283c5f0ecaa785
MD5 25b0a3d02ff1880323a3688f83a7d52d
BLAKE2b-256 64e8e8062dc090001589a364e909aeb34befb3eb024b424697f88ae9ded5e186

See more details on using hashes here.

File details

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

File metadata

  • Download URL: racs_python-0.2.0-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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72c9369523c57b903c8759c5d0d3efe5659ae63dd4979d8e96069c6e21f7c3d1
MD5 5f17f568b32aebf988fc38932fe792ab
BLAKE2b-256 4b1a10cf608565e83dadabb66c111a0854e0e7aa7475b8ec6172c4c9c41b8680

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