anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…

Google’s open source way to describe structured data in a .proto file and read and write it from many languages. The setup notes cover the protoc compiler and the runtimes for Python, Java, Kotlin, C#, Ruby, PHP, C++ and more.
Protocol Buffers is an open-source project on GitHub in the Developer category, listed by Mindket. It is free. This is version 2, last updated on . Install it from GitHub as its README says. Get Mindket’s setup notes on your Mindket account, as a zip.
apt install -y protobuf-compiler protoc --version pip install protobuf
Protocol Buffers, called protobuf for short, is Google’s language-neutral, platform-neutral, extensible way to serialize structured data. You describe your data once in a .proto file. The compiler, protoc, turns that file into code for your language. A runtime library for that language then writes and reads the data. This listing carries setup notes for protoc and for each runtime documented in the main repository, and links to the separate repositories for Go, Dart and JavaScript.
Developers who pass structured data between services or keep it in files, and want a typed schema, compact messages and generated code. It suits teams that mix languages, such as a Java service and a Python job that share one .proto file. The overview says protobuf is most often used to define communications protocols together with gRPC, and for data storage. Skip it when a single message runs past a few megabytes, or when people need to read the data without the .proto file.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Backend services | Engineers whose services and jobs share data | Keep one .proto file and generate code in each language | The overview’s case: a Java program writes a message, and a Python application on another platform reads values from it. |
| Service APIs | Teams that define communication protocols | Describe messages and services in .proto files and pair them with gRPC | The overview names gRPC, Google Cloud and Envoy Proxy among the projects that use Protobuf. |
| Data storage | Developers who keep records on disk | Write messages to a file and read them back with the same generated class | The Python tutorial’s address book saves an AddressBook message with SerializeToString() and reads it back with ParseFromString(). |
| Android apps | Android developers | Use the Java Lite runtime, which the Java README recommends for its smaller code size | A project uses the Bazel rule java_lite_proto_library for Android, as the README names it. |
| Learning | People new to protobuf | Follow the tutorial for their language and build the address book example | A learner runs make python in the examples folder and gets add_person_python and list_people_python. |
protoc installs on Linux, macOS and Windows, and the runtimes cover the languages below. The setup notes cover them, and link to the separate repositories for Go, Dart and JavaScript.
Get it saves a zip of Mindket’s setup notes in your downloads folder, with a page for each runtime documented in the main repository, from the maker’s README and docs. First get protoc, then the runtime for your language.
| Need | Detail |
|---|---|
| protoc | A zip from the GitHub releases page, or a package from apt, Homebrew or winget |
| A runtime | The package for your language, such as protobuf on pip |
| Matching versions | Keep the runtime at the same version as protoc. The Java README says match or newer, and the examples README says the same version for Python |
| curl and jq | Only for the installation page’s command that fetches the release zip |
| An account or key | None. The install steps ask for none |
apt install -y protobuf-compiler protoc --version pip install protobuf
The first two lines are the installation page’s Linux route, and the third installs the Python runtime. On a Mac the page gives brew install protobuf, and on Windows winget install protobuf, each followed by protoc --version. Without a package manager, download the zip for your system from the releases page, unzip it under $HOME/.local and add the folder with protoc to your PATH. The kit shows every command.
Write the shape of your data in a .proto file, compile it, then use the generated class. This is the overview’s example message.
edition = "2023";
message Person {
string name = 1;
int32 id = 2;
string email = 3;
}The numbers are tags. Each field keeps its tag in the binary encoding, and the Python tutorial says tags 1 to 15 take one byte less to encode than higher ones. Compile for Python with the tutorial’s line, which names a source directory, a destination directory and the .proto path.
protoc --proto_path=$SRC_DIR --python_out=$DST_DIR $SRC_DIR/addressbook.proto
That writes addressbook_pb2.py into the destination folder. The tutorial then writes a message with SerializeToString() and reads one with ParseFromString(data). Other languages swap the option: --java_out, --kotlin_out, --csharp_out, --ruby_out and --php_out are the ones the READMEs name.
You want one file that two languages read. The examples README builds an address book program for each language, and says you can create an address book with add_person_java and read it with list_people_python.
export CLASSPATH=/path/to/protobuf-java-[version].jar make java make python
Run add_person_java with a file name to create the address book, then list_people_python with the same file name to read it. The README shows the form ./add_person_cpp addressbook.data for C++ and says the Python scripts work the same way. You get one data file that programs in two languages share.
If you are new. Think of a .proto file as a typed form for your data. protoc reads it and writes classes with a getter and a setter for each field, plus methods that turn the whole message into bytes and back. The overview says Protobuf is like JSON, except smaller and faster. The tutorials assume you know nothing about it, only that you can write code and handle files in your language. The Tutorials page has one for C++, C#, Dart, Go, Java, Kotlin and Python.
For experts. The overview says a deleted field’s number must never be reused, so reserve it. Old code reads new messages and ignores added fields, and new code reads old messages with defaults for what is missing, as long as you follow the update practices on protobuf.dev. The same data can serialize to many different byte strings, so two messages cannot be compared for equality without parsing them.
Python has three backends with one API. The upb backend is the default and ships in the PyPI packages, cpp is deprecated and no longer released there, and python is the pure backend. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION to choose one, and print this to see which you have. The README says this is not an officially-supported or stable API, but it is useful for ad hoc diagnostics.
from google.protobuf.internal import api_implementation print(api_implementation.Type())
Building from source needs care. The README says builds from the head of main break now and then, and that even release branches can be unstable between release commits, so pin to a release commit. The C++ README warns that two versions of its runtime are unlikely to be ABI compatible, so recompile after an upgrade or link statically.
The install steps are ordinary package and build steps, and a few of them reach the network.
This kit holds setup notes only. Mindket wrote them. Protocol Buffers, also called protobuf, is Google's open source project, and it installs from its own repository: https://github.com/protocolbuffers/protobuf
These notes are not made or endorsed by Google. The README opens with "Protocol Buffers - Google's data interchange format" and says "Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data." The documentation is at https://protobuf.dev. Source: https://github.com/protocolbuffers/protobuf/blob/main/README.md
License: the LICENSE file (https://github.com/protocolbuffers/protobuf/blob/main/LICENSE) reads "Copyright 2008 Google Inc. All rights reserved." and holds the three conditions of a BSD-style license: keep the copyright notice in source, reproduce it in the documentation or other materials that come with a binary, and do not use Google's or the contributors' names to endorse a product made from it without written permission. It ends with a paragraph on generated code: "Code generated by the Protocol Buffer compiler is owned by the owner of the input file used when generating it. This code is not standalone and requires a support library to be linked with it. This support library is itself covered by the above license." GitHub's repository page lists the license as "Other" and gives no SPDX name for it.
A schema language, a compiler and a set of runtime libraries. You describe your data in a .proto file. The compiler, protoc, turns that file into code for your language. The runtime library for the language reads and writes the data. The README says that to install protobuf you need two things: the protocol compiler, and the protobuf runtime for your chosen programming language. Source: README.md
The README's runtime table sends you to one place for each language. Source: README.md
src folder of the repositoryjava folderpython folderobjectivec foldercsharp folderruby folderphp folderTwo parts, as the README says: the compiler, then the runtime for your language. The compiler comes from a pre-built binary on the releases page, from a package manager, or from a build of the source. The runtime comes from your language's package manager, or from a build of the source. The notes below give the maker's command for each.
protobuf package, the three backends and the generated files--csharp_out option--ruby_out and --php_out optionsThe README says most users will find working from supported releases the easiest path. If you work from the head of the main branch, the build will occasionally break from source-incompatible changes and insufficiently tested behavior. If you use C++ or need to build protobuf from source as part of your project, the README says to pin to a release commit on a release branch, because even release branches can be unstable between release commits. Source: README.md
Update the compiler the way you installed it: download a newer release zip, or upgrade the package with your package manager (Mindket's note, not the maker's). Keep the runtime's version in step with the compiler's: the Java README says to match it or be newer, and the examples README says the Python runtime must be the same version as protoc, or it may not work. The README gives no uninstall steps. To remove a release zip install, delete the files you unzipped and the line you added to your path. To remove a package, use your package manager's own uninstall command (Mindket's note, not the maker's).
git clone https://github.com/protocolbuffers/protobuf.git) downloads from GitHub, the Bazel WORKSPACE route's http_archive downloads from its url, and go install google.golang.org/protobuf/cmd/protoc-gen-go@latest fetches the Go plugin.README.md 6 KB setup/cpp-bazel-cmake.md 6 KB setup/csharp.md 2 KB setup/examples-and-tutorials.md 4 KB setup/install-protoc.md 3 KB setup/java-and-kotlin.md 4 KB setup/other-languages.md 3 KB setup/python.md 4 KB setup/ruby-and-php.md 4 KB
Updated by Mindket to the current version of this kit.
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.