CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-source-rki-covid

Airbyte source connector for RKI COVID-19 data from the German Robert Koch-Institut API

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

entry-points.mddocs/

Entry Point Functions

Console script entry point and programmatic execution functions for running the RKI COVID-19 source connector. These functions provide the interface between the Airbyte platform and the connector implementation.

Capabilities

Console Script Entry Point

Main entry point function registered as a console script for command-line execution.

def run():
    """
    Main entry point for the source-rki-covid connector.
    
    Creates a SourceRkiCovid instance and launches it using the Airbyte CDK
    launch function with command-line arguments.
    
    Usage:
    - Called automatically when running: source-rki-covid [command] [args]
    - Handles Airbyte protocol commands: spec, check, discover, read
    - Processes configuration and catalog from command-line arguments
    
    Implementation:
    source = SourceRkiCovid()
    launch(source, sys.argv[1:])
    """

Programmatic Entry Point

Direct execution entry point for programmatic access and testing.

# main.py entry point
if __name__ == "__main__":
    run()

Module Structure

Main Module (source_rki_covid.run)

# Module imports
import sys
from airbyte_cdk.entrypoint import launch
from source_rki_covid import SourceRkiCovid

def run():
    """Main connector execution function"""

Entry Script (main.py)

# Direct execution script
from source_rki_covid.run import run

if __name__ == "__main__":
    run()

Usage Examples

Command Line Execution

# Using console script (installed via pip/poetry)
source-rki-covid spec
source-rki-covid check --config config.json
source-rki-covid discover --config config.json
source-rki-covid read --config config.json --catalog catalog.json

# Using Python module directly
python -m source_rki_covid.run spec
python main.py check --config config.json

Programmatic Usage

# Import and run directly
from source_rki_covid.run import run
import sys

# Override command line arguments
sys.argv = ['source-rki-covid', 'spec']
run()

# Or use the source directly
from source_rki_covid import SourceRkiCovid
from airbyte_cdk.entrypoint import launch

source = SourceRkiCovid()
launch(source, ['spec'])

Integration with Airbyte CDK

# The run function delegates to Airbyte CDK launch
from airbyte_cdk.entrypoint import launch
from source_rki_covid import SourceRkiCovid

def run():
    source = SourceRkiCovid()
    # launch handles:
    # - Command parsing (spec, check, discover, read)
    # - Configuration validation
    # - Error handling and logging
    # - Protocol compliance
    launch(source, sys.argv[1:])

Airbyte Protocol Commands

The entry point supports all standard Airbyte protocol commands:

Spec Command

Returns the connector's configuration specification.

source-rki-covid spec

Returns JSON schema defining the required start_date parameter.

Check Command

Tests connection to the RKI COVID-19 API.

source-rki-covid check --config config.json

Validates configuration and tests API connectivity.

Discover Command

Returns the catalog of available data streams.

source-rki-covid discover --config config.json

Returns catalog with all 16 available streams and their schemas.

Read Command

Performs data synchronization from the API.

source-rki-covid read --config config.json --catalog catalog.json [--state state.json]

Executes data sync according to the provided catalog and optional state.

Configuration File Format

The connector expects a JSON configuration file:

{
    "start_date": "2023-01-01"
}

Console Script Registration

The entry point is registered in pyproject.toml:

[tool.poetry.scripts]
source-rki-covid = "source_rki_covid.run:run"

This creates the source-rki-covid command when the package is installed.

Dependencies

  • airbyte_cdk.entrypoint.launch: Airbyte CDK entry point handler
  • sys: System-specific parameters and functions for argument processing
  • source_rki_covid.SourceRkiCovid: Main connector class

Error Handling

The launch function provides comprehensive error handling:

  • Configuration Errors: Invalid or missing configuration parameters
  • Connection Errors: API connectivity issues
  • Schema Errors: Invalid catalog or state files
  • Runtime Errors: Unexpected exceptions during data sync

All errors are formatted according to Airbyte protocol standards and returned as structured JSON messages.

Install with Tessl CLI

npx tessl i tessl/pypi-source-rki-covid

docs

current-data-streams.md

entry-points.md

historical-data-streams.md

index.md

main-source.md

state-historical-streams.md

tile.json