{"id":29690460,"url":"https://github.com/oliverzick/delizious-ini","last_synced_at":"2026-04-02T18:25:23.058Z","repository":{"id":259471273,"uuid":"622169254","full_name":"oliverzick/Delizious-Ini","owner":"oliverzick","description":"An easy to use .NET standard library for reading and writing of INI data.","archived":false,"fork":false,"pushed_at":"2025-07-06T15:46:41.000Z","size":511,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T16:37:49.375Z","etag":null,"topics":["file","file-reader","file-writer","ini","ini-parser","reader","reader-writer","writer"],"latest_commit_sha":null,"homepage":"","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/oliverzick.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,"zenodo":null}},"created_at":"2023-04-01T10:26:28.000Z","updated_at":"2025-07-06T15:46:42.000Z","dependencies_parsed_at":"2024-10-25T19:57:17.554Z","dependency_job_id":"a9e1cf98-2f40-47a5-b671-9a0373be8425","html_url":"https://github.com/oliverzick/Delizious-Ini","commit_stats":null,"previous_names":["oliverzick/delizious-ini"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/oliverzick/Delizious-Ini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Ini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Ini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Ini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Ini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverzick","download_url":"https://codeload.github.com/oliverzick/Delizious-Ini/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverzick%2FDelizious-Ini/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266626135,"owners_count":23958347,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["file","file-reader","file-writer","ini","ini-parser","reader","reader-writer","writer"],"created_at":"2025-07-23T06:07:58.380Z","updated_at":"2026-04-02T18:25:22.931Z","avatar_url":"https://github.com/oliverzick.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delizious Ini\n## What?\nDelizious Ini is an easy to use .NET Standard library entirely written in C# for reading and writing of INI data\nthat comes with an intuitive API design applying [Domain-driven design (DDD)](https://en.wikipedia.org/wiki/Domain-driven_design).\n\nIt provides extensive configurability and allows to specify failure behaviors (e.g. throw a specific exception in case a section or property does not exist, or proceed with a fallback behavior) \nfor almost every operation on both instance and operation level.\n\n## New features in version 1.22.0\n* Provide no comment line in an INI document at all when none comment is written for section or property\n\n## Features\nDelizious Ini provides the following features:\n* [Enumeration of sections](#enumeration-of-sections)\n* [Enumeration of properties](#enumeration-of-properties)\n* [Reading of a property](#reading-of-a-property)\n* [Writing of a property](#writing-of-a-property)\n* [Deletion of a section](#deletion-of-a-section)\n* [Deletion of a property](#deletion-of-a-property)\n* [Reading the comment of a section](#reading-the-comment-of-a-section)\n* [Reading the comment of a property](#reading-the-comment-of-a-property)\n* [Writing the comment of a section](#writing-the-comment-of-a-section)\n* [Writing the comment of a property](#writing-the-comment-of-a-property)\n* Cloning an INI document\n* [Configurability](#configure-default-behavior-of-an-ini-document)\n  * [Property enumeration mode](#enumeration-of-properties) (`Fail` or `Fallback`)\n  * [Property read mode](#reading-of-a-property) (`Fail`, `Fallback` or `CustomFallback`)\n  * [Property write mode](#writing-of-a-property) (`Create` or `Update`)\n  * [Section deletion mode](#deletion-of-a-section) (`Fail` or `Ignore`)\n  * [Property deletion mode](#deletion-of-a-property) (`Fail` or `Ignore`)\n  * [Comment read mode](#reading-the-comment-of-a-property) (`Fail`, `Fallback` or `CustomFallback`)\n  * [Comment write mode](#writing-the-comment-of-a-property) (`Fail` or `Ignore`)\n  * Case sensitivity that specifies how to treat section names and property keys (`CaseSensitive` or `CaseInsensitive`)\n  * New line string (`Environment`, `Unix` or `Windows`)\n  * Invalid line behavior (`Fail` or `Ignore`)\n  * Property's assignment separator (defaults to `=`)\n  * Property's assignment spacer (`None` or `Space`)\n  * Duplicate section behavior (`Fail` or `Merge`)\n  * Duplicate property behavior (`Fail`, `Ignore` or `Override`)\n  * Section's beginning and end delimiters (default to `[` and `]`)\n  * Regular expression pattern (regex) for section name\n  * Newline string (`Environment`, `Windows` or `Unix`)\n  * Comment string that indicates the beginning of a comment line (defaults to `;`)\n\nUpcoming features:\n* Merge two INI documents\n\n[\u0026#8593;](#features)\n---\n\n## Getting started\nTo install Delizious Ini, run the following command in the respective console:\n\n### Package Manager Console\n    PM\u003e Install-Package Delizious.Ini\n\n### .NET CLI Console\n    \u003e dotnet add package Delizious.Ini\n\n[\u0026#8593;](#features)\n---\n\n## Quick start\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n                   AnotherProperty=Another value\n\n                   [EmptySection]\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\n\n// Use default configuration \nvar configuration = IniDocumentConfiguration.Default\n                                            .WithCaseSensitivity(CaseSensitivity.CaseSensitive); // Treat section names and property keys as case-sensitive (by default, case-insensitive)\n\nvar iniDocument = IniDocument.LoadFrom(textReader, configuration);\n\n// Read existing property\nvar originalValue = iniDocument.ReadProperty(\"Section\", \"Property\");\nConsole.WriteLine($@\"Original property value: {originalValue}\");\n\n// Update existing property\niniDocument.WriteProperty(\"Section\", \"Property\", \"This is the new value\");\n\nvar updatedValue = iniDocument.ReadProperty(\"Section\", \"Property\");\nConsole.WriteLine($@\"Updated property value: {updatedValue}\");\n\n// Write new property\niniDocument.WriteProperty(\"NewSection\", \"NewProperty\", \"NewValue\");\n\n// Delete section\niniDocument.DeleteSection(\"EmptySection\");\n\n// Delete property\niniDocument.DeleteProperty(\"Section\", \"AnotherProperty\");\n\nConsole.WriteLine();\nConsole.WriteLine(@\"INI document:\");\niniDocument.SaveTo(Console.Out);\n```\n\n[\u0026#8593;](#features)\n---\n\n## Examples\n### Configure default behavior of an INI document\n```cs\n// This configuration represents the loose configuration which is also predefined:\n//var looseConfiguration = IniDocumentConfiguration.Loose;\nvar looseConfiguration =\n    IniDocumentConfiguration.Default\n                            .WithCaseSensitivity(CaseSensitivity.CaseInsensitive)                 // Treat section names and property keys as case-insensitive\n                            .WithNewlineString(NewlineString.Environment)                         // Use newline string as given by current environment\n                            .WithSectionBeginningDelimiter(SectionBeginningDelimiter.Default)     // Use default section beginning delimiter which is opening square bracket '['\n                            .WithSectionEndDelimiter(SectionEndDelimiter.Default)                 // Use default section end delimiter which is closing square bracket ']'\n                            .WithSectionNameRegex(SectionNameRegex.Default)                       // Use default section name regex which is '[\\p{L}\\p{M}\\p{N}\\p{P}\\p{S}\\p{Zs}]+'\n                            .WithDuplicatePropertyBehavior(DuplicatePropertyBehavior.Ignore)      // Ignore subsequent occurrences of a duplicate property by using the first occurrence of such a property\n                            .WithDuplicateSectionBehavior(DuplicateSectionBehavior.Merge)         // Merge a duplicate section\n                            .WithInvalidLineBehavior(InvalidLineBehavior.Ignore)                  // Ignore when a line is invalid and cannot be parsed on loading\n                            .WithPropertyAssignmentSeparator(PropertyAssignmentSeparator.Default) // Use default property assignment separator which is equality sign '='\n                            .WithPropertyAssignmentSpacer(PropertyAssignmentSpacer.None)          // Use no property assignment spacer\n                            .WithPropertyEnumerationMode(PropertyEnumerationMode.Fallback)        // Fallback to empty collection of property keys when section does not exist\n                            .WithPropertyReadMode(PropertyReadMode.Fallback)                      // Fallback to empty string when property to read does not exist\n                            .WithPropertyWriteMode(PropertyWriteMode.Create)                      // Create a new property or update an existing property\n                            .WithPropertyDeletionMode(PropertyDeletionMode.Ignore)                // Ignore when property to delete does not exist\n                            .WithSectionDeletionMode(SectionDeletionMode.Ignore)                  // Ignore when section to delete does not exist\n                            .WithCommentString(CommentString.Default)                             // Use default comment string that indicates the beginning of a comment line which is a semicolon ';'\n                            .WithCommentReadMode(CommentReadMode.Fallback)                        // Fallback to none comment when section or property to read comment does not exist\n                            .WithCommentWriteMode(CommentWriteMode.Ignore);                       // Ignore when section or property to write the comment does not exist\n\n// This configuration represents the strict configuration which is also predefined:\n//var strictConfiguration = IniDocumentConfiguration.Strict;\nvar strictConfiguration =\n    IniDocumentConfiguration.Default\n                            .WithCaseSensitivity(CaseSensitivity.CaseInsensitive)                 // Treat section names and property keys as case-insensitive\n                            .WithNewlineString(NewlineString.Environment)                         // Use newline string as given by current environment\n                            .WithSectionBeginningDelimiter(SectionBeginningDelimiter.Default)     // Use default section beginning delimiter which is opening square bracket '['\n                            .WithSectionEndDelimiter(SectionEndDelimiter.Default)                 // Use default section end delimiter which is closing square bracket ']'\n                            .WithSectionNameRegex(SectionNameRegex.Default)                       // Use default section name regex which is '[\\p{L}\\p{M}\\p{N}\\p{P}\\p{S}\\p{Zs}]+'\n                            .WithDuplicatePropertyBehavior(DuplicatePropertyBehavior.Fail)        // Throw exception when a duplicate property occurs\n                            .WithDuplicateSectionBehavior(DuplicateSectionBehavior.Fail)          // Throw exception when a duplicate section occurs\n                            .WithInvalidLineBehavior(InvalidLineBehavior.Fail)                    // Throw exception when a line is invalid and cannot be parsed on loading\n                            .WithPropertyAssignmentSeparator(PropertyAssignmentSeparator.Default) // Use default property assignment separator which is equality sign '='\n                            .WithPropertyAssignmentSpacer(PropertyAssignmentSpacer.None)          // Use no property assignment spacer\n                            .WithPropertyEnumerationMode(PropertyEnumerationMode.Fail)            // Throw exception when section to enumerate properties does not exist\n                            .WithPropertyReadMode(PropertyReadMode.Fail)                          // Throw exception when property to read to does not exist\n                            .WithPropertyWriteMode(PropertyWriteMode.Update)                      // Update existing property only but throw exception when property to write does not exist\n                            .WithPropertyDeletionMode(PropertyDeletionMode.Fail)                  // Throw exception when property to delete does not exist\n                            .WithSectionDeletionMode(SectionDeletionMode.Fail)                    // Throw exception when section to delete does not exist\n                            .WithCommentString(CommentString.Default)                             // Use default comment string that indicates the beginning of a comment line which is a semicolon ';'\n                            .WithCommentReadMode(CommentReadMode.Fail)                            // Throw exception when section or property to read comment does not exist\n                            .WithCommentWriteMode(CommentWriteMode.Fail);                         // Throw exception when section or property to write the comment does not exist\n```\n\n[\u0026#8593;](#features)\n---\n\n### Load and save\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\n// Save entire INI document to text writer by using Console.Out to output content\nvar textWriter = Console.Out;\niniDocument.SaveTo(textWriter);\n```\n\n[\u0026#8593;](#features)\n---\n\n### Enumeration of sections\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n\n                   [EmptySection]\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\nforeach (var sectionName in iniDocument.EnumerateSections())\n{\n    Console.WriteLine(sectionName);\n}\n```\n\n[\u0026#8593;](#features)\n---\n\n### Enumeration of properties\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n                   AnotherProperty=Another value\n                   EmptyProperty=\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\nforeach (var propertyName in iniDocument.EnumerateProperties(\"Section\"))\n{\n    Console.WriteLine(propertyName);\n}\n```\n\nThe enumeration of properties supports the following modes:\n\n| Mode                               | Description |\n|------------------------------------|-------------|\n| `PropertyEnumerationMode.Fail`     | Throw a `SectionNotFoundException` when the section does not exist. |\n| `PropertyEnumerationMode.Fallback` | Fall back to an empty collection of properties when the section does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Reading of a property\n\nThe reading of a property supports the following modes:\n\n| Mode                              | Description |\n|-----------------------------------|-------------|\n| `PropertyReadMode.Fail`           | Throw a `SectionNotFoundException` when the section does not exist, or throw a `PropertyNotFoundException` when the section exists but the property does not exist. |\n| `PropertyReadMode.Fallback`       | Fall back to `PropertyValue.None` if the section or property does not exist. |\n| `PropertyReadMode.CustomFallback` | Fall back to the given custom property value if the section or property does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Writing of a property\n\nThe writing of a property supports the following modes:\n\n| Mode                       | Description |\n|----------------------------|-------------|\n| `PropertyWriteMode.Create` | Create a new property. If the property already exists, it will be overwritten. If the section does not exist, a new section is created. If the section exists but the property itself does not exist, a new property is created. |\n| `PropertyWriteMode.Update` | Update an existing property and require that both the section and property exist. Throw a `SectionNotFoundException` when the section does not exist, or throw a `PropertyNotFoundException` when the section exists but the property does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Deletion of a section\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n\n                   [EmptySection]\n\n                   [AnotherSection]\n                   AnotherProperty=With another value\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\niniDocument.DeleteSection(\"EmptySection\");\n\niniDocument.SaveTo(Console.Out);\n```\n\nThe deletion of a section supports the following modes:\n\n| Mode                         | Description |\n|------------------------------|-------------|\n| `SectionDeletionMode.Fail`   | Throw a `SectionNotFoundException` when the section does not exist. |\n| `SectionDeletionMode.Ignore` | Silently ignore if the section does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Deletion of a property\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Current value\n                   AnotherProperty=Another value\n                   EmptyProperty=\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\niniDocument.DeleteProperty(\"Section\", \"Property\");\n\niniDocument.SaveTo(Console.Out);\n```\n\nThe deletion of a property supports the following modes:\n\n| Mode                          | Description |\n|-------------------------------|-------------|\n| `PropertyDeletionMode.Fail`   | Throw a `SectionNotFoundException` when the section does not exist, or throw a `PropertyNotFoundException` when the section exists but the property does not exist. |\n| `PropertyDeletionMode.Ignore` | Silently ignore if the section or the property does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Reading the comment of a section\n```cs\nconst string ini = \"\"\"\n                   ;This is a sample\n                   ;multiline\n                   ;comment. :)\n                   [Section]\n                   Property=Value\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\nvar comment = iniDocument.ReadComment(\"Section\");\n\nConsole.WriteLine(comment);\n```\n\nReading the comment of a section supports the following modes:\n\n| Mode                             | Description |\n|----------------------------------|-------------|\n| `CommentReadMode.Fail`           | Throw a `SectionNotFoundException` when the section does not exist. |\n| `CommentReadMode.Fallback`       | Fall back to none comment if the section does not exist. |\n| `CommentReadMode.CustomFallback` | Fall back to a custom fallback comment if the section does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Reading the comment of a property\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   ;This is a sample\n                   ;multiline\n                   ;comment. :)\n                   Property=Value\n                   \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\nvar comment = iniDocument.ReadComment(\"Section\", \"Property\");\n\nConsole.WriteLine(comment);\n```\n\nReading the comment of a property supports the following modes:\n\n| Mode                             | Description |\n|----------------------------------|-------------|\n| `CommentReadMode.Fail`           | Throw a `SectionNotFoundException` when the section does not exist, or throw a `PropertyNotFoundException` when the section exists but the property does not exist. |\n| `CommentReadMode.Fallback`       | Fall back to none comment if the section or property does not exist. |\n| `CommentReadMode.CustomFallback` | Fall back to a custom fallback comment if the section or property does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Writing the comment of a section\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Value\n                   \"\"\";\n\nconst string comment = \"\"\"\n                       This is a sample\n                       multiline\n                       comment. :)\n                       \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\niniDocument.WriteComment(\"Section\", comment);\n\nusing var textWriter = new StringWriter();\niniDocument.SaveTo(textWriter);\n\ntextWriter.Flush();\n\nConsole.WriteLine(textWriter);\n```\n\nWriting the comment of a section supports the following modes:\n\n| Mode                      | Description |\n|---------------------------|-------------|\n| `CommentWriteMode.Fail`   | Throw a `SectionNotFoundException` when the section does not exist. |\n| `CommentWriteMode.Ignore` | Silently ignore if the section does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n### Writing the comment of a property\n```cs\nconst string ini = \"\"\"\n                   [Section]\n                   Property=Value\n                   \"\"\";\n\nconst string comment = \"\"\"\n                       This is a sample\n                       multiline\n                       comment. :)\n                       \"\"\";\n\nusing var textReader = new StringReader(ini);\nvar iniDocument = IniDocument.LoadFrom(textReader, IniDocumentConfiguration.Default);\n\niniDocument.WriteComment(\"Section\", \"Property\", comment);\n\nusing var textWriter = new StringWriter();\niniDocument.SaveTo(textWriter);\n\ntextWriter.Flush();\n\nConsole.WriteLine(textWriter);\n```\n\nWriting the comment of a property supports the following modes:\n\n| Mode                      | Description |\n|---------------------------|-------------|\n| `CommentWriteMode.Fail`   | Throw a `SectionNotFoundException` when the section does not exist, or throw a `PropertyNotFoundException` when the section exists but the property does not exist. |\n| `CommentWriteMode.Ignore` | Silently ignore if the section or the property does not exist. |\n\n[\u0026#8593;](#features)\n---\n\n## License\nMIT License\n\n[https://opensource.org/license/mit](https://opensource.org/license/mit)\n\n## Socialize\nIf you like or use my work and you are interested in this kind of software development let's get in touch. :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverzick%2Fdelizious-ini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverzick%2Fdelizious-ini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverzick%2Fdelizious-ini/lists"}