csdms / standard_names

Python package for working with CSDMS Standard Names
MIT License
1 stars 1 forks source link

[Python][pypi-link] [Build Status][build-link] [PyPI][pypi-link] [Build Status][anaconda-link]

standard_names

Python utilities for working with CSDMS Standard Names.

CSDMS Standard Names is an element of the CSDMS Workbench, an integrated system of software tools, technologies, and standards for building and coupling models.

As Regular Expression

^                           # Start of the object name
[a-z]+                      # Starts with one or more lowercase letters
(?:                         # Start of a non-capturing group for subsequent parts
    [-~_]?                  # Optional separator: hyphen, tilde, or underscore
    [a-zA-Z0-9]+            # One or more alphanumeric characters
)*                          # Zero or more repetitions of the group
__                          # Double underscore separator
[a-z]+                      # Start of the quantity
(?:                         # Start of a non-capturing group for subsequent parts
    [-~_]?                  # Optional separator: hyphen, tilde, or underscore
    [a-zA-Z0-9]+            # One or more alphanumeric characters
)*                          # Zero or more repetitions of the group
$                           # End of the name

As Parsing Expression Grammar

Start
    = LowercaseWord UnderscoreSeparator LowercaseWord

LowercaseWord
    = [a-z] AdditionalCharacters*

AdditionalCharacters
    = Separator? Alphanumeric+

Separator
    = "-" / "~" / "_"

Alphanumeric
    = [a-zA-Z0-9]

UnderscoreSeparator
    = "__"

Links