Skip to main content

genpyi

A Python stub generator from genmsg specs

Installation

pip install genpyi

Usage

catkin

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

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

Examples:

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

CLI

$ genpyi --help
Usage: genpyi [-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
$ genpyi msg custom_msgs custom_msgs/msg/Custom.msg
$ genpyi msg std_msgs --out-dir out /opt/ros/melodic/share/std_msgs/msg/Header.msg
$ genpyi msg sensor_msgs --out-dir out \
    -Istd_msgs:/opt/ros/melodic/share/std_msgs/msg \
    -Isensor_msgs:/opt/ros/melodic/share/sensor_msgs/msg \
    /opt/ros/melodic/share/sensor_msgs/msg/PointCloud2.msg

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

# Module files
$ genpyi module custom_msgs/msg
$ genpyi module --module-finder py --out out \
    /opt/ros/melodic/lib/python2.7/dist-packages/std_msgs/msg/
  • genpyi msg / genpyi srv
    Usage: genpyi {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
    
  • genpyi module
    Usage: genpyi 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 genpyi 0.1.0

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

Source distribution (sdist)

Source distribution for genpyi 0.1.0
File Size Uploaded Provenance Actions
genpyi-0.1.0.tar.gz 13.6 kB Without provenance Details for genpyi-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.1 kB

Release files / genpyi-0.1.0.tar.gz

Download URL genpyi-0.1.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
465f7dd8c9d976427e01bfc627782bbf797cea8d5b62036018ddfa2e3db11768
BLAKE2b-256 checksum
How to use checksums
7a33cbbf33b0022838404441115e3c0170f690c41b4f3310f04750b8ee2dbed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release files / genpyi-0.1.0-py2.py3-none-any.whl

Download URL genpyi-0.1.0-py2.py3-none-any.whl
Size 14.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5243e40170a3d734680f0f1af991cdd354a64a405102f18b10796af81fb57cc8
BLAKE2b-256 checksum
How to use checksums
b663463a8996506786477c3613011923ea7776eef0897f4197269545ebecfaea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Security for genpyi 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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