{"id":23188465,"url":"https://github.com/connorslade/rust-configparser","last_synced_at":"2025-04-05T05:44:50.724Z","repository":{"id":48292198,"uuid":"383905664","full_name":"connorslade/Rust-ConfigParser","owner":"connorslade","description":"⚙ Very simple config parsing lib for rust","archived":false,"fork":false,"pushed_at":"2021-11-05T03:32:39.000Z","size":50,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T08:07:25.623Z","etag":null,"topics":["ini","ini-parser","parser","rust","rust-crate"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/simple_config_parser","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/connorslade.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}},"created_at":"2021-07-07T19:31:13.000Z","updated_at":"2023-03-03T08:19:16.000Z","dependencies_parsed_at":"2022-09-26T20:31:55.683Z","dependency_job_id":null,"html_url":"https://github.com/connorslade/Rust-ConfigParser","commit_stats":null,"previous_names":["connorslade/rust-configparser","basicprogrammer10/rust-configparser"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorslade%2FRust-ConfigParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorslade%2FRust-ConfigParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorslade%2FRust-ConfigParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorslade%2FRust-ConfigParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connorslade","download_url":"https://codeload.github.com/connorslade/Rust-ConfigParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294463,"owners_count":20915338,"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":["ini","ini-parser","parser","rust","rust-crate"],"created_at":"2024-12-18T11:14:49.710Z","updated_at":"2025-04-05T05:44:50.708Z","avatar_url":"https://github.com/connorslade.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-ConfigParser [![CI](https://github.com/Basicprogrammer10/Rust-ConfigParser/actions/workflows/main.yml/badge.svg)](https://github.com/Basicprogrammer10/Rust-ConfigParser/actions/workflows/main.yml) ![Crates.io](https://img.shields.io/crates/d/simple_config_parser) ![Lines of code](https://img.shields.io/tokei/lines/github/Basicprogrammer10/Rust-ConfigParser)\n⚙ Very simple config parsing lib for rust!\n\nI made this because I just needed a simple config parser for one of my projects and wanted to learn how to make a rust crate. Hopefully you will find it useful as well. :P\n\n## 💠 Install\n\nJust add the following to your `Cargo.toml`:\n```toml\n[dependencies]\nsimple_config_parser = \"1.0.0\"\n```\n\n## 📀 Quick Start\n\nThis config parser is made for use with a simplified version of an ini file. There are no sections and currently no Escape character support.\n```ini\n; This is a comment\n# This is also a comment\nhello = World\nrust = Is great\ntest = \"TEST\"\n```\n\n## 🐳 Why\n\nThere are already a few config parsers out there for rust so why use this one?\n\nThere are a few reasons:\n- It's super simple to use\n- Its faster then some other popular config parsers (by only a few hundred Nano seconds but still)\n- It's code is easy to understand (For me at least)\n- It would make me happy (:P)\n\n## 💥 Examples\n\nCreate a new config from text and a file.\n```rust\n// Import Lib\nuse simple_config_parser::Config;\n\n// Create a new config and parse text\nlet cfg = Config::new()\n    .text(\"hello = world\")\n    .unwrap();\n\n// Create a new config from a file\nlet cfg2 = Config::new()\n    .file(\"config.cfg\")\n    .unwrap();\n```\n\nGet a value from a config.\n```rust\n// Import Lib\nuse simple_config_parser::Config;\n\n// Create a new config with no file\nlet cfg = Config::new()\n    .text(\"hello = World\\nrust = Is great\")\n    .unwrap();\n\n// Get a value from the config (As a string)\nprintln!(\"Hello, {}\", cfg.get_str(\"hello\").unwrap());\n```\n\nGet value from a config as any type that implements FromStr.\n```rust\n// Import Lib\nuse simple_config_parser::Config;\n\n// Create a new config with no file\nlet mut cfg = Config::new()\n    .text(\"hello = true\\nrust = 15\\npi = 3.1415926535\")\n    .unwrap();\n\n// Get a value from the config as bool\nassert_eq!(cfg.get::\u003cbool\u003e(\"hello\").unwrap(), true);\n\n// Get a value from the config as int\nassert_eq!(cfg.get::\u003ci32\u003e(\"rust\").unwrap(), 15);\n\n// Get a value from the config as float\nassert_eq!(cfg.get::\u003cf32\u003e(\"pi\").unwrap(), 3.1415926535);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorslade%2Frust-configparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnorslade%2Frust-configparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorslade%2Frust-configparser/lists"}