Airbyte source connector for RKI COVID-19 data from the German Robert Koch-Institut API
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
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.
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:])
"""Direct execution entry point for programmatic access and testing.
# main.py entry point
if __name__ == "__main__":
run()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"""main.py)# Direct execution script
from source_rki_covid.run import run
if __name__ == "__main__":
run()# 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# 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'])# 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:])The entry point supports all standard Airbyte protocol commands:
Returns the connector's configuration specification.
source-rki-covid specReturns JSON schema defining the required start_date parameter.
Tests connection to the RKI COVID-19 API.
source-rki-covid check --config config.jsonValidates configuration and tests API connectivity.
Returns the catalog of available data streams.
source-rki-covid discover --config config.jsonReturns catalog with all 16 available streams and their schemas.
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.
The connector expects a JSON configuration file:
{
"start_date": "2023-01-01"
}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.
The launch function provides comprehensive error handling:
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