Skip to main content

Eclipse Cyclone DDS Python binding

Project description

License License Website PyPI - Python Version PyPI Community

Python binding for Eclipse Cyclone DDS

A Python binding for Eclipse Cyclone DDS.

Getting Started

Eclipse CycloneDDS Python requires Python version 3.7 or higher. You can install with included Cyclone DDS binaries or leveraging an existing Cyclone DDS installation by installing from source via PyPi.

Documentation can be found on the cyclonedds.io website: Python API docs

Installing with pre-built Cyclone DDS binaries

This is the most straightforward method to install Cyclone DDS Python, but there are a couple of caveats. The pre-built package:

  • has no support for DDS Security,
  • has no support for shared memory via Iceoryx,
  • comes with generic Cyclone DDS binaries that are not optimized per-platform.

If these are of concern, proceed with an installation from source. If not, running this installation is as simple as:

    $ pip install cyclonedds

You can also use the nightly build stream instead, which is built from the master branches of cyclonedds and cyclonedds-python. This will always get you the latest and greatest, but less stable version that might contain API breaks.

    $ pip install cyclonedds-nightly

Installing from source

When installing from source you can make use of the full list of features offered by Cyclone DDS. First install Cyclone DDS as normal. Make sure that Cyclone DDS is built with the ENABLE_TYPELIB option set to ON (the default for this option). Then continue by setting the CYCLONEDDS_HOME environment variable to the installation location of Cyclone DDS, which is the same as what was used for CMAKE_INSTALL_PREFIX. You will have to have this variable active any time you run Python code that depends on cyclonedds so adding it to .bashrc on Linux, ~/bash_profile on MacOS or the System Variables in Windows can be helpful. This also allows you to switch, move or update Cyclone DDS without recompiling the Python package.

You'll need the Python development headers to complete the install. If using apt, try sudo apt install python3-dev. For other distributions, see this comment.

via PyPi

You can install the source from the latest release from Pypi, or use a tag to get a specific version. A full example (for linux) is shown below

$ git clone https://github.com/eclipse-cyclonedds/cyclonedds
$ cd cyclonedds && mkdir build install && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=../install
$ cmake --build . --config RelWithDebInfo --target install
$ cd ..
$ export CYCLONEDDS_HOME="$(pwd)/install"
$ pip3 install cyclonedds --no-binary cyclonedds

via git

A full example installation of the quickest way to get started via git is shown below:

$ git clone https://github.com/eclipse-cyclonedds/cyclonedds
$ cd cyclonedds && mkdir build install && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=../install
$ cmake --build . --config RelWithDebInfo --target install
$ cd ..
$ export CYCLONEDDS_HOME="$(pwd)/install"
$ pip3 install git+https://github.com/eclipse-cyclonedds/cyclonedds-python

Command line tooling

The Python package contains a suite of command line tools, all nested under the main entrypoint cyclonedds. The main help screen shows the commands available:

cyclonedds --help

cyclonedds ls

cyclonedds ls --help

The ls subcommand shows you the entities in your DDS system and their QoS settings. For example, here is the output when running the Vehicle example from this repo in the background:

cyclonedds ls --suppress-progress-bar --force-color-mode

cyclonedds ps

cyclonedds ps --help

The ps subcommand shows you the applications in your DDS system. Note that this depends on so called 'Participant Properties', tactfully named QoS properties in DDS participants. These were merged into CycloneDDS for version 0.10.0. Here is an example of the output when running the Vehicle example from this repo in the background on a single host:

cyclonedds ps --suppress-progress-bar --force-color-mode

cyclonedds typeof

cyclonedds typeof --help

The typeof subcommand shows you the type(s) of a topic in your system. With XTypes it can happen that more than one type for each topic exists and that they are still compatible. The types are represented in IDL. Here is an example of the output when running the Vehicle example:

cyclonedds typeof Vehicle --suppress-progress-bar --force-color-mode

cyclonedds subscribe

cyclonedds subscribe --help

The subscribe subcommand dynamically subscribes to a topic and shows you the data as it arrives. The type is discovered in a similar manner as typeof. Here is an example of the output when running the Vehicle example:

timeout -s INT 10s cyclonedds subscribe Vehicle --suppress-progress-bar --force-color-mode

