Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Fortran 90 namelist parser

Project Description

A Fortran 90 namelist parser

About f90nml

The f90nml module takes a Fortran 90 namelist file and parses it into a Python dict of namelist groups, each containing a dict of its variables. Fortran data types are converted to equivalent Python types.

Usage

To read a Fortran namelist file as a dict, use the read() method:

nml_dict = f90nml.read(nml_filename)

To output a Python dict as a Fortran namelist file, use the write() method:

f90nml.write(my_nml, output_filename)

This method will abort if the output file already exists.

Notes

The read method produces an NmlDict, which behaves as a dict with case-insensitive keys, due to the case insensitivity of Fortran. This implementation is currently not a true case-insensitive dict, and is only intended to accomodate individual references and assignments.

The following namelist features are currently not supported:

  • Index range support (v(i:j) = c)
  • Repeated indexing (v = r*c, r*)
  • Upcast vector elements if components differ (x(i) = int, x(j) = float)
  • Escape on repeated quotes ('This doesn''t parse correctly')
  • Type character resolver (x%y = c)
  • stdin/stdout support (?, ?=)

Licensing

f90nml is distributed under the Apache 2.0 License.

Contact

Marshall Ward <python@marshallward.org>

Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
f90nml-0.1.tar.gz (7.2 kB) Copy SHA256 Checksum SHA256 Source Feb 28, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting