Skip to content

API Reference

Purpose

This section provides technical specifications for all features of RDEToolKit. It is a comprehensive reference including detailed functionality, parameters, return values, and usage examples for each module.

API Documentation Structure

RDEToolKit's API documentation is structured using a hybrid approach:

  • Auto-generated parts: Detailed technical specifications generated from docstrings in source code
  • Manually created parts: Practical usage examples and inter-module collaboration methods

Core Modules

Workflow Management

  • workflows - Structured processing execution and workflow management
  • modeproc - Mode processing

Configuration and File Operations

  • config - Configuration file loading and management
  • fileops - RDE-related file operations

Data Processing

Representative Image Operations

Error Handling and Logging

Data Models

Configuration Models

Processing Result Models

  • Processing result management functionality is integrated into each module

Implementation Modules

Controllers

Interfaces

Command Line

Usage Patterns

Basic Usage

basic_usage.py
1
2
3
4
5
6
7
8
9
import rdetoolkit
from rdetoolkit.models.rde2types import RdeInputDirPaths, RdeOutputResourcePath

def my_dataset_function(srcpaths: RdeInputDirPaths, resource_paths: RdeOutputResourcePath):
    # Implement custom processing here
    pass

# Execute structured processing
result = rdetoolkit.workflows.run(custom_dataset_function=my_dataset_function)

Configuration File Usage

config_usage.py
1
2
3
4
5
6
7
8
from rdetoolkit.config import parse_config_file

# Load configuration file
config = parse_config_file()

# Reference configuration values
extended_mode = config.system.extended_mode
save_raw = config.system.save_raw

Error Handling

error_handling.py
1
2
3
4
5
6
7
8
from rdetoolkit.exceptions import RdeToolkitError
from rdetoolkit import workflows

try:
    result = workflows.run(custom_dataset_function=my_function)
except RdeToolkitError as e:
    print(f"RDEToolKit error: {e}")
    print(f"Error code: {e.error_code}")

API Version Information

Version Compatibility Major Changes
1.0.x Stable Initial release
1.1.x Backward compatible New features added
1.2.x Backward compatible Performance improvements

API Stability

Backward compatibility is maintained within major versions. Breaking changes only occur during major version upgrades.

Developer Information

Type Hints

RDEToolKit supports complete type hints:

type_hints.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from typing import Optional
from rdetoolkit.models.rde2types import RdeInputDirPaths, RdeOutputResourcePath

def process_data(
    srcpaths: RdeInputDirPaths,
    resource_paths: RdeOutputResourcePath,
    options: Optional[dict] = None
) -> bool:
    # Type-safe implementation
    return True

Next Steps

  • Specific module details: Refer to the module links above
  • Practical usage examples: User Guide
  • Contributing to development: Developer Guide