Skip to content

Core API

API Documentation

The core API provides the main entry point for connecting to Nexus and initializing the filesystem.

nexus.connect()

The main entry point for using Nexus. Auto-detects deployment mode and returns the appropriate client.

def connect(
    config: str | Path | dict | NexusConfig | None = None
) -> Embedded

Parameters: - config (optional): Configuration source - None: Auto-discover from environment/files (default) - str | Path: Path to config file (.yaml or .json) - dict: Configuration dictionary - NexusConfig: Pre-loaded configuration object

Returns: - NexusFilesystem: Nexus filesystem instance (mode-dependent)

Raises: - ValueError: If configuration is invalid - NotImplementedError: If mode is not yet implemented (monolithic/distributed)

Examples:

# Auto-detect (uses defaults)
nx = nexus.connect()

# With inline config
nx = nexus.connect(config={"data_dir": "./my-data"})

# From config file
nx = nexus.connect(config="./config.yaml")

# From environment
# Set NEXUS_DATA_DIR=/path/to/data
nx = nexus.connect()

See Also

Next Steps

  1. Configure your backend storage
  2. Learn about file operations
  3. Set up permissions for multi-user environments