Skip to main content

Atmos Automation Language Reference

The Atmos Automation Language is based on Starlark, a Python-like language. This reference covers its syntax, data types, and execution rules. For a first program and instructions to run it, start with Custom CLI Apps.

What this reference covers​

The language is Starlark with four options that Atmos turns on: control flow such as if and for at the top level of a file, while loops, sets through the set() function, and recursion. Atmos uses .star files for standalone scripts. Values such as integers, strings, lists, and dictionaries are built into the language. Atmos also supplies sum() and round() for numeric calculations. Functions for running commands and reading component configuration are supplied by Atmos.

This reference covers the language. For the Atmos-supplied helpers and values, such as exec.run, steps.parallel, fs.read_file, ctx, and output, see the automation function reference. For how scripts run in each entry point, see the script step and the overview in Atmos Automation Language.

A first script shows the pieces together:

def capacity(replicas, workers_per_replica):
if replicas < 1:
fail("replicas must be positive")
return replicas * workers_per_replica

print("Total workers: {}".format(capacity(3, 4))) # Total workers: 12

Topics​

  1. Lexical Elements covers how source text is read: comments, identifiers, keywords, literals, indentation, and line continuation.
  2. Data Types covers None, booleans, integers, floats, strings, bytes, lists, tuples, dictionaries, sets, functions, and how values compare and convert.
  3. Expressions and Operators covers operator precedence, comparisons, slicing, comprehensions, conditional expressions, and calls.
  4. Statements covers assignment, if, for, while, def, return, load, and the other statements.
  5. Built-in Functions lists the universal constants and functions, and maps the names that Atmos adds.
  6. Methods lists the methods of strings, lists, dictionaries, sets, and bytes.
  7. Execution Model explains single-assignment globals, frozen values, determinism, errors and tracebacks, recursion, cancellation, module loading, output streams, and dry runs.
  8. Differences from Python gives Python programmers a practical list of what works differently or is missing.

Where to go next​

  • Atmos Automation Language introduces the language, why Atmos uses Starlark, and how each entry point supplies inputs.
  • Automation Functions documents every helper and value that Atmos adds, one page each.
  • Script step describes type: script with interpreter: starlark, including module paths, working directory, containers, and dry runs.