TOML Fortran library#

TOML Fortran License Version Continuous Integration API docs Documentation Status Coverage

This project provides a library to work with TOML files and data structures and allows to define data serialization and deserialization in Fortran. The currently supported TOML standard is version 1.0.0. The TOML Fortran project is hosted at GitHub at toml-f/toml-f.

Tutorials

Guides and courses for using TOML with complete and self-contained examples.

Recipes

Examples and recipes for solving common tasks with TOML Fortran.

Reference

Generated documentation of all procedures and derived types available.

Installation

Instructions for installing, updating or compiling TOML Fortran.

Repository

GitHub repository for the development of TOML Fortran.

External

External links to other resources, blogs, etc.

News

  • 03 August - Jonquil: Bringing TOML blooms to JSON land

    Jonquil started out of the idea to make a TOML parser speak JSON. First explored as a way to connect to the toml-test validation suite, the implementation was brief and expressive enough to be explored as a tutorial. Since the implementation was taken serious enough to enter into JSON Fortran’s benchmarks and turned out to actually be competitive with JSON Fortran, revisiting the idea of a JSON parser in TOML Fortran was warranted.

  • 01 August - TOML Fortran 0.3.0 released

    This release comes with a new backend for the deserialization of TOML documents, making the parser more robust against unclosed inline tables and arrays. Furthermore, a context can now be captured which allows reporting messages like errors as annotations in TOML document, making both the default errors produced by the parsers more useful and also enabling users of TOML Fortran to create consistently formatted reports. Together with the refactoring of the internal representation for storing TOML values, the low-level interface to TOML values becomes more consistent and easier to use. A long-standing issue with supporting Unicode escape sequences in strings has been resolved and TOML Fortran now fully supports all TOML 1.0.0 escape sequences.

    Features spotlight

Users

TOML Fortran is used for example in the Fortran package manager (fpm), a typical package manifest specified in TOML is shown below

fpm.toml#
name = "toml-f"
version = "0.3.0"
license = "Apache-2.0 OR MIT"
maintainer = ["@awvwgk"]
author = ["Sebastian Ehlert"]
copyright = "2019-2022 Sebastian Ehlert"
homepage = "https://toml-f.github.io/toml-f"
keywords = ["toml", "io", "serde"]
description = "TOML parser implementation for data serialization and deserialization"

[library]
source-dir = "src"

[build]
auto-tests = false

[[test]]
name = "tftest"
source-dir = "test/unit"
[test.dependencies]
test-drive.git = "https://github.com/fortran-lang/test-drive.git"

[[executable]]
name = "toml2json"
source-dir = "test/compliance"
main = "toml2json.f90"

[[executable]]
name = "json2toml"
source-dir = "test/compliance"
main = "json2toml.f90"