{"id":23509033,"url":"https://github.com/pinecrew/tini","last_synced_at":"2025-04-16T19:21:34.073Z","repository":{"id":46071314,"uuid":"53844646","full_name":"pinecrew/tini","owner":"pinecrew","description":"tiny ini parsing library in rust","archived":false,"fork":false,"pushed_at":"2021-11-16T15:34:51.000Z","size":297,"stargazers_count":18,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T03:17:45.987Z","etag":null,"topics":["config","crate","ini","library","no-dependencies","parsing","rust","rust-lang","rust-library","tiny"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tini","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pinecrew.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-03-14T09:48:25.000Z","updated_at":"2024-05-31T16:06:10.000Z","dependencies_parsed_at":"2022-09-26T20:40:38.519Z","dependency_job_id":null,"html_url":"https://github.com/pinecrew/tini","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecrew%2Ftini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecrew%2Ftini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecrew%2Ftini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecrew%2Ftini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinecrew","download_url":"https://codeload.github.com/pinecrew/tini/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249268448,"owners_count":21240928,"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","crate","ini","library","no-dependencies","parsing","rust","rust-lang","rust-library","tiny"],"created_at":"2024-12-25T11:37:10.305Z","updated_at":"2025-04-16T19:21:34.038Z","avatar_url":"https://github.com/pinecrew.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tini \u0026mdash; A tiny INI parsing library\n\n![Rust](https://github.com/pinecrew/tini/workflows/Rust/badge.svg)\n[![Crates](https://img.shields.io/crates/v/tini.svg)](https://crates.io/crates/tini)\n[![Docs](https://docs.rs/tini/badge.svg)](https://docs.rs/tini)\n\n## Usage\n\nAdd `tini` to your `Cargo.toml`, for example:\n```toml\n[dependencies]\ntini = \"1.3\"\n```\n\n## How to use\n\n#### Read ini configuration from file\n\n```rust\nextern crate tini;\nuse tini::Ini;\n\nfn main() {\n    // Read example.ini file from examples directory\n    let config = Ini::from_file(\"./examples/example.ini\").unwrap();\n    // Read name3 key from section_one\n    let name3: String = config.get(\"section_one\", \"name3\").unwrap();\n    // Read list of values\n    let frst5: Vec\u003cbool\u003e = config.get_vec(\"section_three\", \"frst5\").unwrap();\n    println!(\"name3 = {}\", name3);\n    println!(\"frst5 = {:?}\", frst5);\n    // Result:\n    // name3 = example text\n    // frst5 = [true, false, true]\n}\n```\n\n#### Create ini configuration and write to file\n\n```rust\nextern crate tini;\nuse tini::Ini;\n\nfn main() {\n    // Create ini structure\n    let conf = Ini::new()                                          // initialize Ini\n                   .section(\"params\")                              // create `params` section\n                   .item(\"pi\", 3.14)                               // add `pi` key\n                   .item_vec(\"lost\", \u0026[4, 8, 15, 16, 23, 42])      // add `lost` list\n                   .section(\"other\")                               // create another section\n                   .item(\"default\", \"hello world!\");               // add `default` key to `other` section\n    // At any time you can add new parameters to the last created section\n    // \u003c some code \u003e\n    // Now write ini structure to file\n    conf.to_file(\"output.ini\").unwrap();\n    // Now `output.ini` contains\n    // -----------------------------\n    // [params]\n    // pi = 3.14\n    // lost = 4, 8, 15, 16, 23, 42\n    //\n    // [other]\n    // default = hello world!\n    // -----------------------------\n}\n```\n\nSee more examples in [documentation](https://docs.rs/tini).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinecrew%2Ftini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinecrew%2Ftini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinecrew%2Ftini/lists"}