External Helper Packages (R, Python, Julia)

To facilitate the consumption of T-Lang build artifacts from within other languages, we provide lightweight helper packages for R, Python, and Julia. All these packages are named tlang in their respective ecosystems. These packages allow you to easily locate and read built nodes from a T pipeline without manually parsing build logs or resolving Nix store paths.

Automatic Availability

These packages are automatically installed and loaded in every R, Python, and Julia node in a T pipeline. You do not need to install them manually. The read_node() function and its dependencies are ready to use immediately.

For project development shells, t update also wires the matching companion package into flake.nix whenever you declare dependencies in [r-dependencies], [py-dependencies], or [jl-dependencies], so the helper is available from nix develop as well.

Key Features

Reading values

Reading code

Inspecting structure and status

Failures and warnings

Build history

Comparing artifacts

Shared arguments

Automatic readers by serializer

Serializer R reader (package) Python reader (package) Julia reader (package)
default readRDS() (base) pickle, then dill, then cloudpickle (stdlib) Serialization.deserialize (stdlib)
^json jsonlite::read_json() (jsonlite) json.load() (stdlib) JSON.parsefile() (JSON)
^csv read.csv() (base) pandas.read_csv() (pandas) CSV.read() (CSV, DataFrames)
^ipc arrow::read_ipc_file() (arrow) pyarrow.ipc (pandas, pyarrow) Arrow.Table (Arrow, DataFrames)
^parquet arrow::read_parquet() (arrow) pyarrow.parquet (pandas, pyarrow) Parquet2.readfile() (Parquet2, DataFrames)
^text exact file bytes (base) exact file bytes (stdlib) exact file bytes (stdlib)
^pmml, ^onnx, ^bin no built-in reader no built-in reader no built-in reader

Missing reader packages raise an error naming the package and the tproject.toml entries. ^pmml, ^onnx, and ^bin always raise: use return_path = TRUE plus a custom deserializer.

Cross-language notes


R: tlang

The R package is automatically loaded in all R nodes.

Usage

# read_node is available by default
# library(tlang) is called automatically

# Read the latest 'my_data' node
df <- read_node("my_data")

# Get only the path to the artifact
path <- read_node("my_model", return_path = TRUE)

# Inspect the pipeline DAG (returns a data.frame)
nodes <- pipeline_nodes()

# Inspect nodes with their latest build status
tbl <- inspect_pipeline()

# Read a node plus its downstream nodes
tree <- read_node_tree("clean_data")

# Read a failed node's error and warnings (same names as T)
msg <- error_msg("model")
msg <- warning_msg("model")

# Show a node's source for copy-paste tweaking
cat(show_code("model"))
# Compare R-native artifacts across historical builds
diff <- diff_nodes("model", "model", which_log_a = "20260501", which_log_b = "latest")

Python: tlang

The Python package is automatically imported in all Python nodes.

Usage

# read_node is available by default
# import tlang is called automatically

# Read the latest 'my_data' node
df = tlang.read_node("my_data")

# Get only the path to the artifact
path = tlang.read_node("my_model", return_path=True)

# Inspect the pipeline DAG (returns a dict)
nodes = tlang.pipeline_nodes()

# Inspect nodes with their latest build status
rows = tlang.inspect_pipeline()

# Read a node plus its downstream nodes
tree = tlang.read_node_tree("clean_data")

# Read a failed node's error and warnings (same names as T)
msg = tlang.error_msg("model")
msg = tlang.warning_msg("model")

# Show a node's source for copy-paste tweaking
print(tlang.show_code("model"))
# Compare Python-native artifacts across historical builds
diff = tlang.diff_nodes("model", "model", which_log_a="20260501", which_log_b="latest")

Julia: tlang

The Julia package is automatically loaded with using tlang in all Julia nodes.

Usage

# read_node is available by default
# using tlang is called automatically

# Read the latest 'my_data' node
df = read_node("my_data")

# Get only the path to the artifact
path = read_node("my_model", return_path=true)

# Compare Julia-native artifacts across historical builds
diff = diff_nodes("my_model", "my_model", which_log_a="20260501", which_log_b="latest")

# Inspect the pipeline DAG (returns a Dict)
nodes = pipeline_nodes()

# Inspect nodes with their latest build status
rows = inspect_pipeline()

# Read a node plus its downstream nodes
tree = read_node_tree("clean_data")

# Read a failed node's error and warnings (same names as T)
msg = error_msg("model")
msg = warning_msg("model")

# Show a node's source for copy-paste tweaking
println(show_code("model"))

How it Works

When you run build_pipeline(), T-Lang generates a timestamped build log (e.g., _pipeline/build_log_20260514_160236.json). These helper packages:

  1. Scan the _pipeline/ directory for build_log_*.json files.
  2. Sort them reverse-alphabetically to find the most recent one.
  3. Parse the JSON to find the entry for the requested node.
  4. Resolve the path (which might be relative to the project root or an absolute Nix store path).
  5. Pick the reader from the entry’s serializer field (see the table above), or call the custom deserializer when one is passed.

When T’s node_diff() delegates to these helpers for runtime-native object comparisons, it preserves the original native artifact only for nodes using the standard default or tobj serializers. If you use a custom serializer name, call the helper package directly and pass the matching deserializer yourself. Julia-native diffs invoked from T currently launch a fresh Julia helper process for each comparison, so repeated large diffs will include Julia startup cost.