Tomlyn 0.19.0
dotnet add package Tomlyn --version 0.19.0
NuGet\Install-Package Tomlyn -Version 0.19.0
<PackageReference Include="Tomlyn" Version="0.19.0" />
<PackageVersion Include="Tomlyn" Version="0.19.0" />
<PackageReference Include="Tomlyn" />
paket add Tomlyn --version 0.19.0
#r "nuget: Tomlyn, 0.19.0"
#:package Tomlyn@0.19.0
#addin nuget:?package=Tomlyn&version=0.19.0
#tool nuget:?package=Tomlyn&version=0.19.0
Tomlyn 
  
  
<img align="right" width="160px" height="160px" src="img/logo.png">
Tomlyn is a TOML parser, validator and authoring library for .NET Framework and .NET Core.
What is TOML?
A config file format for humans. TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages.
- See the official website https://toml.io/en/ for more details.
 - Example and specifications are available at TOML v1.0.0
 
Features
- Very fast parser, GC friendly.
 - Compatible with the latest TOML v1.0.0 specs.
 - Allow to map a TOML string to a default runtime model via 
Toml.ToModel(string) - Allow to map a TOML string to a custom runtime model via 
Toml.ToModel<T>(string)- Very convenient for loading custom configurations for example.
 
 - Allow to generate a TOML string from a runtime model via 
string Toml.FromModel(object)- Preserve comments, by default with the default runtime model, or by implementing the 
ITomlMetadataProvider. 
 - Preserve comments, by default with the default runtime model, or by implementing the 
 - Allow to parse to a 
DocumentSyntaxviaToml.Parse(string).- Preserve all spaces, new line, comments but also invalid characters/tokens.
 - Can roundtrip to text with exact representation.
 
 - Provides a validator with the 
Toml.Validatemethod. - Supports for .NET Standard 2.0+ and provides an API with nullable annotations.
 
Documentation
See the documentation for more details.
Install
Tomlyn is delivered as a NuGet Package.
Usage
var toml = @"global = ""this is a string""
# This is a comment of a table
[my_table]
key = 1 # Comment a key
value = true
list = [4, 5, 6]
";
// Parse the TOML string to the default runtime model `TomlTable`
var model = Toml.ToModel(toml);
// Fetch the string
var global = (string)model["global"]!;
// Prints: found global = "this is a string"
Console.WriteLine($"found global = \"{global}\"");
// Generates a TOML string from the model
var tomlOut = Toml.FromModel(model);
// Output the generated TOML
Console.WriteLine(tomlOut);
This will print the original TOML by preserving most the comments:
global = "this is a string"
# This is a comment of a table
[my_table]
key = 1 # Comment a key
value = true
list = [4, 5, 6]
NOTICE: By default, when mapping to a custom model, Tomlyn is using the PascalToSnakeCase naming convention (e.g
ThisIsFinetothis_is_fine). This behavior can be changed by overriding theTomlModelOptions.ConvertPropertyNamedelegate.
License
This software is released under the BSD-Clause 2 license.
Credits
Modified version of the logo Thor by Mike Rowe from the Noun Project (Creative Commons)
Author
Alexandre Mutel aka xoofx.
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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
- No dependencies.
 
 - 
                                                    
net8.0
- No dependencies.
 
 
NuGet packages (38)
Showing the top 5 NuGet packages that depend on Tomlyn:
| Package | Downloads | 
|---|---|
| 
                                                        
                                                            ROFSDB
                                                        
                                                         Package Description  | 
                                                    |
| 
                                                        
                                                            DafnyCore
                                                        
                                                         Package Description  | 
                                                    |
| 
                                                        
                                                            CounterStrikeSharp.API
                                                        
                                                         Official server side runtime assembly for CounterStrikeSharp  | 
                                                    |
| 
                                                        
                                                            StateSmith
                                                        
                                                         StateSmith is a cross platform, free/open source tool for generating state machines in multiple languages. The generated code is human readable, has zero dependencies and is suitable for use with tiny bare metal microcontrollers, kernels, computers... It avoids dynamic memory allocations for the safety or performance inclined.  | 
                                                    |
| 
                                                        
                                                            Deislabs.Bindle
                                                        
                                                         Provides a client for Bindle.WARNING: Bindle is experimental. It is not considered production-grade by its developers, neither is it "supported" software.  | 
                                                    
