nanopb
Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for use in microcontrollers, but fits any memory restricted system.
Decision gist · record as of 2026-08-14
Yes, if you are building embedded C/C++ systems that need Protocol Buffer serialization. The active maintenance, permissive license, and wide integration with embedded platforms make it a solid choice. Install only if you have a C build system in place and need to generate code from .proto files; this is a build-time tool, not a runtime library for Python applications.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires protobuf as a runtime dependency; C compiler and build system (Make, CMake, SCons, or Bazel) needed to compile the generated .pb.c and .pb.h files into your embedded project.
- Low install friction with a single runtime dependency on protobuf.
- The package is actively maintained with a recent release and 5520 repository stars, indicating stable community adoption.
License · maintenance · safety
Zlib (permissive) — Licensed under Zlib (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
last release 2024-12-01 (621 days) · last repo commit 2026-07-24 · 5,520 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 422,615 downloads/mo, #6,780 on PyPI
Alternatives
Verify before relying
pip install nanopb
# Generate C code from a .proto file
python -m nanopb.generator myprotocol.proto
# Or use the generator directly
from nanopb import generator
# Integrate with your build system to compile .pb.c and .pb.h files- Whether the PyPI package includes precompiled generator binaries or requires Python to run the generator
- Performance characteristics or code-size benchmarks compared to other embedded protobuf implementations
- Support status for Protocol Buffer versions beyond the current release cycle
What it is and what it does
Nanopb is a Protocol Buffer compiler and runtime library designed for embedded systems and memory-constrained devices. It takes standard .proto files and generates minimal C code (pb_encode.c, pb_decode.c, pb_common.c) that can be compiled into your project. Unlike the full protobuf library, nanopb prioritizes small code size and low memory footprint, making it suitable for microcontrollers and other resource-limited environments.
The package provides a Python-based code generator that runs on your development machine to produce the C headers and source files from your .proto definitions. It integrates with common build systems (Make, CMake, SCons, Bazel, Conan) and platforms (Arduino, Zephyr, PlatformIO). The generated code depends only on protobuf as a runtime dependency for the generator itself, while the compiled C output has minimal external dependencies, making it ideal for bare-metal or deeply embedded applications.
Use it for
- Generate compact C serialization code for IoT devices and microcontroller firmware that need to exchange structured data over limited bandwidth or storage.
- Build embedded systems that communicate with cloud services using Protocol Buffers without the overhead of a full protobuf runtime library.
- Integrate Protocol Buffer message definitions into Arduino or STM32 projects where code size and memory are critical constraints.
- Create firmware for devices running on Zephyr RTOS or other embedded operating systems that require efficient message serialization.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building embedded C/C++ systems that need Protocol Buffer serialization.
The active maintenance, permissive license, and wide integration with embedded platforms make it a solid choice. Install only if you have a C build system in place and need to generate code from .proto files; this is a build-time tool, not a runtime library for Python applications.
Install
nanopb on PyPI
Before you install
Low install friction with a single runtime dependency on protobuf. The package is actively maintained with a recent release and 5520 repository stars, indicating stable community adoption.
Requires protobuf as a runtime dependency; C compiler and build system (Make, CMake, SCons, or Bazel) needed to compile the generated .pb.c and .pb.h files into your embedded project.
License in practice
Licensed under Zlib (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install nanopb
# Generate C code from a .proto file
python -m nanopb.generator myprotocol.proto
# Or use the generator directly
from nanopb import generator
# Integrate with your build system to compile .pb.c and .pb.h files
Verify before relying
- Whether the PyPI package includes precompiled generator binaries or requires Python to run the generator
- Performance characteristics or code-size benchmarks compared to other embedded protobuf implementations
- Support status for Protocol Buffer versions beyond the current release cycle
Package facts
| License | Zlib permissive |
| Python support | Supports the current Python release >=2.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageprotobuf |
| Maintenance | Actively maintained 621 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 422,615 / month, #6,780 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI ApprovedProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Build Tools |
Evidence: nanopb-0.4.9.1-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “protobuf code generator embedded”
- nanopbNanopb is a code generator and runtime library that compiles Protocol…
- pbtoolsGenerates C source code from Protocol Buffer proto3 definitions and…
- protoc-gen-connect-pythonA protoc plugin that generates Python client and server code for the…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also proto-plus · dbt-protos · hatch-protobuf · pbtools · barectf · pioarduino · protoc-wheel-0 · setuptools-protobuf · aristaproto