Command Line Interface
Relevant source files
The following files were used as context for generating this wiki page:
The Command Line Interface (CLI) for flext-tap-oracle-wms serves as the primary entry point for executing data extraction tasks from Oracle Warehouse Management Systems. It is built to be Singer-compliant, allowing it to integrate seamlessly with data orchestration tools like Meltano. The CLI handles configuration validation, entity discovery, and the actual streaming of data to standard output in the Singer format.
Sources: src/flext_tap_oracle_wms/README.md, meltano.yml:45-50
Architecture and Entry Points
The CLI implementation is primarily contained within cli.py, with __main__.py serving as the module execution entry point. The project exposes two primary executable commands via standard Python entry points defined in the build configuration.
Executable Commands
| Command | Entry Point Function | Description |
|---|---|---|
flext-tap-oracle-wms | flext_tap_oracle_wms.cli:main | Primary package-prefixed executable |
tap-oracle-wms | flext_tap_oracle_wms.cli:main | Standard Singer tap alias |
Sources: pyproject.toml:132-134, src/flext_tap_oracle_wms/README.md:27
Execution Flow
The CLI follows a standard Singer tap execution lifecycle. It initializes the tap with a configuration file, performs discovery or extraction based on provided flags, and outputs Singer-formatted messages.
CLI Modes and Capabilities
The CLI supports the core capabilities required by the Singer Spec, which are orchestrated through parameters passed during execution.
Capabilities Table
| Capability | Flag | Description |
|---|---|---|
| Catalog | --catalog | Uses a provided catalog file to determine which streams to extract. |
| Discovery | --discover | Generates a JSON catalog of available entities and their schemas. |
| State | --state | Enables incremental replication by processing state files from previous runs. |
Sources: meltano.yml:47-50, tests/e2e/README.md:78-85
Discovery Workflow
When the --discover flag is used, the CLI triggers the EntityDiscovery logic. This component communicates with the Oracle WMS API to extract metadata and generate Singer-compliant schemas. The output is a JSON catalog containing stream definitions and their properties.
Sources: src/flext_tap_oracle_wms/README.md:40-45, tests/e2e/README.md:44-53
Extraction Workflow
During extraction, the CLI manages the data flow from the Oracle WMS HTTP client to the standard output. It implements pagination using the WMSPaginator to handle HATEOAS links provided by the Oracle WMS API.
Sources: src/flext_tap_oracle_wms/README.md:90-95, tests/e2e/README.md:55-65
Configuration Management
The CLI requires a JSON configuration file (typically passed via --config). This file is validated against Pydantic models to ensure all required parameters for WMS connectivity and authentication are present.
Key Configuration Parameters
| Parameter | Env Variable | Description |
|---|---|---|
base_url | WMS_BASE_URL | The Oracle WMS instance URL. |
auth_method | WMS_AUTH_METHOD | Either basic or oauth2. |
company_code | WMS_COMPANY_CODE | The WMS specific company identifier. |
facility_code | WMS_FACILITY_CODE | The WMS specific facility identifier. |
page_size | TAP_ORACLE_WMS_PAGE_SIZE | Number of records per API request (1-1250). |
Sources: meltano.yml:144-154, src/flext_tap_oracle_wms/README.md:97-101
CLI Interaction Sequence
The following diagram illustrates the interaction between the CLI user, the internal Tap components, and the Oracle WMS API during a typical discovery operation.
Summary
The CLI for flext-tap-oracle-wms is a robust interface that abstracts the complexity of Oracle WMS API interactions into standard Singer protocol commands. By supporting discovery, catalog-based extraction, and state-based incremental replication, it enables efficient data synchronization within the FLEXT ecosystem. The implementation leverages Pydantic for strict configuration validation and the Singer SDK for protocol compliance.
Sources: src/flext_tap_oracle_wms/README.md:15-25, meltano.yml:1-10