Skip to main content
def get_context(
    name: str,
    *,
    project: Optional[str] = None,
    api_key: Optional[str] = None,
) -> Dict[str, Any]:

source code

Get information about a specific context including its versioning status and current version. Arguments:
  • name - Name of the context to get.
  • project - Name of the project the context belongs to.
  • api_key - If specified, unify API key to be used. Defaults to the value in the
Returns: A dictionary containing context information with the following keys:
  • name (str): Name of the context
  • description (str): Description of the context
  • is_versioned (bool): Whether the context is versioned
  • allow_duplicates (bool): Whether duplicates are allowed
  • unique_keys (list): List of unique key column names
  • auto_counting (dict): Auto-counting configuration
  • foreign_keys (list): List of foreign key definitions, each containing:
  • name: FK column name or nested path (e.g., “tag_ids[]”, “images[].image_id”, “metadata.user.id”)
  • references: Referenced context and column
  • on_delete: Action on delete (CASCADE, SET NULL)
  • on_update: Action on update (CASCADE, SET NULL)
  • is_nested: Boolean indicating if this uses a nested path
  • path_segments: Parsed path structure (for nested FKs) Example: context_info = get_context(name=“Employees”, project=“my_project”)