{"id":13822740,"url":"https://github.com/pleshevskiy/enve","last_synced_at":"2025-05-16T17:31:49.616Z","repository":{"id":47953518,"uuid":"229549656","full_name":"pleshevskiy/enve","owner":"pleshevskiy","description":"It helps you work with environment variables and convert it to any type using only type annotations.","archived":true,"fork":false,"pushed_at":"2022-12-24T15:35:16.000Z","size":220,"stargazers_count":47,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-20T01:04:02.694Z","etag":null,"topics":["config","env","environment","rust","rust-lang","web"],"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/pleshevskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-22T10:13:28.000Z","updated_at":"2023-03-01T15:58:55.000Z","dependencies_parsed_at":"2023-01-30T20:50:22.008Z","dependency_job_id":null,"html_url":"https://github.com/pleshevskiy/enve","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleshevskiy%2Fenve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleshevskiy%2Fenve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleshevskiy%2Fenve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleshevskiy%2Fenve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleshevskiy","download_url":"https://codeload.github.com/pleshevskiy/enve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225442976,"owners_count":17475150,"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":["config","env","environment","rust","rust-lang","web"],"created_at":"2024-08-04T08:02:15.356Z","updated_at":"2024-11-19T23:31:04.054Z","avatar_url":"https://github.com/pleshevskiy.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# enve\n\n[![Crates.io](https://img.shields.io/crates/v/enve?style=flat-square)](https://crates.io/crates/enve)\n[![docs.rs](https://img.shields.io/docsrs/enve?style=flat-square)](https://docs.rs/enve)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pleshevskiy/enve/CI?label=tests\u0026logo=github\u0026style=flat-square)](https://github.com/pleshevskiy/enve/actions/workflows/ci.yml)\n![The MSRV](https://img.shields.io/badge/MSRV-1.59.0-red.svg)\n\n```toml\n[dependencies]\nenve = \"0.3\"\n```\n\n`enve` helps you work with environment variables and convert it to **any type**\nusing only **type annotations**.\n\nAll standard environment variable types are included, but `enve` under the hood\nuses [estring](https://github.com/pleshevskiy/estring), so you can easily create\nyour own type.\n\n## [Documentation](https://docs.rs/enve)\n\nLook at the [examples] to see the power!\n\n[examples]: https://github.com/pleshevskiy/enve/tree/main/examples\n\n## Usage\n\nBasic\n\n```rust\nfn main() -\u003e Result\u003c(), enve::Error\u003e {\n    enve::sset(\"E\", \"10\");\n\n    let res: f32 = enve::get(\"E\")?;\n\n    println!(\"result: {}\", res);\n\n    Ok(())\n}\n```\n\nYou can use predefined structs like `SepVec` if you enable `structs` feature.\n\nNote: You can use custom types as annotations! Just implement `ParseFragment`.\n\n```rust\nuse enve::SepVec;\n\ntype PlusVec\u003cT\u003e = SepVec\u003cT, '+'\u003e;\ntype MulVec\u003cT\u003e = SepVec\u003cT, '*'\u003e;\n\nfn main() -\u003e Result\u003c(), enve::Error\u003e {\n    enve::sset(\"E\", \"10+5*2+3\");\n\n    let res: f32 = enve::get::\u003cPlusVec\u003cMulVec\u003cf32\u003e\u003e\u003e(\"E\")\n        .unwrap()\n        .iter()\n        .map(|m| m.iter().product::\u003cf32\u003e())\n        .sum::\u003cf32\u003e();\n\n    assert_eq!(res, 23.0);\n\n    Ok(())\n}\n```\n\nYou can also use predefined aggregators if you enable `aggs` feature.\n\n```rust\nuse enve::{SepVec, Product, Sum, estring::Aggregate};\n\ntype PlusVec\u003cT\u003e = SepVec\u003cT, '+'\u003e;\ntype MulVec\u003cT\u003e = SepVec\u003cT, '*'\u003e;\n\nfn main() -\u003e Result\u003c(), enve::Error\u003e {\n    enve::sset(\"E\", \"10+5*2+3\");\n\n    let res: f32 = enve::get::\u003cSum\u003cPlusVec\u003cProduct\u003cMulVec\u003cf32\u003e\u003e\u003e\u003e\u003e(\"E\")?\n        .agg();\n\n    assert_eq!(res, 23.0);\n\n    Ok(())\n}\n```\n\n## Contact Us\n\nJoin us in:\n\n[![Matrix](https://img.shields.io/badge/matrix-%23enve_team:matrix.org-blueviolet.svg?style=flat-square)](https://matrix.to/#/#enve_team:matrix.org)\n\n## License\n\n**MIT**. See [LICENSE](https://github.com/pleshevskiy/estring/LICENSE) to see\nthe full text.\n\n## Contributors\n\n[pleshevskiy](https://github.com/pleshevskiy) (Dmitriy Pleshevskiy) – creator,\nmaintainer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleshevskiy%2Fenve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleshevskiy%2Fenve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleshevskiy%2Fenve/lists"}