The F# Data library implements everything you need to access data in your F# applications and scripts. It contains F# type providers for working with structured file formats (CSV, HTML, JSON and XML) and for accessing the WorldBank data. It also includes helpers for parsing CSV, HTML and JSON files and for sending HTTP requests.
This library focuses on providing a simple, mostly read-only, access to the structured documents and other data sources. It does not aim to be a comprehensive collection of F# type providers (which can be used for numerous other purposes).
F# Data type providers in action
How to get F# Data
The F# Data Library is available as FSharp.Data on NuGet.
-
In addition to the official releases, you can also get NuGet packages from the Continuous Integration package source.
Alternatively, you can download the source as a ZIP file or download the compiled binaries as a ZIP.
Please note that on windows when downloading a zip file withdllfiles the files will be blocked, and you have to manually unblock them in the file properties.
F# Data documentation and tutorials
F# type providers
The type providers for structured file formats infer the structure of a sample document (or a document containing multiple samples). The structure is then used to provide easy to use type-safe access to documents that follow the same structure. The library also implements a type provider for accessing data from the WorldBank.
- CSV Type Provider - discusses the
CsvProvider<..>type - HTML Type Provider - discusses the
HtmlProvider<...>type - JSON Type Provider - discusses the
JsonProvider<..>type - XML Type Provider - discusses the
XmlProvider<..>type -
WorldBank Provider - discusses the
WorldBankDatatype and theWorldBankDataProvider<..>type
Data access tools
In addition to the F# type providers, the library also defines several types that simplify data access. In particular, it includes tools for HTTP web requests and CSV, HTML, and JSON parsers with simple dynamic API. For more information about these types, see the following topics:
-
HTTP Utilities - discusses the
Httptype that can be used to send HTTP web requests. - CSV Parser - introduces the CSV parser (without using the type provider)
- HTML Parser - introduces the HTML parser (without using the type provider)
- JSON Parser - introduces the JSON parser (without using the type provider)
Tutorials
The above articles cover all key features of the F# Data library. However, if you're interested in more samples or more details, then the following tutorials contain additional examples that use multiple different features together:
-
Converting between JSON and XML - implements two serialization
functions that convert between the standard .NET
XElementand theJsonValuefrom F# Data. The tutorial demonstrates pattern matching onJsonValue. -
Anonymizing JSON - implements a function to anonymize a
JsonValuefrom F# Data. The tutorial demonstrates pattern matching onJsonValue.
Reference Documentation
There's also reference documentation available. Please note that everything under
the FSharp.Data.Runtime namespace is not considered as part of the public API and can change without notice.
Contributing and license
The library is available under Apache 2.0. For more information see the License file in the GitHub repository. In summary, this means that you can use the library for commercial purposes, fork it, and modify it as you wish.
F# Data is made possible by the volunteer work of more than a dozen contributors and we're open to contributions from anyone. If you want to help out but don't know where to start, you can take one of the Up-For-Grabs issues, or help to improve the documentation.
The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding new public API's, please also contribute samples that can be turned into a documentation.
-
If you want to discuss an issue or feature that you want to add the to the library, then you can submit an issue or feature request via Github or you can send an email to the F# open source mailing list.
For more information about the library architecture, organization, how to debug, etc., see the contributing to F# data page.