{"id":13998090,"url":"https://github.com/andrewhickman/protox","last_synced_at":"2025-04-09T11:06:32.346Z","repository":{"id":38970950,"uuid":"460616706","full_name":"andrewhickman/protox","owner":"andrewhickman","description":"A pure-rust protobuf compiler, designed for use with prost-build","archived":false,"fork":false,"pushed_at":"2025-03-08T21:39:48.000Z","size":880,"stargazers_count":81,"open_issues_count":5,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T10:08:28.221Z","etag":null,"topics":["compiler","protobuf","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewhickman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2022-02-17T21:37:56.000Z","updated_at":"2025-03-29T11:05:16.000Z","dependencies_parsed_at":"2024-01-15T19:44:01.273Z","dependency_job_id":"b2e06082-8b1d-4cd0-a1e2-d036f9e6ab35","html_url":"https://github.com/andrewhickman/protox","commit_stats":{"total_commits":374,"total_committers":2,"mean_commits":187.0,"dds":0.005347593582887722,"last_synced_commit":"4f784daa1428b50288dabee6648de4cb82701215"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewhickman%2Fprotox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewhickman%2Fprotox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewhickman%2Fprotox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewhickman%2Fprotox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewhickman","download_url":"https://codeload.github.com/andrewhickman/protox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027407,"owners_count":21035594,"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":["compiler","protobuf","rust"],"created_at":"2024-08-09T19:01:23.393Z","updated_at":"2025-04-09T11:06:32.311Z","avatar_url":"https://github.com/andrewhickman.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/protox.svg)](https://crates.io/crates/protox/)\n[![docs.rs](https://docs.rs/protox/badge.svg)](https://docs.rs/protox/)\n[![deps.rs](https://deps.rs/crate/protox/0.7.2/status.svg)](https://deps.rs/crate/protox)\n![MSRV](https://img.shields.io/badge/rustc-1.70+-blue.svg)\n[![Continuous integration](https://github.com/andrewhickman/protox/actions/workflows/ci.yml/badge.svg)](https://github.com/andrewhickman/protox/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/andrewhickman/protox/branch/main/graph/badge.svg?token=9YKHGUUPUX)](https://codecov.io/gh/andrewhickman/protox)\n![Apache 2.0 OR MIT licensed](https://img.shields.io/badge/license-Apache2.0%2FMIT-blue.svg)\n\n# protox\n\nAn implementation of the protobuf compiler in rust, intended for use as a library with crates such as [`prost-build`](https://crates.io/crates/prost-build) to avoid needing to build `protoc`.\n\n## Examples\n\nCompiling a single source file:\n\n```rust\nassert_eq!(protox::compile([\"root.proto\"], [\".\"]).unwrap(), FileDescriptorSet {\n    file: vec![\n        FileDescriptorProto {\n            name: Some(\"root.proto\".to_owned()),\n            /* ... */\n        }\n    ],\n});\n```\n\nUsage with [`prost-build`](https://crates.io/crates/prost-build):\n\n```rust\nlet file_descriptors = protox::compile([\"root.proto\"], [\".\"]).unwrap();\nprost_build::compile_fds(file_descriptors).unwrap();\n```\n\nUsage with [`tonic-build`](https://crates.io/crates/tonic-build):\n\n```rust\nlet file_descriptors = protox::compile([\"root.proto\"], [\".\"]).unwrap();\n\ntonic_build::configure()\n    .build_server(true)\n    .compile_fds(file_descriptors)\n    .unwrap();\n```\n\n### Error messages\n\nThis crate uses [`miette`](https://crates.io/crates/miette) to add additional details to errors. For nice error messages, add `miette` as a dependency with the `fancy` feature enabled and return a [`miette::Result`](https://docs.rs/miette/latest/miette/type.Result.html) from your build script.\n\n```rust\nfn main() -\u003e miette::Result\u003c()\u003e {\n  let _ = protox::compile([\"root.proto\"], [\".\"])?;\n\n  Ok(())\n}\n```\n\nExample error message:\n\n```\nError:\n  × name 'Bar' is not defined\n   ╭─[root.proto:3:1]\n 3 │ message Foo {\n 4 │     Bar bar = 1;\n   ·     ─┬─\n   ·      ╰── found here\n 5 │ }\n   ╰────\n```\n\n## Minimum Supported Rust Version\n\nRust **1.70** or higher.\n\nThe minimum supported Rust version may be changed in the future, but it will be\ndone with a minor version bump.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\nThis project includes code imported from the Protocol Buffers project, which is\nincluded under its original ([BSD][2]) license.\n\n[2]: https://github.com/protocolbuffers/protobuf/blob/master/LICENSE\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n## Related projects\n\n  * [prost](https://crates.io/crates/prost) - a protocol buffers implementation for the Rust Language\n  * [protoxy](https://github.com/tardyp/protoxy) - python bindings for protox","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewhickman%2Fprotox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewhickman%2Fprotox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewhickman%2Fprotox/lists"}