https://github.com/fleshgrinder/python-buf-exe
PyPI packaged Buf
https://github.com/fleshgrinder/python-buf-exe
buf protobuf protocol-buffers pypi-package python
Last synced: 14 days ago
JSON representation
PyPI packaged Buf
- Host: GitHub
- URL: https://github.com/fleshgrinder/python-buf-exe
- Owner: Fleshgrinder
- License: unlicense
- Created: 2023-02-27T10:04:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T22:19:48.000Z (over 1 year ago)
- Last Synced: 2025-08-16T15:36:37.872Z (10 months ago)
- Topics: buf, protobuf, protocol-buffers, pypi-package, python
- Language: Python
- Homepage: https://pypi.org/project/buf-exe
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

Python Buf Executable
PyPI packaged Buf CLI
A PyPI package providing a pip-installable [buf] executable.
This package does not provide any Python code, it provides just the unaltered
`buf` executable.
If you want to use `buf` for code generation you might also want to check out
[protoc-exe].
> **Note** that this project is not affiliated with or endorsed by Buf
> Technologies. The `-exe` suffix in the name was chosen to ensure that the
> `buf` 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 `buf` 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 `buf` releases with 24 hours.
## Usage
Simply use `buf` 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 `buf` (or `buf.exe` on Windows) is found.
For instance, you could use `pip` and a basic virtual environment:
```python
# example.py
import subprocess
subprocess.check_call(["command", "-v", "buf"])
subprocess.check_call(["buf", "--version"])
```
```shell
cd /tmp
python -m venv venv
source venv/bin/activate
pip install buf-exe
command -v buf # /tmp/venv/bin/buf
buf --version # x.y.z
python example.py
# /tmp/venv/bin/buf
# 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.
[buf]: https://buf.build/
[protoc-exe]: https://github.com/fleshgrinder/python-protoc-exe