{"id":20227239,"url":"https://github.com/salaros/config-parser","last_synced_at":"2025-04-10T17:20:40.835Z","repository":{"id":60773178,"uuid":"39292912","full_name":"salaros/config-parser","owner":"salaros","description":"A slim, fully managed C# library for reading/writing .ini, .conf, .cfg etc configuration files.","archived":false,"fork":false,"pushed_at":"2022-08-08T16:45:02.000Z","size":332,"stargazers_count":116,"open_issues_count":13,"forks_count":18,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T13:44:08.285Z","etag":null,"topics":["cfg","conf","config","configs","configuration","configuration-file","configuration-files","cross-platform","csharp","dotnet","file","ini","managed","mono"],"latest_commit_sha":null,"homepage":"https://salaros.com","language":"C#","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/salaros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"salaros","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"salaros","issuehunt":null,"otechie":null,"custom":"https://www.paypal.me/salarosUSA"}},"created_at":"2015-07-18T09:10:06.000Z","updated_at":"2025-02-20T01:20:51.000Z","dependencies_parsed_at":"2022-10-04T15:27:23.078Z","dependency_job_id":null,"html_url":"https://github.com/salaros/config-parser","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaros%2Fconfig-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaros%2Fconfig-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaros%2Fconfig-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaros%2Fconfig-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salaros","download_url":"https://codeload.github.com/salaros/config-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248176894,"owners_count":21060133,"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":["cfg","conf","config","configs","configuration","configuration-file","configuration-files","cross-platform","csharp","dotnet","file","ini","managed","mono"],"created_at":"2024-11-14T07:23:38.549Z","updated_at":"2025-04-10T17:20:40.800Z","avatar_url":"https://github.com/salaros.png","language":"C#","readme":"﻿ConfigParser\n[![Build status](https://ci.appveyor.com/api/projects/status/08aiy2tgs7n3y2fg?svg=true)](https://ci.appveyor.com/project/salaros/configparser)\n[![AppVeyor tests branch](https://img.shields.io/appveyor/tests/salaros/configparser/master.svg)](https://ci.appveyor.com/project/salaros/configparser/build/tests)\n[![Coverage Status](https://coveralls.io/repos/github/salaros/config-parser/badge.svg?branch=master)](https://coveralls.io/github/salaros/config-parser?branch=master)\n=============\n\n![GitHub top language](https://img.shields.io/github/languages/top/salaros/config-parser.svg?colorB=333333)\n[![.NET Standard](https://img.shields.io/badge/cross%20platform-yes-45a234.svg)](https://en.wikipedia.org/wiki/Cross-platform)\n[![.NET Standard](https://img.shields.io/badge/.NET%20Standard-2.0+-484877.svg)](https://social.msdn.microsoft.com/Forums/vstudio/en-US/7035edc6-97fc-49ee-8eee-2fa4d040a63b/)\n[![.NET Framework](https://img.shields.io/badge/.NET%20Framework-4.0+-748478.svg)](https://social.msdn.microsoft.com/Forums/vstudio/en-US/7035edc6-97fc-49ee-8eee-2fa4d040a63b/)\n\n[![License](https://img.shields.io/github/license/salaros/config-parser.svg)](https://github.com/salaros/configparser/blob/master/LICENSE)\n[![NuGet](https://img.shields.io/nuget/v/Salaros.ConfigParser.svg?label=NuGet\u0026colorA=004880\u0026colorB=CFC76B)](https://www.nuget.org/packages/Salaros.ConfigParser)\n[![NuGet Pre Release](https://img.shields.io/nuget/vpre/Salaros.ConfigParser.svg?label=NuGet%20pre-release\u0026colorA=504880\u0026colorB=CFC76B)](https://www.nuget.org/packages/Salaros.ConfigParser)\n[![NuGet](https://img.shields.io/nuget/dt/Salaros.ConfigParser.svg?colorA=004880\u0026colorB=CFC76B)](https://www.nuget.org/packages/Salaros.ConfigParser)\n\n[![Donate Patreon](https://img.shields.io/badge/donate-Patreon-f96854.svg)](https://www.patreon.com/salaros/)\n[![Donate Paypal](https://img.shields.io/badge/donate-PayPal-009cde.svg)](https://paypal.me/salarosIT)\n[![Donate Liberapay](https://img.shields.io/badge/donate-Liberapay-ffc600.svg)](https://liberapay.com/salaros/)\n\n**ConfigParser** - is a slim, cross-platform, fully managed C# library for reading and writing .ini, .conf, .cfg etc configuration files.\n\nYou could use it in your [Unity 3D](https://unity3d.com/), [Xamarin](http://xamarin.com) (iOS \u0026 Android), .NET Framework applications (even with old 4.0/4.5), .NET Core CLI and ASP.NET Core applications, [Mono](https://www.mono-project.com/) etc\n\nFeatures\n========\n\n## Customization\n\n- [x] customizable encoding (most encodings can be auto-detected)\n- [x] customizable culture\n- [x] customizable number styles (e.g. currencies, exponential notation etc)\n- [x] customizable line endings (usually auto-detected)\n- [x] customizable true and false (e.g. \"verum\" / \"falsum\" )\n- [x] customizable comment characters\n- [x] customizable key/value separator (defaults to '=')\n\n## Read and preserved\n\n- [x] file header comments\n- [x] config files with no sections (like in this [SectionName]) or even mixed: first section has no header, just keys\n- [x] comments in general\n- [x] section comments\n- [x] empty lines\n- [x] indented sections\n- [x] indented keys\n- [x] indented values\n\n## Values\n\n- [x] default values\n- [x] multi-line values (both quoted and not)\n- [x] quoted values\n- [x] null values (value-less keys)\n- [x] array values\n- [x] fancy float / double\n- [x] byte-encoded values\n- [x] smart boolean values (0/1, on/off, enabled/disabled work of the box)\n\nand more...\n\n## 🟊🟊🟊 Support this project 🟊🟊🟊\n\nYou can support us in a small way, please consider starring and sharing this repo! It helps us getting known and grow the community.\n\n![star us](.github/assets/star_us.gif)\n\nInstallation\n============\n\n**Config Parser** can be installed via [NuGet](https://www.nuget.org/packages/Salaros.ConfigParser)\nby using Package Manager in your IDE, `dotnet` binary or Package Console\n\n```bash\n# Add the Salaros.ConfigParser package to a project named [\u003cPROJECT\u003e]\ndotnet add [\u003cPROJECT\u003e] package Salaros.ConfigParser\n```\n\nor Visual Studio's Package Console\n\n```powershell\n# Add the Salaros.ConfigParser package to the default project\nInstall-Package Salaros.ConfigParser\n\n# Add the Salaros.ConfigParser package to a project named [\u003cPROJECT\u003e]\nInstall-Package Salaros.ConfigParser -ProjectName [\u003cPROJECT\u003e]\n```\n\nUsage\n=====\n\n```csharp\n// Initialize config file instance from file\nvar configFileFromPath = new ConfigParser(@\"path\\to\\configfile.cnf\");\n\n// Parse text\nvar configFileFromString = new ConfigParser(@\"\n    [Strings]\n        canBeIndented = value\n    andQuoted = \"\"quotes will be stripped\"\"\n\n    [Numbers]\n    withD = 0.6D\n    dollars = $2,999\n\n    [boolean]\n    numericTrue = 1\n    textFalse = true\n    yesWorks = yes\n    upperCaseWorks = on\n    worksAsWell = Enabled\n\n    [Advanced]\n    arrayWorkToo =\n        arrayElement1\n        arrayElement2\n    valueLessKey\",\n    new ConfigParserSettings\n    {\n        MultiLineValues = MultiLineValues.Simple | MultiLineValues.AllowValuelessKeys | MultiLineValues.QuoteDelimitedValues,\n        Culture = new CultureInfo(\"en-US\")\n    }\n);\n\nconfigFileFromString.GetValue(\"Strings\", \"canBeIndented\");          // value\nconfigFileFromString[\"Strings\"][\"canBeIndented\"];                   // returns 'value' too\nconfigFileFromString.GetValue(\"Strings\", \"andQuoted\");              // quotes will be stripped\n\nconfigFileFromString.GetValue(\"Numbers\", \"withD\", 0D);              // 0,6\nconfigFileFromString.GetValue(\"Numbers\", \"dollars\", 0D,             // 2999\n    NumberStyles.AllowCurrencySymbol);\nconfigFileFromString.GetValue(\"Numbers\", \"dollars\");                // $2,999\n\nconfigFileFromString.GetValue(\"boolean\", \"numericTrue\", false);     // True\nconfigFileFromString.GetValue(\"boolean\", \"textFalse\", false);       // True\nconfigFileFromString.GetValue(\"boolean\", \"yesWorks\", false);        // True\nconfigFileFromString.GetValue(\"boolean\", \"upperCaseWorks\", false);  // True\nconfigFileFromString.GetValue(\"boolean\", \"worksAsWell\", false);     // True\n\nconfigFileFromString.GetArrayValue(\"Advanced\", \"arraysWorkToo\");     // [\"arrayElement1\",\"arrayElement2\"]\nconfigFileFromString.GetValue(\"Advanced\", \"valueLessKey\");          //\n```\n\nHow to build\n============\n\nYou need Git and [.NET Core SDK](https://www.microsoft.com/net/download/)\n\n```bash\ngit clone https://github.com/salaros/ConfigParser\ncd ConfigParser\ndotnet build\n```\n\nHow to test\n===========\n\n**ConfigParser** uses [xUnit.net](https://xunit.github.io/), so you can run unit tests by simply using the following command:\n\n```bash\ndotnet test tests\n```\n\nLicense\n=======\n\n**ConfigParser** is distributed under the [MIT license](LICENSE), which grants you\n\n- [x] Private use\n- [x] Commercial use\n- [x] Modification\n- [x] Distribution\n\nHowever you have to include the content of [license](LICENSE) file in your source code (if you distribute your Software in text form), otherwise include it in your own LICENSE file or to some sort of **About -\u003e Open-source libraries** section if you distribute your Software as a compiled library / binary.\nHere is why (part of [MIT license](LICENSE)):\n\n```\nThe above copyright notice and this permission notice \nshall be included in all copies or substantial portions of the Software.\n```\n","funding_links":["https://patreon.com/salaros","https://liberapay.com/salaros","https://www.paypal.me/salarosUSA","https://www.patreon.com/salaros/","https://paypal.me/salarosIT","https://liberapay.com/salaros/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaros%2Fconfig-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalaros%2Fconfig-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaros%2Fconfig-parser/lists"}