f90nml
Fortran 90 namelist parser
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 f90nmluv
uv add f90nmlpoetry
poetry add f90nmlInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
fparserfparser parses Fortran source code (Fortran 77…
permissive · top 15,000 on PyPI
tree-sitter-fortranProvides a Fortran language grammar for…
permissive · top 5,000 on PyPI
resforesfo parses binary and ASCII output files from…
copyleft · top 15,000 on PyPI
fyppFypp is a Python-powered preprocessor for…
permissive · top 15,000 on PyPI
python-frontmatterParses and manages text files with YAML (or…
permissive · top 5,000 on PyPI
dynamic-yamlAdds dynamic string interpolation to YAML…
permissive · top 15,000 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
ruamel.yamlLoads and dumps YAML 1.2 with round-trip…
permissive · top 1,000 on PyPI
resdataResData reads and writes result files from…
copyleft · top 15,000 on PyPI
fckitlibProvides Fortran modules and a unit testing…
unclear · top 15,000 on PyPI