Skip to content

export

Tools for exporting data from the EleanorAI Framework

Classes

ExportCLI

ExportCLI(config: str | None = None)

Bases: BaseCLI

CLI tool to export JSON schemas for Pydantic models.

CLI base class

Warning

An odd behavior with Fire has been observed where subclasses of BaseCLI take override __init__ and take parameters caus Fire to incorrectly identify self as a required CLI argument.

Parameters:

  • config (str, default: None ) –

    Path to configuration file

Attributes

IGNORED_PATHS class-attribute instance-attribute
IGNORED_PATHS = [
    "pydantic.BaseModel",
    "eleanor.base_types.BaseDataModel",
]

Functions

json_schema
json_schema(base_dir: str) -> None

Generate and export JSON schemas for internal Pydantic types.

This command scans through Python packages recursively and looks for Pydantic models. When found, the model’s JSON schema will be exported and saved. Exported schemas are intended to be as human-readable as possible with proper indenting.

Parameters:

  • base_dir (str) –

    The base directory where exported JSON schemas will be saved.

The output naming convention is: base_dir/version/eleanor/settings/module_path/pydantic_class_name.json, where version is the current version of the eleanor package.

If the destination folder base_dir/version exists, it will be deleted along with its contents.

name classmethod
name() -> str

Return the name of this CLI command.

Returns:

  • str ( str ) –

    The name of the CLI command.