{"id":19958271,"url":"https://github.com/lerouxrgd/rsgen-avro","last_synced_at":"2026-03-07T21:06:57.174Z","repository":{"id":41329955,"uuid":"151474802","full_name":"lerouxrgd/rsgen-avro","owner":"lerouxrgd","description":"Command line and library for generating Rust types from Avro schemas","archived":false,"fork":false,"pushed_at":"2026-01-14T23:46:58.000Z","size":499,"stargazers_count":44,"open_issues_count":7,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-17T17:51:04.939Z","etag":null,"topics":["avro-schema","code-generation","command-line","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/lerouxrgd.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-03T20:16:36.000Z","updated_at":"2026-01-14T23:46:24.000Z","dependencies_parsed_at":"2026-01-17T08:04:18.719Z","dependency_job_id":null,"html_url":"https://github.com/lerouxrgd/rsgen-avro","commit_stats":{"total_commits":142,"total_committers":13,"mean_commits":"10.923076923076923","dds":0.5492957746478873,"last_synced_commit":"77e7e34c7e08d9c54008691781dbd746bb93c9f3"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"purl":"pkg:github/lerouxrgd/rsgen-avro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Frsgen-avro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Frsgen-avro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Frsgen-avro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Frsgen-avro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lerouxrgd","download_url":"https://codeload.github.com/lerouxrgd/rsgen-avro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Frsgen-avro/sbom","scorecard":{"id":585546,"data":{"date":"2025-08-11","repo":{"name":"github.com/lerouxrgd/rsgen-avro","commit":"35ae197e648a32ba87aa27d0945b74fd9782a72e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Maintained","score":10,"reason":"20 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":5,"reason":"Found 8/16 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/cd.yaml:1","Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cd.yaml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/lerouxrgd/rsgen-avro/cd.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/lerouxrgd/rsgen-avro/ci.yaml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.18.3 not signed: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/234722456","Warn: release artifact 0.18.2 not signed: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/233347520","Warn: release artifact 0.18.1 not signed: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/228953039","Warn: release artifact 0.18.0 not signed: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/228535785","Warn: release artifact 0.17.0 not signed: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/219639154","Warn: release artifact 0.18.3 does not have provenance: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/234722456","Warn: release artifact 0.18.2 does not have provenance: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/233347520","Warn: release artifact 0.18.1 does not have provenance: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/228953039","Warn: release artifact 0.18.0 does not have provenance: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/228535785","Warn: release artifact 0.17.0 does not have provenance: https://api.github.com/repos/lerouxrgd/rsgen-avro/releases/219639154"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T20:24:50.157Z","repository_id":41329955,"created_at":"2025-08-20T20:24:50.157Z","updated_at":"2025-08-20T20:24:50.157Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29703227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["avro-schema","code-generation","command-line","rust"],"created_at":"2024-11-13T01:41:43.071Z","updated_at":"2026-02-22T01:41:34.137Z","avatar_url":"https://github.com/lerouxrgd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rsgen-avro \u0026emsp; [![latest]][crates.io] [![doc]][docs.rs]\n\n[latest]: https://img.shields.io/crates/v/rsgen-avro.svg\n[crates.io]: https://crates.io/crates/rsgen-avro\n[doc]: https://docs.rs/rsgen-avro/badge.svg\n[docs.rs]: https://docs.rs/rsgen-avro\n\nA command line tool and library for generating [serde][]-compatible Rust types from\n[Avro schemas][schemas]. The [apache-avro][] crate, which is re-exported, provides a way to\nread and write Avro data with such types.\n\n## Command line usage\n\nDownload the latest [release](https://github.com/lerouxrgd/rsgen-avro/releases).\n\nAvailable options `rsgen-avro --help`:\n\n```text\nGenerate Rust types from Avro schemas\n\nUsage: rsgen-avro [OPTIONS] \u003cGLOB_PATTERN\u003e \u003cOUTPUT_FILE\u003e\n\nArguments:\n  \u003cGLOB_PATTERN\u003e  Glob pattern to select Avro schema files\n  \u003cOUTPUT_FILE\u003e   The file where Rust types will be written, '-' for stdout\n\nOptions:\n      --fmt                      Run rustfmt on the resulting \u003coutput-file\u003e\n      --nullable                 Replace null fields with their default value when deserializing\n      --precision \u003cP\u003e            Precision for f32/f64 default values that aren't round numbers [default: 3]\n      --union-deser              Custom deserialization for apache-avro multi-valued union types\n      --chrono-dates             Use chrono::NaiveDateTime for date/timestamps logical types\n      --derive-builders          Derive builders for generated record structs\n      --impl-schemas \u003cMETHOD\u003e    Implement AvroSchema for generated record structs [default: none] [possible values: derive, copy-build-schema, none]\n      --extra-derives \u003cDERIVES\u003e  Extract Derives for generated record structs, comma separated, e.g. `std::fmt::Display,std::string::ToString`\n  -h, --help                     Print help (see more with '--help')\n  -V, --version                  Print version\n```\n\n## Library usage\n\nAs a library, the basic usage is:\n\n```rust\nuse rsgen_avro::{Source, Generator};\n\nlet raw_schema = r#\"\n{\n    \"type\": \"record\",\n    \"name\": \"test\",\n    \"fields\": [\n        {\"name\": \"a\", \"type\": \"long\", \"default\": 42},\n        {\"name\": \"b\", \"type\": \"string\"}\n    ]\n}\n\"#;\n\nlet source = Source::SchemaStr(\u0026raw_schema);\nlet mut out = std::io::stdout();\n\nlet g = Generator::new().unwrap();\ng.generate(\u0026source, \u0026mut out).unwrap();\n```\n\nThis will generate the following output:\n\n```text\n#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)]\npub struct Test {\n    #[serde(default = \"default_test_a\")]\n    pub a: i64,\n    pub b: String,\n}\n\n#[inline(always)]\nfn default_test_a() -\u003e i64 { 42 }\n```\n\nVarious `Schema` sources can be used with `Generator::generate(source, output)` method:\n\n```rust\npub enum Source\u003c'a\u003e {\n    Schema(\u0026'a rsgen_avro::Schema),    // Avro schema enum re-exported from `apache-avro`\n    Schemas(\u0026'a [rsgen_avro::Schema]), // A slice of Avro schema enums\n    SchemaStr(\u0026'a str),                // Schema as a json string\n    GlobPattern(\u0026'a str),              // Glob pattern to select schema files\n}\n```\n\nNote also that the `Generator` can be customized with a builder:\n\n```rust\nlet generator = rsgen_avro::Generator::builder()\n    .precision(2)\n    .build()\n    .unwrap();\n```\n\nSee [GeneratorBuilder][gen-builder-doc] documentation for all available options.\n\n[gen-builder-doc]: https://docs.rs/rsgen-avro/latest/rsgen_avro/struct.GeneratorBuilder.html\n\n## Limitations\n\n- Avro schema `namespace` fields are ignored, therefore record names within a schema\n  (and across schemas) must not conflict (i.e. must be unique).\n- Rust `Option\u003cT\u003e` are supported through Avro unions having `\"null\"` in their first\n  position only (See [#39](https://github.com/lerouxrgd/rsgen-avro/issues/39))\n\n[schemas]: https://avro.apache.org/docs/current/spec.html\n[apache-avro]: https://github.com/apache/avro/tree/master/lang/rust\n[serde]: https://serde.rs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Frsgen-avro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flerouxrgd%2Frsgen-avro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Frsgen-avro/lists"}