Skip to main content

PyPI packaged Protocol Buffers Compiler

Project description

Protobuf Logo
Python Protoc Executable

PyPI packaged Protocol Buffers Compiler

A PyPI package providing a pip-installable protoc executable.

This package does not provide any Python code, it provides just the unaltered protoc executable. The versioning thus also follows the official versioning of protoc, and is different to the versioning of the protobuf runtime.

The difference of this package to protoc-wheel and protoc-wheel-0 is that those packages wrap the protoc in Python. Whereas this package provides just the protoc executable, without anything else. As a consequence you can directly call protoc after installing this package in your environment. This makes it perfect for providing the protoc executable wherever you need the actual thing to be available in your PATH, e.g. together with buf (if you do you might want to check out buf-exe as well).

Note that this project is not affiliated with or endorsed by Google or the Protobuf team. The -exe suffix in the name was chosen to ensure that the protoc name stays available, just in case there ever is going to be an official package.

Warning the redistribution process is not yet fully automated, as I am in the process of building the tooling. Currently only the latest protoc release is available, and it was created semi-manually with the scripts you currently see in the repository. The plan is to fully automate everything, and provide new protoc releases with 24 hours.

Usage

Simply use protoc as the executable in whatever process abstraction you are using, regardless of your operating system. The only requirement is that your PATH is set correctly so that the protoc (or protoc.exe on Windows) is found. For instance, you could use pip and a basic virtual environment:

# example.py
import subprocess
subprocess.check_call(["command", "-v", "protoc"])
subprocess.check_call(["protoc", "--version"])
cd /tmp
python -m venv venv
source venv/bin/activate
pip install protoc-exe
command -v protoc # /tmp/venv/bin/protoc
protoc --version  # libprotoc x.y[.z]
python example.py
# /tmp/venv/bin/protoc
# libprotoc x.y[.z]
rm -fr venv/

Note that the example uses a POSIX compliant shell, but it works on non-POSIX systems as well. Have a look at the GitHub Actions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

protoc_exe-22.0rc1-py2.py3-none-win_amd64.whl (2.7 MB view hashes)

Uploaded Python 2 Python 3 Windows x86-64

protoc_exe-22.0rc1-py2.py3-none-win32.whl (2.7 MB view hashes)

Uploaded Python 2 Python 3 Windows x86

protoc_exe-22.0rc1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.8 MB view hashes)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

protoc_exe-22.0rc1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view hashes)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

protoc_exe-22.0rc1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view hashes)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

protoc_exe-22.0rc1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view hashes)

Uploaded Python 2 Python 3 manylinux: glibc 2.5+ x86-64

protoc_exe-22.0rc1-py2.py3-none-manylinux_2_5_i686.manylinux1_i686.whl (2.2 MB view hashes)

Uploaded Python 2 Python 3 manylinux: glibc 2.5+ i686

protoc_exe-22.0rc1-py2.py3-none-macosx_11_0_arm64.whl (1.8 MB view hashes)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

protoc_exe-22.0rc1-py2.py3-none-macosx_10_4_x86_64.whl (1.8 MB view hashes)

Uploaded Python 2 Python 3 macOS 10.4+ x86-64

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