{"id":13439870,"url":"https://github.com/nanopb/nanopb","last_synced_at":"2025-05-13T20:04:33.827Z","repository":{"id":31246084,"uuid":"34807561","full_name":"nanopb/nanopb","owner":"nanopb","description":"Protocol Buffers with small code size","archived":false,"fork":false,"pushed_at":"2025-04-28T10:38:58.000Z","size":4471,"stargazers_count":4648,"open_issues_count":77,"forks_count":908,"subscribers_count":116,"default_branch":"master","last_synced_at":"2025-05-06T18:39:46.357Z","etag":null,"topics":["c","embedded","embedded-c","nanopb","protocol-buffers"],"latest_commit_sha":null,"homepage":"https://jpa.kapsi.fi/nanopb/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nanopb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-04-29T17:21:37.000Z","updated_at":"2025-05-05T20:02:22.000Z","dependencies_parsed_at":"2023-10-15T06:16:11.669Z","dependency_job_id":"cc08f2ce-af8a-4ccc-bab1-2b5f1245da90","html_url":"https://github.com/nanopb/nanopb","commit_stats":{"total_commits":1427,"total_committers":154,"mean_commits":9.266233766233766,"dds":0.255781359495445,"last_synced_commit":"fd299d8b6a34c54b1c76a823c7645155c50ff77d"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopb%2Fnanopb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopb%2Fnanopb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopb%2Fnanopb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopb%2Fnanopb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanopb","download_url":"https://codeload.github.com/nanopb/nanopb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253539850,"owners_count":21924517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","embedded","embedded-c","nanopb","protocol-buffers"],"created_at":"2024-07-31T03:01:17.790Z","updated_at":"2025-05-13T20:04:33.796Z","avatar_url":"https://github.com/nanopb.png","language":"C","readme":"Nanopb - Protocol Buffers for Embedded Systems\n==============================================\n\n![Latest change](https://github.com/nanopb/nanopb/actions/workflows/trigger_on_code_change.yml/badge.svg)\n![Weekly build](https://github.com/nanopb/nanopb/actions/workflows/trigger_on_schedule.yml/badge.svg)\n\nNanopb is a small code-size Protocol Buffers implementation in ansi C. It is\nespecially suitable for use in microcontrollers, but fits any memory\nrestricted system.\n\n* **Homepage:** https://jpa.kapsi.fi/nanopb/\n* **Git repository:** https://github.com/nanopb/nanopb/\n* **Documentation:** https://jpa.kapsi.fi/nanopb/docs/\n* **Forum:** https://groups.google.com/forum/#!forum/nanopb\n* **Stable version downloads:** https://jpa.kapsi.fi/nanopb/download/\n* **Pre-release binary packages:** https://github.com/nanopb/nanopb/actions/workflows/binary_packages.yml\n\n\nUsing the nanopb library\n------------------------\nTo use the nanopb library, you need to do two things:\n\n1. Compile your .proto files for nanopb, using `protoc`.\n2. Include *pb_encode.c*, *pb_decode.c* and *pb_common.c* in your project.\n\nThe easiest way to get started is to study the project in \"examples/simple\".\nIt contains a Makefile, which should work directly under most Linux systems.\nHowever, for any other kind of build system, see the manual steps in\nREADME.txt in that folder.\n\n\nGenerating the headers\n----------------------\nProtocol Buffers messages are defined in a `.proto` file, which follows a standard\nformat that is compatible with all Protocol Buffers libraries. To use it with nanopb,\nyou need to generate `.pb.c` and `.pb.h` files from it:\n\n    python generator/nanopb_generator.py myprotocol.proto  # For source checkout\n    generator-bin/nanopb_generator myprotocol.proto        # For binary package\n\n(Note: For instructions for nanopb-0.3.9.x and older, see the documentation\nof that particular version [here](https://github.com/nanopb/nanopb/blob/maintenance_0.3/README.md))\n\nThe binary packages for Windows, Linux and Mac OS X should contain all necessary\ndependencies, including Python, python-protobuf library and protoc. If you are\nusing a git checkout or a plain source distribution, you will need to install\nPython separately. Once you have Python, you can install the other dependencies\nwith `pip install --upgrade protobuf grpcio-tools`.\n\nYou can further customize the header generation by creating an `.options` file.\nSee [documentation](https://jpa.kapsi.fi/nanopb/docs/concepts.html#modifying-generator-behaviour) for details.\n\n\nRunning the tests\n-----------------\nIf you want to perform further development of the nanopb core, or to verify\nits functionality using your compiler and platform, you'll want to run the\ntest suite. The build rules for the test suite are implemented using Scons,\nso you need to have that installed (ex: `sudo apt install scons` or `pip install scons`).\nTo run the tests:\n\n    cd tests\n    scons\n\nThis will show the progress of various test cases. If the output does not\nend in an error, the test cases were successful.\n\nNote: Mac OS X by default aliases 'clang' as 'gcc', while not actually\nsupporting the same command line options as gcc does. To run tests on\nMac OS X, use: `scons CC=clang CXX=clang++`. Same way can be used to run\ntests with different compilers on any platform.\n\nFor embedded platforms, there is currently support for running the tests\non STM32 discovery board and [simavr](https://github.com/buserror/simavr)\nAVR simulator. Use `scons PLATFORM=STM32` and `scons PLATFORM=AVR` to run\nthese tests.\n\n\nBuild systems and integration\n-----------------------------\nNanopb C code itself is designed to be portable and easy to build\non any platform. Often the bigger hurdle is running the generator which\ntakes in the `.proto` files and outputs `.pb.c` definitions.\n\nThere exist build rules for several systems:\n\n* **Makefiles**: `extra/nanopb.mk`, see `examples/simple`\n* **CMake**: `extra/FindNanopb.cmake`, see `examples/cmake`\n* **SCons**: `tests/site_scons` (generator only)\n* **Bazel**: `BUILD.bazel` in source root\n* **Conan**: `conanfile.py` in source root\n* **PlatformIO**: https://platformio.org/lib/show/431/Nanopb\n* **PyPI/pip**: https://pypi.org/project/nanopb/\n* **vcpkg**: https://vcpkg.io/en/package/nanopb\n\nAnd also integration to platform interfaces:\n\n* **Arduino**: http://platformio.org/lib/show/1385/nanopb-arduino\n* **Zephyr**: https://docs.zephyrproject.org/latest/services/serialization/nanopb.html\n\n","funding_links":[],"categories":["Serialization","C","正则表达式","Data Encoding","Protocols"],"sub_categories":["序列化","Protocol Buffers","Flash Memory"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanopb%2Fnanopb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanopb%2Fnanopb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanopb%2Fnanopb/lists"}