jonquil Module

Public API for Jonquil - JSON parser and serializer for Fortran.

This module provides the main entry point for working with JSON data in Fortran. It re-exports types and procedures from TOML Fortran with JSON-appropriate naming, enabling seamless interoperability between JSON and TOML data structures.

Quick Start

use jonquil
class(json_value), allocatable :: val
type(json_error), allocatable :: error

! Parse JSON from a string
call json_loads(val, '{"key": "value"}', error=error)

! Serialize back to JSON
print '(a)', json_serialize(val)

Main Types

  • json_object - JSON object (key-value mapping), see toml_table
  • json_array - JSON array, see toml_array
  • json_value - Base type for all JSON values, see toml_value
  • json_error - Error information from parsing/serialization, see toml_error

Main Procedures