cyclonedds publish

cyclonedds publish --help

The publish subcommand dynamically builds a REPL with datatypes and a writer for a topic and shows you the data as it arrives. The type is discovered in a similar manner as typeof.

cyclonedds performance

cyclonedds performance --help

The performance subcommand is a nicer frontend to ddsperf with four modes: publish, subscribe, ping and pong. The below performance run example is the cyclonedds performance subscribe mode rendered with cyclonedds performance publish running in the background.

cyclonedds performance --duration 21s --render-output-once-on-exit --force-color-mode subscribe --triggering-mode waitset

Contributing

We very much welcome all contributions to the project, whether that is questions, examples, bug fixes, enhancements or improvements to the documentation, or anything else really. When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite using pytest, along with flake8 code linting, and documentation built with sphinx. Be sure to install with the Extra dependencies if you're going to run tests, lints or build the docs.

You can run the test suite and linting using the local-ci.py script in this repo.

$ python local-ci.py

Or lint a single file/directory (as the whole repo can be a little noisey) using:

$ python -m flake8 path/to/some_file.py

You can build and serve the documentation (at http://localhost:8000/) using:

cd docs
python -m sphinx source/ _build/
# Serve the HTML files to view at localhost:8000
python -m http.server -d _build

Extra dependencies

The cyclonedds package defines two sets of optional dependencies, dev and docs, used for developing cyclonedds and building the documentation, respectively. If you want to install with development tools add the component to your installation, for example:

$ pip3 install --user "cyclonedds[dev] @ git+https://github.com/eclipse-cyclonedds/cyclonedds-python"

Or when installing from a local git clone, which is recommended when developing or building the docs:

$ cd /path/to/git/clone
# for development:
$ pip3 install --user ".[dev]"
# for documentation generation
$ pip3 install --user ".[docs]"
# or for both
$ pip3 install --user ".[dev,docs]"

For more information see the packaging guide information on optional dependencies.

PyOxidizer build

You can build a self-contained binary of the cyclonedds CLI tool using PyOxidizer. It should be as simple as:

$ cd /path/to/git/clone
$ pip3 install --user pyoxidizer
$ pyoxidizer build

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

cyclonedds-nightly-2024.10.12.tar.gz (161.5 kB view details)

Uploaded Source

Built Distributions

cyclonedds_nightly-2024.10.12-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

cyclonedds_nightly-2024.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_11_0_arm64.whl (820.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_10_9_x86_64.whl (892.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

cyclonedds_nightly-2024.10.12-cp39-cp39-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

cyclonedds_nightly-2024.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_11_0_arm64.whl (820.2 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_10_9_x86_64.whl (892.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

cyclonedds_nightly-2024.10.12-cp38-cp38-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

cyclonedds_nightly-2024.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_11_0_arm64.whl (820.2 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_10_9_x86_64.whl (892.3 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

cyclonedds_nightly-2024.10.12-cp37-cp37m-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.7m Windows x86-64

cyclonedds_nightly-2024.10.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cyclonedds_nightly-2024.10.12-cp37-cp37m-macosx_10_9_x86_64.whl (892.3 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file cyclonedds-nightly-2024.10.12.tar.gz.

File metadata

File hashes

Hashes for cyclonedds-nightly-2024.10.12.tar.gz
Algorithm Hash digest
SHA256 9e63c26a049e90f4b9d998097c81770bddf930824d81d24d1f82ae7c307da583
MD5 0f72a9e835704b0bf222f641cb0c6b97
BLAKE2b-256 569358d4ea9d010cf44c995b02c0c38de948a159374f730d43eb47dfa36e2587

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 00200de5ea63e1ee5156e7e66db244f30e635c87f659e4901b4aaf716c31fd37
MD5 d0a0214b8d5f3658300eafbfff6c74b7
BLAKE2b-256 a3e10bb77c5fbc190c0538d2b28cad836f0bec3c0f4a2b4342ecdb9aa501b479

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57978363504a42361500c761f55fe385e6b66625113c1ef0ffcc327d42e721d4
MD5 fc8a36850e7e3f1384b9b59180449872
BLAKE2b-256 3d4b9df2938339e804ea643fcf6e6aa4ecedba6ce00f3d3b398417ce899e6c79

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08abfa1d6b599e6580a193bb6fa95078fa6d223a1ce4a086819c5cda2d4771eb
MD5 bfbbf8c8ae76c12c4bdd1613bbfdd84c
BLAKE2b-256 6816072ee0dcedadcb072647cccccec4634fd30768c9e81985c59666c16f428b

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 beedb6e3198a295340204639b3a73a8e318efe1fcc8a562bd552946bfa20b5ec
MD5 250732a76e2346fc07d1b3e6a8dd0fe3
BLAKE2b-256 84561cfa77fc07bf1f5da14ad01b4a735b3d93713997019a7ea081c58a2b5f47

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2aeadb104fe61990bbc592985b12466fa0dd2ee4a1f6aa338971125d8e9277dc
MD5 a60b7316184bc61c934dc504e1aed307
BLAKE2b-256 73b2e35e22557115b05ce0e55f196d2fdd5a56c34f71182ddc362127075661d5

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b94a6cd7e85dc6570315e0afba563620a121b6ac4f9c56ea32d45e2a7cb8137
MD5 f89aeb0b3c5187c8e2f3f5c2bd89ac98
BLAKE2b-256 b012c2b2b1553f685e9d3588e129cc994cc64a2382c089019683d93cc140d1f2

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2173d6439e8282ef801de4ad1bc7e8ad0797835e552887d0dbea3a944283f72
MD5 e837ecb5798d8b523305d438ed93f54e
BLAKE2b-256 9ed706f8730fc6ef75cc5938847e764e8757f3d7ce341e80f8edc97360c7cab9

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 143b045f2e380fdbff88ec06f3c3760e42f864e9009d1b298453daab5ce0f5f1
MD5 fe02648eafd25a6831a7182e6bf04bf3
BLAKE2b-256 c4078284ff2801835ea496a2228701fae90b90634124f25d10027ad700929867

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4974e065d109aaf00f6e6c440a4b83c706834ef7df632f9469da729a5e43c96a
MD5 b61644226de0012121646183dbfb1e93
BLAKE2b-256 da29b33b58a09443dce65ad771dd3896660bccf142c2687e6d88bbccfbe744de

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0affa8d162eacdf384632361d2d45f1ca8d6b5e9d9e272efe5fbbc3827e96fac
MD5 a96d9fbdeca3911deb06666723cff60d
BLAKE2b-256 764f4e466e67507e56732e36658c23b6a77d6a5690d01122074f057a3771470a

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75dbf914c128848778890df3d21a0fbbec35cfcb4e1cff0bf2b3decfa2b58fbf
MD5 9c6de09dc20de12da8fcab4b4b59c523
BLAKE2b-256 8861de2191c2238c6fe45389dbbfcee073f7281001c0362acbd78f7b9f43eaba

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8811106f5515107f928d56683b50417857e7518f6963253c660e42ac8de9cea9
MD5 9972a1744ecc652f1cb6ff4972152dc0
BLAKE2b-256 1e41969cc0a97c27aaf00b7792e021f32c0e281b93952f70b0ccb4b5644ec4a5

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 74f5bc5728e7e4219260a36bfd4841412600646932bb5319b8a15563dac29fcd
MD5 ea4d2c2bb184b61d5049d2e287e1ee3b
BLAKE2b-256 efb8b3963a1f2a17a7d15df94f57798082dcacb64ce71a5b3ad5b32820a95045

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c72e6c531011ef85fa1d1921396a957bfb333f983495f387ae8a62dd178ddbd2
MD5 706c5ec289d7f50492cd744b98b0f893
BLAKE2b-256 68d130d1a1e0e0b716ff36975f6457113fdab76fd9396dae89e8b414bcb8e39e

See more details on using hashes here.

File details

Details for the file cyclonedds_nightly-2024.10.12-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cyclonedds_nightly-2024.10.12-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0d3e8633846b5555bffaa2719545699d0dcb8a9d675b33e4879d99239a8b21fa
MD5 8211c202e398f70b28e50460fad82ee6
BLAKE2b-256 211ea8a0dafaf2dc03ff632af6681350f57c801b45a178336f5e9c666ffdb7ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page