{"id":29890014,"url":"https://github.com/aoxetech/aoxe.extensions.configuration","last_synced_at":"2025-07-31T22:23:21.873Z","repository":{"id":252358285,"uuid":"840203033","full_name":"AoxeTech/Aoxe.Extensions.Configuration","owner":"AoxeTech","description":"The implementations for Microsoft.Extensions.Configuration, include Json / Xml / Ini / Toml / Yaml.","archived":false,"fork":false,"pushed_at":"2025-07-12T02:26:43.000Z","size":184,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T08:51:44.076Z","etag":null,"topics":[],"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/AoxeTech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T07:29:19.000Z","updated_at":"2025-07-12T02:26:47.000Z","dependencies_parsed_at":"2024-08-13T06:57:52.405Z","dependency_job_id":"c8a752cd-e51b-4a2f-b5b3-89b1fd76e9a0","html_url":"https://github.com/AoxeTech/Aoxe.Extensions.Configuration","commit_stats":null,"previous_names":["aoxetech/aoxe.extensions.configuration.parser","aoxetech/aoxe.extensions.configuration"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AoxeTech/Aoxe.Extensions.Configuration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.Extensions.Configuration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.Extensions.Configuration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.Extensions.Configuration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.Extensions.Configuration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AoxeTech","download_url":"https://codeload.github.com/AoxeTech/Aoxe.Extensions.Configuration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.Extensions.Configuration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268126584,"owners_count":24200290,"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-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2025-07-31T22:23:20.766Z","updated_at":"2025-07-31T22:23:21.862Z","avatar_url":"https://github.com/AoxeTech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aoxe.Extensions.Configuration\n\nEnglish | [简体中文](README-zh_CN.md)\n\n---\n\nThe implementations for Microsoft.Extensions.Configuration, include several configuration sources and several parsers (Json / Xml / Ini / Toml / Yaml).\n\n- [Aoxe.Extensions.Configuration](https://github.com/AoxeTech/Aoxe.Extensions.Configuration)\n- [Aoxe.Extensions.Configuration.Consul](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Consul)\n- [Aoxe.Extensions.Configuration.Etcd](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Etcd)\n- [Aoxe.Extensions.Configuration.Redis](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Redis)\n\n## 1. Why\n\nThe Microsoft.Extensions.Configuration provide develops out of box and powerful configuration functions. It supports several formats (Json / Xml / Ini) to covers most usage scenarios. But still has some points I think it can be improved.\n\n### 1.1. The parser is the core function but hasn't been defined to public, this design affects modularity and reuse\n\nEvery configuration is base on its stream version with the same format, like JsonConfigurationProvider / JsonStreamConfigurationProvider and XmlConfigurationProvider / XmlStreamConfigurationProvider etc. In the stream provider it use serializer to parse the structure stream into a Dictionary\u003cstring, string?\u003e. But in these offical configuration providers the parser classes or functions were defined to internal or pravite.\n\n### 1.2. Other serializers\n\nLike Microsoft.Extensions.Configuration.Json was base on System.Text.Json, it is a great package but someone prefer Newtonsoft.Json or other serializers with some reasons, and the Microsoft.Extensions.Configuration.NewtonsoftJson has been set to deprecate from 2020. And then in addition to Json / Xml / Ini, we may now need other configration formats like Toml / Yaml etc.\n\n### 1.3. More configuration sources\n\nWith the microservices and cloud, the Centralized Configuration will be more and more important. Microsoft has provided some Centralized Configuration sources for us, but they are usually based on azure. All the more reason to be cloud neutrality when cloud is so powerful, some projects and services prefer privately deployed key-value stores.\n\n## 2. What this project does\n\n### 2.1. Flantteners\n\nFor parser, Aoxe.Extensions.Configuration abstracts the concept called Flanttener to parse and flatten the stream into Dictionary\u003cstring, string?\u003e. Then now we have the following implementations:\n\n#### 2.1.1. Aoxe.Extensions.Configuration.Flattener.Ini\n\nBase on Microsoft.Extensions.Configuration.Ini and with the same behavior.\n\n#### 2.1.2. Aoxe.Extensions.Configuration.Flattener.IniParser\n\n[ini-parser](https://github.com/rickyah/ini-parser) is A .NET, Mono and Unity3d compatible(*) library for reading/writing INI data from IO streams, file streams, and strings written in C#.\n\nAlso implements merging operations, both for complete ini files, sections, or even just a subset of the keys contained by the files.\n\n(*) This library is 100% .NET code and does not have any dependencies on Windows API calls in order to be portable.\n\n#### 2.1.3. Aoxe.Extensions.Configuration.Flattener.Json\n\nBase on Microsoft.Extensions.Configuration.Json and with the same behavior.\n\n#### 2.1.4. Aoxe.Extensions.Configuration.Flattener.NewtonsoftJson\n\n[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) is a popular high-performance JSON framework for .NET. With this implement we can pass JsonSerializerSettings for cumstomize deserialize.\n\n#### 2.1.5. Aoxe.Extensions.Configuration.Flattener.SharpYaml\n\n[SharpYaml](https://github.com/xoofx/SharpYaml) is a .NET library that provides a YAML parser and serialization engine for .NET objects, compatible with CoreCLR.\n\n#### 2.1.6. Aoxe.Extensions.Configuration.Flattener.Tomlet\n\n[Tomlet](https://github.com/SamboyCoding/Tomlet) is a Zero-Dependency, model-based TOML De/Serializer for .NET.\n\n#### 2.1.7. Aoxe.Extensions.Configuration.Flattener.Tomlyn\n\n[Tomlyn](https://github.com/xoofx/Tomlyn) is a TOML parser, validator and authoring library for .NET Framework and .NET Core.\n\n#### 2.1.8. Aoxe.Extensions.Configuration.Flattener.Xml\n\nBase on Microsoft.Extensions.Configuration.Xml and with the same behavior.\n\n#### 2.1.9. Aoxe.Extensions.Configuration.Flattener.YamlDotNet\n\n[YamlDotNet](https://github.com/aaubry/YamlDotNet) is a .NET library for YAML. YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.\n\n### 2.2. More Configuration sources\n\nIn addition to configuration files, modern services increasingly rely on centralized configuration. For this purpose there are these configuration sources:\n\n#### 2.2.1. [Aoxe.Extensions.Configuration](https://github.com/AoxeTech/Aoxe.Extensions.Configuration)\n\nBecause the abstractions of Flantten, Aoxe.Extensions.Configuration support difference configuration files, like Json, Xml, Ini, Toml and Yaml.\n\n#### 2.2.2. [Aoxe.Extensions.Configuration.Consul](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Consul)\n\n[Consul](https://www.consul.io/) is a service networking solution that provides a full-featured control plane with service discovery, configuration, and segmentation functionality. It is designed to make it easy to manage and secure service-to-service communication across distributed infrastructure.\n\n#### 2.2.3. [Aoxe.Extensions.Configuration.Etcd](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Etcd)\n\n[Etcd](https://etcd.io/) is a distributed key-value store that provides a reliable way to store data across a cluster of machines. It is used to store configuration data, metadata, and other critical information that needs to be accessed by distributed systems.\n\n#### 2.2.4. [Aoxe.Extensions.Configuration.Redis](https://github.com/AoxeTech/Aoxe.Extensions.Configuration.Redis)\n\n[Redis (Remote Dictionary Server)](https://redis.io/) is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes.\n\n## 3. How to use\n\nTaking Toml file configuration as an example, we now have a Toml file which named 'Test.toml' like below:\n\n```toml\nstringKey = \"stringValue\"\nnumberKey = 123\nbooleanKey = true\nnullKey = \"\"  # TOML does not have a native null type, so we use an empty string\n\n[nestedObject]\nnestedStringKey = \"nestedStringValue\"\nnestedNumberKey = 456\nnestedBooleanKey = false\nnestedNullKey = \"\"  # Again, using an empty string for null\n\narrayKey = [\"arrayStringValue\", 789, false, \"\"]\n\n[[arrayKeyWithNestedObjects]]\narrayNestedObjectKey = \"arrayNestedObjectValue\"\n\n# Date and time example\ndateKey = 1979-05-27T07:32:00Z\n```\n\nAnd then can get this package via nuget.\n\n```shell\nPM\u003e Install-Package Aoxe.Extensions.Configuration.Tomlyn\n```\n\nNow we can use it like this:\n\n```csharp\nvar configurationBuilder = new ConfigurationBuilder();\nconfigurationBuilder.AddTomlFile(\"./Test.toml\");\nIConfiguration configuration = configurationBuilder.Build();\nvar value = configuration[\"nestedObject:nestedStringKey\"]; // The value is \"nestedStringValue\"\n```\n\nThank`s for [JetBrains](https://www.jetbrains.com/) for the great support in providing assistance and user-friendly environment for my open source projects.\n\n[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg?_gl=1*f25lxa*_ga*MzI3ODk2MjY0LjE2NzA0NjY4MDQ.*_ga_9J976DJZ68*MTY4OTY4NzY5OS4zNC4xLjE2ODk2ODgwMDAuNTMuMC4w)](https://www.jetbrains.com/community/opensource/#support)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.extensions.configuration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoxetech%2Faoxe.extensions.configuration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.extensions.configuration/lists"}