Skip to content

jacobwilliams/fastnml

Repository files navigation


A Python library to quickly read Fortran namelists.

CI Status PyPI Downloads Conda Downloads

Description

The fastnml code only works with a specific subset of the namelist format. It is not nearly as general or robust as f90nml, but it is much faster when reading very large namelists. Also, both codes are tested using multiprocessing to read many namelists in parallel.

This library assumes the namelist is written one value per line. This includes all types and array elements. For example:

&nml
 a = 1,
 c%a(1)%b = 1.0,
 c%a(2)%b = 1.0,
 d(1) = 2,
 d(2) = 3
/

If the simple parser fails, it defaults to using f90nml to read it.

Installing

  • Install from PyPI using pip: pip install fastnml
  • Install from conda-forge using conda: conda install -c conda-forge fastnml

Documentation

The API documentation for the current master branch can be found here. This is generated with pdoc3 by running pdoc --html fastnml --force.

Dependencies

  • f90nml -- the more general library

Other links

About

Python module for reading and writing Fortran namelists

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published