{"id":32178356,"url":"https://github.com/toml-f/toml-f","last_synced_at":"2026-03-05T10:07:44.988Z","repository":{"id":36981544,"uuid":"228637365","full_name":"toml-f/toml-f","owner":"toml-f","description":"TOML parser implementation for data serialization and deserialization in Fortran","archived":false,"fork":false,"pushed_at":"2026-02-11T10:12:49.000Z","size":4234,"stargazers_count":124,"open_issues_count":15,"forks_count":32,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-24T19:28:03.843Z","etag":null,"topics":["fortran-library","fortran-package-manager","serde","toml","toml-parser"],"latest_commit_sha":null,"homepage":"https://toml-f.readthedocs.io","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toml-f.png","metadata":{"funding":{"github":["awvwgk"]},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-Apache","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2019-12-17T14:43:26.000Z","updated_at":"2026-02-11T10:12:50.000Z","dependencies_parsed_at":"2024-10-23T10:50:29.214Z","dependency_job_id":"b92b5c99-5cbe-4d95-a71e-d04663439503","html_url":"https://github.com/toml-f/toml-f","commit_stats":{"total_commits":96,"total_committers":9,"mean_commits":"10.666666666666666","dds":0.08333333333333337,"last_synced_commit":"d7b892b1d074b7cfc5d75c3e0eb36ebc1f7958c1"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/toml-f/toml-f","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toml-f%2Ftoml-f","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toml-f%2Ftoml-f/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toml-f%2Ftoml-f/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toml-f%2Ftoml-f/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toml-f","download_url":"https://codeload.github.com/toml-f/toml-f/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toml-f%2Ftoml-f/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30118934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran-library","fortran-package-manager","serde","toml","toml-parser"],"created_at":"2025-10-21T20:53:55.617Z","updated_at":"2026-03-05T10:07:44.972Z","avatar_url":"https://github.com/toml-f.png","language":"Fortran","funding_links":["https://github.com/sponsors/awvwgk"],"categories":[],"sub_categories":[],"readme":"# TOML parser for Fortran projects\n\n[![License](https://img.shields.io/badge/license-MIT%7CApache%202.0-blue)](LICENSE-Apache)\n[![Release](https://img.shields.io/github/v/release/toml-f/toml-f)](https://github.com/toml-f/toml-f/releases/latest)\n[![Build](https://github.com/toml-f/toml-f/workflows/CI/badge.svg)](https://github.com/toml-f/toml-f/actions)\n[![docs](https://github.com/toml-f/toml-f/workflows/docs/badge.svg)](https://toml-f.github.io/toml-f)\n[![Documentation Status](https://readthedocs.org/projects/toml-f/badge/?version=latest)](https://toml-f.readthedocs.io)\n[![codecov](https://codecov.io/gh/toml-f/toml-f/branch/main/graph/badge.svg)](https://codecov.io/gh/toml-f/toml-f)\n\nA TOML parser implementation for data serialization and deserialization in Fortran.\n\n* the [TOML standard](https://toml.io)\n* currently supported [TOML v1.0.0 specification](https://toml.io/en/v1.0.0)\n* [TOML Fortran documentation](https://toml-f.readthedocs.io)\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./assets/toml-f.png\" alt=\"TOML-Fortran\" width=\"220\"\u003e\n\u003c/div\u003e\n\n\n## Installation\n\nThe TOML Fortran library is available via various distribution channels.\nIf your channel is not found here, please checkout the instructions for [building from source](#building-from-source).\nYou can also find these instructions in the user documentation at [Installing TOML Fortran](https://toml-f.readthedocs.io/en/latest/how-to/installation.html).\n\n\n### Conda package\n\n[![Conda](https://img.shields.io/conda/vn/conda-forge/toml-f)](https://github.com/conda-forge/toml-f-feedstock)\n[![Conda](https://img.shields.io/conda/pn/conda-forge/toml-f)](https://github.com/conda-forge/toml-f-feedstock)\n\nThis project is packaged for the *mamba* package manager and available on the *conda-forge* channel.\nTo install the *mamba* package manager we recommend the [miniforge](https://github.com/conda-forge/miniforge/releases) installer.\nIf the *conda-forge* channel is not yet enabled, add it to your channels with\n\n```\nmamba config --add channels conda-forge\nmamba config --set channel_priority strict\n```\n\nOnce the *conda-forge* channel has been enabled, TOML Fortran can be installed with *mamba*:\n\n```\nmamba install toml-f\n```\n\nIt is possible to list all of the versions of TOML Fortran available on your platform with *mamba*:\n\n```\nmamba repoquery search toml-f --channel conda-forge\n```\n\n\n### FreeBSD port\n\n[![FreeBSD port](https://repology.org/badge/version-for-repo/freebsd/toml-f.svg)](https://www.freshports.org/textproc/toml-f/)\n\nA port for FreeBSD is available and can be installed using\n\n```\npkg install textproc/toml-f\n```\n\nIn case no package is available build the port using\n\n```\ncd /usr/ports/textproc/toml-f\nmake install clean\n```\n\nFor more information see the [toml-f port details](https://www.freshports.org/textproc/toml-f/).\n\n\n### Alternative distributions\n\nPlease let us know if you are packaging TOML Fortran.\nOther available distributions of TOML Fortran currently include\n\n- Homebrew tap at [grimme-lab/homebrew-qc](https://github.com/grimme-lab/homebrew-qc)\n- Easy-build config at [easybuilders/easybuild-easyconfigs](https://github.com/easybuilders/easybuild-easyconfigs/tree/develop/easybuild/easyconfigs/t/TOML-Fortran)\n- spack package in [develop](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/toml-f/package.py)\n\nAn overview of the availability of TOML Fortran in distributions tracked by [Repology](https://repology.org) is provided here:\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/toml-f.svg)](https://repology.org/project/toml-f/versions)\n\n\n### Building from source\n\nTo build this project from the source code in this repository you need to have\n\n- a Fortran compiler supporting Fortran 2008\n\n  - GFortran 5 or newer\n  - Intel Fortran 18 or newer\n  - NAG 7 or newer\n\n- One of the supported build systems\n\n  - [meson](https://mesonbuild.com) version 0.55 or newer\n  - [CMake](https://cmake.org/) version 3.9 or newer\n  - [Fortran package manager (fpm)](https://github.com/fortran-lang/fpm) version 0.2.0 or newer\n\nGet the source by cloning the repository\n\n```\ngit clone https://github.com/toml-f/toml-f\ncd toml-f\n```\n\n#### Building with meson\n\nTo integrate TOML Fortran in your meson project checkout the [Integrate with meson](https://toml-f.readthedocs.io/en/latest/how-to/integration.html#integrate-with-meson) recipe.\n\nTo build this project with meson a build-system backend is required, *i.e.* [ninja](https://ninja-build.org) version 1.7 or newer.\nSetup a build with\n\n```\nmeson setup _build --prefix=/path/to/install\n```\n\nYou can select the Fortran compiler by the `FC` environment variable.\nTo compile the project run\n\n```\nmeson compile -C _build\n```\n\nWe employ a [validator suite](https://github.com/BurntSushi/toml-test) to test the standard compliance of this implementation.\nTo use this testing a `go` installation is required.\nThe installation of the validator suite will be handled by meson automatically without installing into the users `go` workspace.\nRun the tests with\n\n```\nmeson test -C _build --print-errorlogs\n```\n\nThe binary used for transcribing the TOML documents to the testing format is `_build/test/toml2json` and can be used to check on per test basis.\n\nFinally, you can install TOML Fortran using\n\n```\nmeson install -C _build\n```\n\n\n\n### Building with CMake\n\nTo integrate TOML Fortran in your CMake project checkout the [Integrate with CMake](https://toml-f.readthedocs.io/en/latest/how-to/integration.html#integrate-with-cmake) recipe.\n\nWhile meson is the preferred way to build this project it also offers CMake support.\nConfigure the CMake build with\n\n```\ncmake -B _build -G Ninja -DCMAKE_INSTALL_PREFIX=/path/to/install\n```\n\nSimilar to meson the compiler can be selected with the `FC` environment variable.\nYou can build the project using\n\n```\ncmake --build _build\n```\n\nYou can run basic unit tests using\n\n```\nctest --test-dir _build\n```\n\nThe validation suite is currently not supported as unit test for CMake builds and requires a manual setup instead using the `toml2json` binary.\n\nFinally, you can install TOML Fortran using\n\n```\ncmake --install _build\n```\n\n\n### Building with fpm\n\nTo integrate TOML Fortran in your fpm project checkout the [Using the Fortran package manager](https://toml-f.readthedocs.io/en/latest/how-to/integration.html#using-the-fortran-package-manager) recipe.\n\nThe Fortran package manager ([fpm](https://github.com/fortran-lang/fpm)) supports the addition of TOML Fortran as a dependency.\nIn the package manifest, `fpm.toml`, you can add TOML Fortran dependency via:\n\n```toml\n[dependencies]\ntoml-f.git = \"https://github.com/toml-f/toml-f\"\n```\n\nThen build and test normally.\n\n```\nfpm build\nfpm test\n```\n\nA more detailed example is described in [example 1](test/example-1).\n\n\n## Documentation\n\nThe user documentation is available at [readthedocs](https://toml-f.readthedocs.io).\nAdditionally, the [FORD](https://github.com/Fortran-FOSS-Programmers/ford) generated API documentation is available [here](https://toml-f.github.io/toml-f).\n\nTo build the user documentation locally we use sphinx, install the dependencies you can use the *mamba* package manager\n\n```\nmamba create -n sphinx --file doc/requirements.txt\nmamba activate sphinx\n```\n\nThe documentation is build with\n\n```\nsphinx-build doc _doc\n```\n\nYou can inspect the generated documentation by starting a webserver\n\n```\npython3 -m http.server -d _doc\n```\n\nAnd open the shown URL in a browser.\n\n\n### Translating the documentation\n\nThe documentation of TOML Fortran can be fully translated.\nBefore adding a translation, reach out to the repository maintainers by creating and issue or starting a discussion thread.\n\nTo start a new translation you need the `sphinx-intl` package which can be installed with *mamba*\n\n```\nmamba install -n sphinx sphinx-intl\n```\n\nTo add a new language to the translation extract the text with `sphinx-build` and create the respective locales with `sphinx-intl` using the commands shown below.\n\n```\nsphinx-build -b gettext doc _gettext\nsphinx-intl update -l en -p _gettext -d doc/locales\n```\n\nReplace the argument to the language flag `-l` with your target language, the language keys are listed [here](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language).\nThe same workflow can be used for updating existing locales.\nThe translation files are available in `doc/locales` and can be translated using a translation-editor, like [gtranslator](https://wiki.gnome.org/Apps/Gtranslator) or [poedit](https://poedit.net/).\n\nAfter a new translation is merged, a maintainer will create a new translation for the readthedocs to ensure it shows up at the pages.\n\n\n### Generating the API docs\n\nThe API documentation is generated with [FORD](https://github.com/Fortran-FOSS-Programmers/ford).\nWe are looking for a better tool to automatically extract the documentation, suggestions and help with this effort are welcome.\n\nThe required programs can be installed with *mamba*\n\n```\nmamba create -n ford ford\nmamba activate ford\n```\n\nTo generate the pages use\n\n```\nford docs.md -o _ford\n```\n\nYou can inspect the generated documentation by starting a webserver\n\n```\npython3 -m http.server -d _ford\n```\n\n\n## Usage\n\nTo make use of this library use the `tomlf` module in your projects.\nYou can access the individual modules but those are not considered part of the public API and might change between versions.\n\nAn example program to load and dump a TOML file would look like this:\n\n```fortran\nuse tomlf\nimplicit none\ncharacter(len=*), parameter :: nl = new_line(\"a\")\ntype(toml_table), allocatable :: table\ncharacter(len=:), allocatable :: input_string\ntype(toml_serializer) :: ser\n\ninput_string = \u0026\n   \u0026 '# This is a TOML document.' // nl // \u0026\n   \u0026 'title = \"TOML Example\"' // nl // \u0026\n   \u0026 '[owner]' // nl // \u0026\n   \u0026 'name = \"Tom Preston-Werner\"' // nl // \u0026\n   \u0026 'dob = 1979-05-27T07:32:00-08:00 # First class dates' // nl // \u0026\n   \u0026 '[database]' // nl // \u0026\n   \u0026 'server = \"192.168.1.1\"' // nl // \u0026\n   \u0026 'ports = [ 8001, 8001, 8002 ]' // nl // \u0026\n   \u0026 'connection_max = 5000' // nl // \u0026\n   \u0026 'enabled = true' // nl // \u0026\n   \u0026 '[servers]' // nl // \u0026\n   \u0026 '  # Indentation (tabs and/or spaces) is allowed but not required' // nl // \u0026\n   \u0026 '  [servers.alpha]' // nl // \u0026\n   \u0026 '  ip = \"10.0.0.1\"' // nl // \u0026\n   \u0026 '  dc = \"eqdc10\"' // nl // \u0026\n   \u0026 '  [servers.beta]' // nl // \u0026\n   \u0026 '  ip = \"10.0.0.2\"' // nl // \u0026\n   \u0026 '  dc = \"eqdc10\"' // nl // \u0026\n   \u0026 '[clients]' // nl // \u0026\n   \u0026 'data = [ [\"gamma\", \"delta\"], [1, 2] ]' // nl // \u0026\n   \u0026 '# Line breaks are OK when inside arrays' // nl // \u0026\n   \u0026 'hosts = [' // nl // \u0026\n   \u0026 '  \"alpha\",' // nl // \u0026\n   \u0026 '  \"omega\"' // nl // \u0026\n   \u0026 ']'\n\ncall toml_loads(table, input_string)\nif (allocated(table)) then\n   call table%accept(ser)\n   call table%destroy  ! not necessary\nend if\nend\n```\n\nHere the TOML document is provided as string, notice that you have to add a newline character by using the intrinsic function `new_line(\"a\")` to get the lines correctly.\n\nAlternatively, a file can be loaded from any connected, formatted unit using the same overloaded function.\nFor the standard input the intrinsic `input_unit` should be passed.\nIf the TOML file is successfully parsed the table will be allocated and can be written to the standard output by passing the `toml_serializer` as visitor to the table.\n\nFor more details checkout the [documentation pages](https://toml-f.readthedocs.io).\nIf you find an error in the documentation or a part is incomplete, please [open an issue](https://github.com/toml-f/toml-f/issues) or start a [discussion thread](https://github.com/orgs/toml-f/discussions).\n\n\n## Contributing\n\nThis is a volunteer open source project and contributions are always welcome.\nPlease, take a moment to read the [contributing guidelines](CONTRIBUTING.md) on how to get involved in TOML-Fortran.\n\n\n## License\n\nTOML-Fortran is free software: you can redistribute it and/or modify it under the terms of the [Apache License, Version 2.0](LICENSE-Apache) or [MIT license](LICENSE-MIT) at your opinion.\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _as is_ basis, without warranties or conditions of any kind, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in TOML-Fortran by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoml-f%2Ftoml-f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoml-f%2Ftoml-f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoml-f%2Ftoml-f/lists"}