MultiFormatDataConverter 0.2.4
dotnet add package MultiFormatDataConverter --version 0.2.4
NuGet\Install-Package MultiFormatDataConverter -Version 0.2.4
<PackageReference Include="MultiFormatDataConverter" Version="0.2.4" />
<PackageVersion Include="MultiFormatDataConverter" Version="0.2.4" />
<PackageReference Include="MultiFormatDataConverter" />
paket add MultiFormatDataConverter --version 0.2.4
#r "nuget: MultiFormatDataConverter, 0.2.4"
#:package MultiFormatDataConverter@0.2.4
#addin nuget:?package=MultiFormatDataConverter&version=0.2.4
#tool nuget:?package=MultiFormatDataConverter&version=0.2.4
MultiFormatDataConverter
A versatile .NET library for converting data between JSON, YAML, and XML formats. This library provides a comprehensive set of extension methods to seamlessly convert between different data representation formats.
Installation
Install the package via NuGet:
dotnet add package MultiFormatDataConverter
Features
- Convert between JSON, YAML, and XML with simple, intuitive extension methods
- Support for various object types in each format:
- JSON: JsonNode, JsonObject, JsonArray, JsonDocument
- XML: XmlDocument, XDocument
- YAML: YamlStream
- Cross-platform compatibility
- AOT-compatible
- Comprehensive XML documentation
- .NET 6.0+ support
Usage Examples
Converting between XML and JSON
// Convert from XML to JSON
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml("<root><item>value</item></root>");
JsonNode jsonNode = xmlDoc.ToJsonNode();
// Convert from JSON to XML
JsonObject jsonObject = new JsonObject { ["property"] = "value" };
XmlDocument convertedXml = jsonObject.ToXmlDocument();
Converting between JSON and YAML
// Convert JSON to YAML
JsonObject jsonObject = new JsonObject { ["name"] = "John", ["age"] = 30 };
YamlStream yamlStream = jsonObject.ToYamlStream();
// Convert JSON document to YAML
JsonDocument jsonDocument = JsonDocument.Parse("{\"items\": [1, 2, 3]}");
YamlStream yamlFromDoc = jsonDocument.ToYamlStream();
Converting between YAML and XML
// First convert YAML to JSON, then to XML
YamlStream yamlStream = new YamlStream();
using (var reader = new StringReader("key: value"))
{
yamlStream.Load(reader);
}
JsonObject? jsonObject = yamlStream.ToJsonObject();
XmlDocument xmlDoc = jsonObject.ToXmlDocument();
API Overview
The library provides three main static classes:
- XmlConverter: Convert to/from XML formats (XmlDocument, XDocument)
- JsonConverter: Convert to/from JSON formats (JsonNode, JsonObject, JsonArray, JsonDocument)
- YamlConverter: Convert to/from YAML formats (YamlStream)
Framework Support
- .NET STANDARD 2.0
- .NET 6.0
- .NET 7.0
- .NET 8.0
- .NET 9.0
License
This project is licensed under the terms specified in the LICENSE.txt file.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 9.0.7)
- YamlDotNet (>= 16.3.0)
-
net6.0
- System.Text.Json (>= 9.0.7)
- YamlDotNet (>= 16.3.0)
-
net7.0
- System.Text.Json (>= 9.0.7)
- YamlDotNet (>= 16.3.0)
-
net8.0
- System.Text.Json (>= 9.0.7)
- YamlDotNet (>= 16.3.0)
-
net9.0
- System.Text.Json (>= 9.0.7)
- YamlDotNet (>= 16.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MultiFormatDataConverter:
Package | Downloads |
---|---|
AbsolutePathHelpers
AbsolutePath helpers for file and folder pathing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
## New Version
* Bump `multi-format-data-converter` from `0.2.3` to `0.2.4`. See [changelog](https://github.com/Kiryuumaru/MultiFormatDataConverter/compare/multi-format-data-converter/0.2.3...multi-format-data-converter/0.2.4)
## What's Changed
* Bump xunit.runner.visualstudio from 3.1.1 to 3.1.2 by @dependabot[bot] in https://github.com/Kiryuumaru/MultiFormatDataConverter/pull/7
**Full Changelog**: https://github.com/Kiryuumaru/MultiFormatDataConverter/compare/build.20250710171929.d2dea6c...build.20250714203131.d7bd0a6