Utility Functions

Angreal provides utility functions for common operations when working with projects and commands.

Overview

These utilities help with:

  • Project Structure - Locating the project root directory
  • Version Checking - Ensuring the right Angreal version is used

Key Functions

FunctionDescriptionDocumentation
get_rootGet the root directory of the Angreal projectAPI Reference
required_versionCheck for minimum required Angreal versionAPI Reference

Example

import angreal
import os

# Check for required version
angreal.required_version("2.0.0")

# Get the project root
root_dir = angreal.get_root()
templates_dir = os.path.join(root_dir, "templates")

print(f"Project root: {root_dir}")
print(f"Templates directory: {templates_dir}")