Skip to main content

CoppeliaSim zmqRemoteApi Python client

Python client for the zmqRemoteApi, protocol verison 2 (note: starting from pip package version 2.x, the major version number (e.g. 2) matches with the protocol version used by CoppeliaSim).

Installing:

python3 -m pip install coppeliasim-zmqremoteapi-client

Usage

from coppeliasim_zmqremoteapi_client import *

# create a client to connect to zmqRemoteApi server:
# (creation arguments can specify different host/port,
# defaults are host='localhost', port=23000)
client = RemoteAPIClient()

# get a remote object:
sim = client.require('sim')

# call API function:
h = sim.getObject('/Floor')
print(h)

There is also an asyncio version of the client. Normal asyncio principles apply, and all methods are async:

from coppeliasim_zmqremoteapi_client.asyncio import *

client = RemoteAPIClient()

async def main():
    async with RemoteAPIClient() as client:
        sim = await client.require('sim')
        h = await sim.getObject('/Floor')
        print(h)

asyncio.run(main())

on Windows, if it doesn't work properly, before calling asyncio.run(...) call:

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

A note about performance of sequential requests: if performing many commands in one shot, and results will be used later, consider using asyncio.gather for improved throughput.

E.g. getting the handles of 100 objects:

handles = await asyncio.gather(*[sim.getObject(f'/Object{i+1}') for i in range(100)])

Also check out the examples in clients/python.

Release files for coppeliasim-zmqremoteapi-client 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coppeliasim-zmqremoteapi-client 2.0.4
File Size Uploaded
coppeliasim_zmqremoteapi_client-2.0.4.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coppeliasim-zmqremoteapi-client 2.0.4
File Interpreter ABI Platform
coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size:21.9 kB

Release files / coppeliasim_zmqremoteapi_client-2.0.4.tar.gz

Download URL coppeliasim_zmqremoteapi_client-2.0.4.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a97cfe1510e1a41cdabe829efb6e0e0aa58f0612938c839bc3780e0f9c794f7a
BLAKE2b-256 checksum
How to use checksums
23691014369f1d6b14d39a0337d14029fbdf60bd24ced24aaf1f7b971ba8f9a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl

Download URL coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b83119f713070f8f4507afca0cc0258f3ec5a498c54c207a70622d9d81d8c229
BLAKE2b-256 checksum
How to use checksums
43ef0346adebafcaf46166f2b3276d1c5368e0604351604891967c182bf28b68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.0

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page