skillfed

f90nml

Fortran 90 namelist parser

f90nml v1.5 163.3K downloads/30d#10,574 on PyPI149
Permissive license Apache-2.0 Active released

What it is and what it does

f90nml is a Python parser and editor for Fortran namelist files, the configuration format used in many scientific computing and weather modeling applications. It reads namelist syntax into Python dictionaries, allowing you to inspect and modify values programmatically, then write them back to disk while optionally preserving comments and formatting. The package includes both a Python API and a command-line tool for shell-based manipulation.

It handles Fortran data type conversions automatically (arrays, floats, booleans, strings) and supports exporting to JSON and YAML formats for integration with other tools. With zero runtime dependencies and support for Python 2.7 through 3.13, it integrates easily into existing workflows without adding installation friction.

Use it for:

  • Parse Fortran configuration files from weather models or scientific simulations to extract and validate parameters in Python.
  • Modify individual namelist values from shell scripts or CI/CD pipelines using the command-line interface.
  • Convert Fortran namelist configurations to JSON or YAML for documentation, version control, or cross-language tool integration.
  • Programmatically generate or patch namelist files for parameter sweeps in computational experiments.
  • Preserve formatting and comments in namelist files while making targeted edits using the patch function.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

f90nml reads, writes, and modifies Fortran namelist files, converting them to and from Python dictionaries and other formats like JSON and YAML.

Yes. f90nml is a stable, actively maintained tool with no dependencies, permissive licensing, and a clear niche: anyone working with Fortran namelists in Python will find it essential. The low install friction and broad Python version support make it a safe addition to scientific computing or climate modeling workflows.

Install

f90nml on PyPI

pip

pip install f90nml

uv

uv add f90nml

poetry

poetry add f90nml

Installing f90nml

Before you install

Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent commit on 2026-07-17 and has been stable since its initial release in 2014.

License in practice

Apache-2.0 is a permissive license that allows commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

import f90nml
nml = f90nml.read('sample.nml')
nml['config_nml']['steps'] = 432
nml.write('new_sample.nml')

Verify before relying

  • Whether YAML support requires PyYAML to be installed separately or if the [yaml] extras automatically handle the dependency.
  • Specific performance characteristics when parsing large or deeply nested namelist files.

Package facts

License Apache-2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 311 days since the last release
Last repo commit
First released
Downloads 163,277/month — #10,574 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: f90nml-1.5.0-py2.py3-none-any.whl; f90nml-1.5-py2.py3-none-any.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Utilities

Tags

fortran namelist parserread fortran namelist filesfortran config file editornamelist to json conversionfortran nml parser pythonmodify fortran namelistsfortran namelist command line
fortran-interopscientific-computingconfig-parsing

More Utilities packages