Legivel


Legivel

A Yaml to Native processor in F#, producing F# types.

"Legivel" is the Portugese word for "readable"; ie Yaml was invented to create a human readable data-format.

The Legivel library can be installed from NuGet:
PM> Install-Package Legivel

Example

This example demonstrates Yaml to Native conversion using this library:

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
#r "Legivel.Parser.dll"
#r "Legivel.Mapper.dll"
open Legivel.Serialization

type PlayEvent = {
  time   : string
  player : string
  action : string
}

//  example : http://www.yaml.org/spec/1.2/spec.html#id2760519
let yaml = "
---
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
..." 
1: 
Deserialize<PlayEvent> yaml

Which results in:

[Succes {Data = {time = "20:03:20";
                 player = "Sammy Sosa";
                 action = "strike (miss)";};
         Warn = [];}; Succes {Data = {time = "20:03:47";
                                      player = "Sammy Sosa";
                                      action = "grand slam";};
                              Warn = [];}]

Examples & documentation

Legivel comes with comprehensible documentation.

  • Tutorial contains more examples how to use this library.
  • Processing Options customize the yaml processing
  • API Reference contains automatically generated documentation for all types, modules and functions in the library.
  • Customization contains information to customize yaml-processing.
  • Features documents the details of implemented features.
  • Wish List contains pending ideas, which may be added in future.

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into a documentation. You might also want to read the library design notes to understand how it works.

The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

Fork me on GitHub