{"id":16742056,"url":"https://github.com/k9withabone/compose_spec_rs","last_synced_at":"2025-03-21T22:31:35.965Z","repository":{"id":223507526,"uuid":"760128366","full_name":"k9withabone/compose_spec_rs","owner":"k9withabone","description":"Rust library for (de)serializing from/to the compose-spec","archived":false,"fork":false,"pushed_at":"2024-06-04T16:49:21.000Z","size":442,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-29T09:27:45.076Z","etag":null,"topics":["compose","compose-spec","containers","docker","docker-compose","podman","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/compose_spec","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k9withabone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-02-19T20:46:25.000Z","updated_at":"2024-06-04T15:59:55.000Z","dependencies_parsed_at":"2024-03-28T17:25:48.217Z","dependency_job_id":"13b95902-a004-4073-8743-282ea4ad0b22","html_url":"https://github.com/k9withabone/compose_spec_rs","commit_stats":null,"previous_names":["k9withabone/compose_spec_rs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k9withabone%2Fcompose_spec_rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k9withabone%2Fcompose_spec_rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k9withabone%2Fcompose_spec_rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k9withabone%2Fcompose_spec_rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k9withabone","download_url":"https://codeload.github.com/k9withabone/compose_spec_rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880241,"owners_count":20525505,"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":["compose","compose-spec","containers","docker","docker-compose","podman","rust"],"created_at":"2024-10-13T01:08:39.421Z","updated_at":"2025-03-21T22:31:35.493Z","avatar_url":"https://github.com/k9withabone.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compose_spec\n\n[![Crates.io Version](https://img.shields.io/crates/v/compose_spec?style=flat-square\u0026logo=rust)](https://crates.io/crates/compose_spec)\n[![Crates.io MSRV](https://img.shields.io/crates/msrv/compose_spec?style=flat-square\u0026logo=rust)](#minimum-supported-rust-version-msrv)\n[![docs.rs](https://img.shields.io/docsrs/compose_spec?style=flat-square\u0026logo=rust)](https://docs.rs/compose_spec)\n[![License](https://img.shields.io/crates/l/compose_spec?style=flat-square)](./LICENSE)\n[![GitHub Actions CI Workflow Status](https://img.shields.io/github/actions/workflow/status/k9withabone/compose_spec_rs/ci.yaml?branch=main\u0026style=flat-square\u0026logo=github\u0026label=ci)](https://github.com/k9withabone/compose_spec_rs/actions/workflows/ci.yaml?query=branch%3Amain)\n\n`compose_spec` is a [Rust] library crate for (de)serializing from/to the [Compose specification].\n\n`compose_spec` strives for:\n\n- Idiomatic Rust 🦀\n  - Uses semantically appropriate types from the standard library like `PathBuf` and `Duration`.\n- Correctness\n  - Values are fully validated and parsed.\n  - Enums are used for fields which conflict with each other. For example, in `services`, `network_mode` and `networks` are combined into `network_config`.\n- Ease of use\n  - Fully documented, though the [documentation] could be fleshed out more with examples and explanations, help in this regard would be appreciated!\n  - Helpful functions such as conversion between short and long syntax forms of values with multiple representations (e.g. `build` and `ports`).\n\nSee the [documentation] for more details.\n\n## Examples\n\n```rust\nuse compose_spec::{Compose, Service, service::Image};\n\nlet yaml = \"\\\nservices:\n  caddy:\n    image: docker.io/library/caddy:latest\n    ports:\n      - 8000:80\n      - 8443:443\n    volumes:\n      - ./Caddyfile:/etc/caddy/Caddyfile\n      - caddy-data:/data\nvolumes:\n  caddy-data:\n\";\n\n// Deserialize `Compose`\nlet compose: Compose = serde_yaml::from_str(yaml)?;\n\n// Serialize `Compose`\nlet value = serde_yaml::to_value(\u0026compose)?;\n\n// Get the `Image` of the \"caddy\" service\nlet caddy: Option\u003c\u0026Service\u003e = compose.services.get(\"caddy\");\nlet image: \u0026Option\u003cImage\u003e = \u0026caddy.unwrap().image;\nlet image: \u0026Image = image.as_ref().unwrap();\n\nassert_eq!(image, \"docker.io/library/caddy:latest\");\nassert_eq!(image.name(), \"docker.io/library/caddy\");\nassert_eq!(image.tag(), Some(\"latest\"));\n```\n\n## Minimum Supported Rust Version (MSRV)\n\nThe minimum version of the Rust compiler `compose_spec` can currently compile with is 1.70, which is tested in CI.\nIncreasing the MSRV is **not** considered to be a breaking change.\n\n## Contribution\n\nContributions, suggestions, and/or comments are appreciated! Feel free to create an [issue](https://github.com/k9withabone/compose_spec_rs/issues), [discussion](https://github.com/k9withabone/compose_spec_rs/discussions), or [pull request](https://github.com/k9withabone/compose_spec_rs/pulls).\nGenerally, it is preferable to start a discussion for a feature request or open an issue for reporting a bug before submitting changes with a pull request.\n\n### Project Layout\n\n`compose_spec` is composed of two packages set up in a Cargo workspace. The root package, `compose_spec`, is the main library.\nThe other package, `compose_spec_macros`, located in a directory of the same name, is a procedural macro library used in `compose_spec`. `compose_spec_macros` is not designed to be used outside the `compose_spec` library.\n\n### Local CI\n\nIf you are submitting code changes in a pull request and would like to run the CI jobs locally, use the following commands:\n\n- format: `cargo fmt --check --all`\n- clippy: `cargo clippy --workspace --tests`\n- test: `cargo test --workspace -- --include-ignored`\n- doc: `cargo doc --workspace --document-private-items`\n- docs-rs:\n  - Install the nightly Rust toolchain, `rustup toolchain install nightly`.\n  - Install [cargo-docs-rs](https://github.com/dtolnay/cargo-docs-rs).\n  - `cargo docs-rs`\n- spellcheck:\n  - Install [typos](https://github.com/crate-ci/typos).\n  - `typos`\n- msrv:\n  - Install [cargo-msrv](https://github.com/foresterre/cargo-msrv).\n  - `cargo msrv verify`\n- minimal-versions:\n  - Install the nightly Rust toolchain, `rustup toolchain install nightly`.\n  - Install [cargo-hack](https://github.com/taiki-e/cargo-hack).\n  - Install [cargo-minimal-versions](https://github.com/taiki-e/cargo-minimal-versions).\n  - `cargo minimal-versions check --workspace`\n  - `cargo minimal-versions test --workspace`\n- semver-checks:\n  - Install [cargo-semver-checks](https://github.com/obi1kenobi/cargo-semver-checks-action).\n  - `cargo semver-checks`\n\n## License\n\nAll source code for `compose_spec` is licensed under the [Mozilla Public License v2.0](https://www.mozilla.org/en-US/MPL/).\nView the [LICENSE](./LICENSE) file for more information.\n\nThe [Compose specification] itself is licensed under the [Apache License v2.0](https://www.apache.org/licenses/LICENSE-2.0).\nSee that project's [LICENSE](https://github.com/compose-spec/compose-spec/blob/master/LICENSE) file for more information.\n\n[Compose specification]: https://github.com/compose-spec/compose-spec\n[documentation]: https://docs.rs/compose_spec\n[Rust]: https://www.rust-lang.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk9withabone%2Fcompose_spec_rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk9withabone%2Fcompose_spec_rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk9withabone%2Fcompose_spec_rs/lists"}