{"id":20285456,"url":"https://github.com/mramshaw/protobufs","last_synced_at":"2025-12-02T03:02:31.341Z","repository":{"id":92905679,"uuid":"166280227","full_name":"mramshaw/protobufs","owner":"mramshaw","description":"Compare and contrast \"protobuf\" usage in Python and Golang","archived":false,"fork":false,"pushed_at":"2019-01-21T17:51:08.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T03:44:38.437Z","etag":null,"topics":["go","golang","protobuf","protobuf-golang","protobuf-python","protobuf3","protocol-buffers","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mramshaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-17T19:03:10.000Z","updated_at":"2019-01-21T17:51:09.000Z","dependencies_parsed_at":"2023-04-29T00:55:15.354Z","dependency_job_id":null,"html_url":"https://github.com/mramshaw/protobufs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mramshaw/protobufs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2Fprotobufs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2Fprotobufs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2Fprotobufs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2Fprotobufs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mramshaw","download_url":"https://codeload.github.com/mramshaw/protobufs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2Fprotobufs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27444387,"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","status":"online","status_checked_at":"2025-12-02T02:00:06.387Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","protobuf","protobuf-golang","protobuf-python","protobuf3","protocol-buffers","python","python3"],"created_at":"2024-11-14T14:26:49.682Z","updated_at":"2025-12-02T03:02:31.312Z","avatar_url":"https://github.com/mramshaw.png","language":"Go","readme":"# protobufs\n\n[![Known Vulnerabilities](http://snyk.io/test/github/mramshaw/protobufs/badge.svg?style=plastic\u0026targetFile=requirements.txt)](http://snyk.io/test/github/mramshaw/protobufs?style=plastic\u0026targetFile=requirements.txt)\n\nCompare and contrast \"protobuf\" usage in Python and Golang\n\n## Overview\n\nGoogle describes `protobufs` as:\n\n\u003e a language-neutral, platform-neutral, extensible way of serializing\n\u003e structured data for use in communications protocols, data storage,\n\u003e and more\n\nHaving previously investigated protobufs and gRPC with Golang, they\nnaturally sprang to mind when I was investigating language-agnostic\n[data interchange formats](https://github.com/mramshaw/Pickles#to-do).\n\nOf course, protobufs also seem to be the clear winner when it comes\nto wire protocols as well, although other alternatives include Avro\nand Thrift (and - if efficiency is not a concern - JSON and XML too).\n\n## Golang\n\nInstall the Golang protobuf compiler as follows:\n\n    $ go get -u github.com/golang/protobuf/protoc-gen-go\n\n[Although I would really prefer to use `vgo` instead.]\n\nGenerate code as follows:\n\n    $ cd golang\n    $ ./build_golang.sh\n    $\n\nCreate an address book entry as follows:\n\n```bash\n$ go run add_person.go ../AddressBook\n../AddressBook: File not found.  Creating new file.\nEnter person ID number: 2\nEnter name: Wilma\nEnter email address (blank for none): wilma@b.com\nEnter a phone number (or leave blank to finish): 555-555-2121\nIs this a mobile, home, or work phone? home\nEnter a phone number (or leave blank to finish):\n$\n```\n\nList the address book as follows:\n\n```bash\n$ go run list_people.go ../AddressBook\nPerson ID: 2\n  Name: Wilma\n  E-mail address: wilma@b.com\n  Home phone #: 555-555-2121\n$\n```\n\n## Python\n\nAs usual, install dependencies with `pip` (or `pip3` for Python 3):\n\n    $ pip install --user -r requirements.txt\n\nGenerate code as follows:\n\n    $ cd python\n    $ ./build_python.sh\n    $\n\nCreate an address book entry as follows:\n\n```bash\n$ python add_person.py ../AddressBook\n../AddressBook: File not found.  Creating a new file.\nEnter person ID number: 4\nEnter name: Fred\nEnter email address (blank for none): fred@a.com\nEnter a phone number (or leave blank to finish): 555-555-1212\nIs this a mobile, home, or work phone? mobile\nEnter a phone number (or leave blank to finish):\n$\n```\n\nList the address book as follows:\n\n```bash\n$ python list_people.py ../AddressBook\nPerson ID: 4\n  Name: Fred\n  E-mail address: fred@a.com\n  Mobile phone #: 555-555-1212\n$\n```\n\n## Versions\n\n* Go __1.11__\n* protobuf (Golang) __v1.2.0__\n* protobuf (Python) __3.6.1__\n* Python __2.7.12__\n\n## Reference\n\nBeing a Google thing, they are the place to go for help.\n\n    http://developers.google.com/protocol-buffers/\n\n[It's worth noting that protobufs are NOT human-readable and only have\n meaning with respect to a __.proto__ file - which defines the format\n of all messages. Neither are they ___self-describing___ (like XML).]\n\nProto style guide:\n\n    http://developers.google.com/protocol-buffers/docs/style\n\nProto 3 language guide:\n\n    http://developers.google.com/protocol-buffers/docs/proto3\n\nGolang:\n\n    http://github.com/golang/protobuf\n\nPython:\n\n    http://pypi.org/project/protobuf/\n\n## To Do\n\n- [x] Add a badge for Snyk.io vulnerability scanning\n- [ ] Add more __proto__ use cases for comparison purposes\n- [ ] Investigate Golang protobufs using `vgo` (latest Go package manager)\n- [ ] Investigate [pystream-protobuf](http://pypi.org/project/pystream-protobuf/)\n- [ ] Investigate [read-protobuf](http://libraries.io/pypi/read-protobuf)\n\n## Credits\n\nGolang:\n\n    http://developers.google.com/protocol-buffers/docs/gotutorial\n\n[Uses protobuf format 3.]\n\nPython:\n\n    http://developers.google.com/protocol-buffers/docs/pythontutorial\n\n[Uses protobuf format 2, which we will update to format 3. In fact,\n we will use the same __proto__ file for both - now that's language\n agnostic!]\n\nExample Golang and Python code from:\n\n    http://github.com/protocolbuffers/protobuf/tree/master/examples\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmramshaw%2Fprotobufs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmramshaw%2Fprotobufs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmramshaw%2Fprotobufs/lists"}