GitHub repositories (23)
Showing the top 20 popular GitHub repositories that depend on Tomlyn:
| Repository | Stars | 
|---|---|
| 
                                                        
                                                            dafny-lang/dafny
                                                        
                                                         
                                                            Dafny is a verification-aware programming language
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            roflmuffin/CounterStrikeSharp
                                                        
                                                         
                                                            CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            microsoft/Oryx
                                                        
                                                         
                                                            Build your repo automatically.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            StateSmith/StateSmith
                                                        
                                                         
                                                            A state machine code generation tool suitable for bare metal, embedded and more.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            xoofx/dotnet-releaser
                                                        
                                                         
                                                            Easily build, run tests and coverage, cross-compile, package and publish your .NET library or application to NuGet and GitHub.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            xenia-manager/xenia-manager
                                                        
                                                         
                                                            Xenia Manager is a tool that tries to make using Xenia Emulator easier.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            rwmt/Multiplayer
                                                        
                                                         
                                                            Zetrith's Multiplayer mod for RimWorld
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            flipswitchingmonkey/FlexASIO_GUI
                                                        
                                                         
                                                            Simple configuration GUI for FlexASIO
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            exercism/csharp
                                                        
                                                         
                                                            Exercism exercises in C#.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            h4lfheart/FortnitePorting
                                                        
                                                         
                                                            Lightning-Quick Automation of the Fortnite Porting Process
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            imazen/imageflow-server
                                                        
                                                         
                                                            A super-fast image server to speed up your site - deploy as a microservice, serverless, or embeddable.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            LiuYunPlayer/TuneLab
                                                        
                                                         | 
                                                    |
| 
                                                        
                                                            ohhsodead/arisen-studio
                                                        
                                                         
                                                            Browse, Download and Install Mods for PlayStation 3 & Xbox 360
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Doddler/RagnarokRebuildTcp
                                                        
                                                         
                                                            Ragnarok-like server + client
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            ItsDeltin/Overwatch-Script-To-Workshop
                                                        
                                                         
                                                            Converts scripts to Overwatch workshops.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            TekkaGB/DivaModManager
                                                        
                                                         | 
                                                    |
| 
                                                        
                                                            PCL-Community/PCL.Neo
                                                        
                                                         
                                                            一个用 Avalonia 重写的 PCL
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Yeppioo/YMCL.Avalonia
                                                        
                                                         
                                                            Yu Minecraft Launcher · YMCL !
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            hlaueriksson/GEmojiSharp
                                                        
                                                         
                                                            :octocat: GitHub Emoji for C#, ASP.NET Core and Blazor, dotnet tool for the terminal and PowerToys Run plugin
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Yeppioo/Aurelio
                                                        
                                                         | 
                                                    
| Version | Downloads | Last Updated | 
|---|---|---|
| 0.19.0 | 194,441 | 3/11/2025 | 
| 0.18.0 | 73,533 | 12/22/2024 | 
| 0.17.0 | 848,890 | 11/23/2023 | 
| 0.16.2 | 714,268 | 12/22/2022 | 
| 0.16.1 | 38,577 | 10/27/2022 | 
| 0.16.0 | 24,222 | 10/20/2022 | 
| 0.15.1 | 45,079 | 10/13/2022 | 
| 0.15.0 | 251,878 | 7/1/2022 | 
| 0.14.4 | 3,468 | 6/21/2022 | 
| 0.14.3 | 569,215 | 5/9/2022 | 
| 0.14.2 | 41,935 | 4/21/2022 | 
| 0.14.1 | 1,679 | 4/3/2022 | 
| 0.14.0 | 5,709 | 3/10/2022 | 
| 0.13.1 | 1,517 | 3/6/2022 | 
| 0.13.0 | 1,472 | 3/5/2022 | 
| 0.12.1 | 1,451 | 3/5/2022 | 
| 0.12.0 | 2,046 | 2/27/2022 | 
| 0.11.0 | 2,567 | 2/14/2022 | 
| 0.10.2 | 2,995 | 2/1/2022 | 
| 0.10.1 | 1,632 | 1/31/2022 | 
| 0.10.0 | 2,085 | 1/27/2022 | 
| 0.9.1 | 1,699 | 1/25/2022 | 
| 0.9.0 | 2,085 | 1/25/2022 | 
| 0.4.1 | 1,630 | 1/23/2022 | 
| 0.4.0 | 1,643 | 1/23/2022 | 
| 0.3.1 | 1,785 | 1/14/2022 | 
| 0.3.0 | 1,678 | 1/14/2022 | 
| 0.1.2 | 1,216,287 | 3/8/2020 | 
| 0.1.1 | 13,361 | 2/13/2019 | 
| 0.1.0 | 3,691 | 2/12/2019 |