F# Data (Ja)


F# Data: Library for Data Access

The F# Data library (FSharp.Data.dll) implements everything you need to access data in your F# applications and scripts. It implements F# type providers for working with structured file formats (CSV, JSON and XML) and for accessing the WorldBank and Freebase data. It also includes helpers for parsing JSON and CSV files and for sending HTTP requests.

Library philosophy

This library focuses on providing a simple 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). It's also designed to play well with other libraries like Deedle, F# R Type Provider, F# Charting and FunScript.

Library 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.



How to get FSharp.Data



Using F# Data

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. For more information see:

The library also implements a type provider for accessing data from the WorldBank and Freebase graph database.

  • WorldBank Provider - discusses the WorldBankData type and the WorldBankDataProvider<..> type
  • Freebase Provider - discusses the FreebaseData type and the FreebaseDataProvider<..> 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 a JSON and CSV parsers with simple dynamic API. For more information about these types, see the following topics:

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 XElement and the JsonValue from F# Data. The tutorial demonstrates pattern matching on JsonValue.

  • Anonymizing JSON - implements a function to anonymize a JsonValue from F# Data. The tutorial demonstrates pattern matching on JsonValue.

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

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.

Fork me on GitHub