standard_names: a Python library for working with CSDMS Standard Names

The CSDMS Standard Names provide a comprehensive set of naming rules and patterns that are not specific to any particular modeling domain. They were also designed to have many other nice features such as parsability and natural alphabetical grouping. CSDMS Standard Names always consist of an object part and a quantity/attribute part and the quantity part may also have an operation prefix which can consist of multiple operations ([CsdmsCsn], [Peckham2014]).

standard_names is a Python package to define, query, operatate, and manipulate CSDMS Standard Names. It is distributed with a comprehensive list of the currently defined Standard Names [StandardNamesRegistry].

The standard_names package consists of two basic classes:

The standard_names package has a complete set up unit tests that are continually tested on Mac, Linux, and Windows. It is distributed both as source code [StandardNamesGitHub] and as Anaconda packages from Anaconda Cloud.

Quickstart

Install the standard_names package:

$ conda install standard_names -c csdms

Import the standard_names package:

>>> import standard_names as csn

Create a standard name from a string.

>>> name = csn.StandardName('air__temperature')
>>> name.object, name.quantity
('air', 'temperature')

Get a registry of the currently defined standard names.

>>> registry = csn.NamesRegistry()
>>> len(registry)
2652
>>> 'air__temperature' in registry
True

User Guide

Installation

standard_names has no dependencies other than Python itself. It runs on Python 2.7 and 3.x.

You can install it with conda from the csdms channel on Anaconda Cloud,

$ conda install standard_names -c csdms

After installing, you can check to see that everything installed correctly by starting Python and trying to import standard_names.

>>> import standard_names as csn
>>> csn.__version__
0.2.2
>>> csn.check()

Getting the code

You can also get the source code from GitHub. You can either clone it with git:

$ git clone git@github.com:csdms/standard_names

or download a snapshot of the latest code with either

$ curl -OL https://github.com/csdms/standard_names/tarball/master

(for a .tar.gz file) or

$ curl -OL https://github.com/csdms/standard_names/zipball/master

(for a .zip file).

Now that you have the source code, install it in your Python distribution with:

$ python setup.py install

References

[Peckham2014]

Extended abstract from IEMSS 2014.

Peckham, S. D, 2014. The CSDMS Standard Names: Cross-Domain Naming Conventions for Describing Process Models, Data Sets and Their Associated Variables, 7th International Conference on Environmental Modeling and Software,, International Environmental Modelling and Software Society.

[CsdmsCsn]

Detailed description of CSDMS Standard Names

http://csdms.colorado.edu/wiki/CSDMS_Standard_Names

[StandardNamesGitHub]

The standard_names source code on GitHub.

https://github.com/csdms/standard_names

[StandardNamesRegistry]

The current Standard Names Registry on GitHub.

https://github.com/csdms/standard_names_registry

[CfStandardNames]

CF Standard Names for ocean and atmosphere modeling.

http://cfconventions.org/Data/cf-standard-names/27/build/cf-standard-name-table.html

Indices and tables