{"id":18725067,"url":"https://github.com/kondrak/codespawn","last_synced_at":"2026-03-15T21:11:12.151Z","repository":{"id":57607795,"uuid":"61804000","full_name":"kondrak/codespawn","owner":"kondrak","description":"Code generator written in Rust","archived":false,"fork":false,"pushed_at":"2023-07-11T21:30:13.000Z","size":97,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T10:21:13.020Z","etag":null,"topics":["code-generation","codegeneration","codegenerator","rust"],"latest_commit_sha":null,"homepage":null,"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/kondrak.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}},"created_at":"2016-06-23T12:37:45.000Z","updated_at":"2025-02-26T10:29:50.000Z","dependencies_parsed_at":"2022-08-28T08:21:09.964Z","dependency_job_id":null,"html_url":"https://github.com/kondrak/codespawn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kondrak%2Fcodespawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kondrak%2Fcodespawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kondrak%2Fcodespawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kondrak%2Fcodespawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kondrak","download_url":"https://codeload.github.com/kondrak/codespawn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591903,"owners_count":21130146,"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":["code-generation","codegeneration","codegenerator","rust"],"created_at":"2024-11-07T14:09:00.509Z","updated_at":"2026-03-15T21:11:07.111Z","avatar_url":"https://github.com/kondrak.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Codespawn\n=========\n\n[![Crates.io](https://img.shields.io/crates/v/codespawn.svg)](https://crates.io/crates/codespawn)\n[![Documentation](https://docs.rs/codespawn/badge.svg)](https://docs.rs/codespawn)\n[![CI](https://github.com/kondrak/codespawn/actions/workflows/rust.yml/badge.svg)](https://github.com/kondrak/codespawn/actions/workflows/rust.yml)\n[![Coverage Status](https://coveralls.io/repos/github/kondrak/codespawn/badge.svg?branch=master)](https://coveralls.io/github/kondrak/codespawn?branch=master)\n![](https://img.shields.io/crates/l/json.svg)\n\nCodespawn is a basic C++ and Rust code generator. Desired API can be defined using either JSON or XML and the crate supports both reading from a file or a string. Currently it's possible to generate enums, structs, functions, function pointers, variables and bitflags with all applicable attributes and properties.\n\nThis crate was created as a helper tool for [ProDBG](https://github.com/emoon/ProDBG). See [example XML](https://github.com/kondrak/codespawn/blob/master/examples/sample.xml) for instructions on how to construct the API definition.\n\n[Documentation](https://docs.rs/codespawn)\n\nUsage\n-----\n```toml\n# Cargo.toml\n[dependencies]\ncodespawn = \"0.3\"\n```\n\nExample\n-------\n```rust\nextern crate codespawn;\n\nfn main()\n{\n    // generate from XML definition\n    let raw_code = codespawn::from_xml(\"examples/sample.xml\").unwrap();\n    // generate from JSON definition\n    //let raw_code = codespawn::from_json(\"examples/sample.json\").unwrap();\n\n    // generate code, store as String\n    let cpp_code  = raw_code.to_cpp().unwrap().to_string();\n    let rust_code = raw_code.to_rust().unwrap().to_string();\n\n    // generate and save directly to file\n    raw_code.to_cpp().unwrap().to_file(\"sample.cpp\");\n    raw_code.to_rust().unwrap().to_file(\"sample.rs\");\n}\n```\n\nBuild instructions\n------------------\n\n```\ncargo build\ncargo run --example xml\ncargo run --example json\n```\n\nThis will run the [example](https://github.com/kondrak/codespawn/blob/master/examples/xml.rs) which will generate code and save it to files using sample XML definition.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkondrak%2Fcodespawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkondrak%2Fcodespawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkondrak%2Fcodespawn/lists"}