Skip to main content

genmypy

A Python stub generator from genmsg specs

Installation

If you use catkin and need CMake support for the genmypy generator, clone the repository and add it to your catkin workspace.

cd /path/to/your/ws
git clone https://github.com/rospypi/genmypy.git

If you don’t need the cmake support, you can also install it from pypi.org:

pip install genmypy

Usage

catkin

Add genmypy along with message_generation to find_package in CMakeLists.txt. genmsg will find genmypy automatically when building msg/srv files.

Also, keep in mind that your package should have the build dependency for genmypy in package.xml to make sure that catkin finishes the build of genmypy before building your package.

Examples:

  • CMakeLists.txt
    find_package(catkin REQUIRED COMPONENTS std_msgs message_generation genmypy)
  • package.xml
    <build_depend>genmypy</build_depend>

CLI

$ genmypy --help
Usage: genmypy [-h] {msg,srv,module} ...
positional arguments:
  {msg,srv,module}
    msg             Generate stub files from .msg files
    srv             Generate stub files from .srv files
    module          Generate __init__.pyi from a msg/srv directory

optional arguments:
  -h, --help        show this help message and exit

Examples:

# Message files
$ genmypy msg custom_msgs custom_msgs/msg/Custom.msg
$ genmypy msg std_msgs --out-dir out /opt/ros/noetic/share/std_msgs/msg/Header.msg
$ genmypy msg sensor_msgs --out-dir out \
    -Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \
    -Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \
    /opt/ros/noetic/share/sensor_msgs/msg/PointCloud2.msg

# Service files
$ genmypy srv custom_msgs custom_msgs/srv/Custom.msg
$ genmypy srv nav_msgs --out-dir out \
    -Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \
    -Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \
    /opt/ros/noetic/share/sensor_msgs/srv/SetCameraInfo.srv

# Module files
$ genmypy module custom_msgs/msg
$ genmypy module --module-finder py --out out \
    /opt/ros/noetic/lib/python2.7/dist-packages/std_msgs/msg/

genmypy msg / genmypy srv:

Usage: genmypy {msg,srv} [-h] [--out-dir OUT_DIR]
                        [--include-path INCLUDE_PATH]
                        package files [files ...]

positional arguments:
  package               Package name of given files
  files                 Files to generate stubs

optional arguments:
  -h, --help            show this help message and exit
  --out-dir OUT_DIR     Output directory. If the option is unset, each stub
                        file will be generated in the same directory as each
                        input.
  --include-path INCLUDE_PATH, -I INCLUDE_PATH
                        Include paths for processing given files

genmypy module:

Usage: genmypy module [-h] [--out-dir OUT_DIR] package_dir

Positional arguments:
  package_dir        Package directory to create __init__.pyi

Optional arguments:
  -h, --help         show this help message and exit
  --out-dir OUT_DIR  Output directory. If the option is unset, __init__.pyi
                     will be generated in the same directory as package_dir.

Metadata

Release files for genmypy 0.3.2

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

Source distribution (sdist)

Source distribution for genmypy 0.3.2
File Size Uploaded Provenance Actions
genmypy-0.3.2.tar.gz 14.7 kB Without provenance Details for genmypy-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genmypy 0.3.2
File Interpreter ABI Platform Actions
genmypy-0.3.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for genmypy-0.3.2-py2.py3-none-any.whl

Total release size: 29.5 kB

Release files / genmypy-0.3.2.tar.gz

Download URL genmypy-0.3.2.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
576ea0c16c3de4705c66f1a8d2f48539569abbe27b976032a2956e2f3f270f9c
BLAKE2b-256 checksum
How to use checksums
7d9508bce4dcc659952a9e48b4efff67ef24b8cbc05d119be50626446d2cc24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release files / genmypy-0.3.2-py2.py3-none-any.whl

Download URL genmypy-0.3.2-py2.py3-none-any.whl
Size 14.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
083cfd3df4a57f829f60cc6a56b56bac32220832b2f8cea6afbc3d145a943707
BLAKE2b-256 checksum
How to use checksums
c0faf1cf175a0ec9f42c05e0d48d93a2a0eed4be31a3815582a0812170c46dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Security for genmypy 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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