{"id":18398086,"url":"https://github.com/oskaritimperi/nimpb","last_synced_at":"2025-07-26T08:38:55.324Z","repository":{"id":141041990,"uuid":"126868064","full_name":"oskaritimperi/nimpb","owner":"oskaritimperi","description":"Protocol Buffers for Nim","archived":false,"fork":false,"pushed_at":"2021-08-29T09:23:16.000Z","size":335,"stargazers_count":38,"open_issues_count":4,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T16:18:53.215Z","etag":null,"topics":["library","nim","nimpb","protobuf","protocol-buffers","serialization"],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oskaritimperi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-03-26T17:55:06.000Z","updated_at":"2024-08-18T06:37:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"10f63ead-4fee-44e0-9fe7-6a8d6386fa07","html_url":"https://github.com/oskaritimperi/nimpb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oskaritimperi/nimpb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oskaritimperi%2Fnimpb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oskaritimperi%2Fnimpb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oskaritimperi%2Fnimpb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oskaritimperi%2Fnimpb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oskaritimperi","download_url":"https://codeload.github.com/oskaritimperi/nimpb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oskaritimperi%2Fnimpb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267141164,"owners_count":24041982,"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-07-26T02:00:08.937Z","response_time":62,"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":["library","nim","nimpb","protobuf","protocol-buffers","serialization"],"created_at":"2024-11-06T02:19:46.188Z","updated_at":"2025-07-26T08:38:55.295Z","avatar_url":"https://github.com/oskaritimperi.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protocol Buffers for Nim\n\n[![Build Status](https://travis-ci.org/oswjk/nimpb.svg?branch=master)](https://travis-ci.org/oswjk/nimpb)\n\nA Nim library to serialize/deserialize Protocol Buffers.\n\nTo actually generate Nim code from protobuf definitions, you need the protoc\ntool. To make things simple, nimpb depends on\n[nimpb_protoc](https://github.com/oswjk/nimpb_protoc), which bundles protoc\nbinaries for the most common platforms (Windows, Linux, macOS).\n\n**NOTE** At the moment this is at a very rough state. Do not use for any kind of production use. Anything can change at any time. You've been warned.\n\n# Example\n\nGiven the following file:\n\n```\nsyntax = \"proto3\";\n\nmessage Test1 {\n    int32 a = 1;\n\n    enum MyEnum {\n        Foo = 0;\n        Bar = 1;\n    }\n\n    MyEnum e = 2;\n}\n```\n\nYou can use nimpb_build (a tool that comes with nimpb) to generate code like this (procs not included in the example):\n\n```nim\ntype\n    Test1_MyEnum* {.pure.} = enum\n        Foo = 0\n        Bar = 1\n\n    Test1* = ref Test1Obj\n    Test1Obj* = object of RootObj\n        a: int32\n        e: MyEnum\n```\n\nAnd you can use the generated code like this:\n\n```nim\nlet message = newTest1()\nmessage.a = 150\nmessage.e = Test1_MyEnum.Bar\n\nlet data = serialize(message)\n\nlet message2 = newTest1(data)\n\nassert message2.a == 150\nassert message2.e == Test1_MyEnum.Bar\n```\n\n# Other libraries\n\nIf you do not want to depend on the `protoc` compiler, check Peter Munch-Ellingsen's [protobuf library](https://github.com/PMunch/protobuf-nim). It handles parsing of the protobuf files in compile time which can make building simpler.\n\n# Services\n\nFor an example about how to generate services, see [nimtwirp](https://github.com/oswjk/nimtwirp).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foskaritimperi%2Fnimpb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foskaritimperi%2Fnimpb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foskaritimperi%2Fnimpb/lists"}