or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

tessl/pypi-source-rki-covid

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

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/source-rki-covid@0.1.x

To install, run

npx @tessl/cli install tessl/pypi-source-rki-covid@0.1.0

0

# Source RKI COVID

1

2

An Airbyte source connector for accessing COVID-19 data from the German Robert Koch-Institut (RKI) public API. This connector provides comprehensive access to German epidemiological data including national statistics, state-level breakdowns, age group analyses, and historical trends across multiple metrics.

3

4

## Package Information

5

6

- **Package Name**: source-rki-covid

7

- **Package Type**: Python (Airbyte connector)

8

- **Language**: Python

9

- **Installation**: Available through Airbyte connector catalog

10

- **Dependencies**: airbyte-cdk 0.80.0

11

12

## Core Imports

13

14

```python

15

from source_rki_covid import SourceRkiCovid

16

```

17

18

For running the connector:

19

20

```python

21

from source_rki_covid.run import run

22

```

23

24

## Basic Usage

25

26

```python

27

from source_rki_covid import SourceRkiCovid

28

29

# Initialize the source

30

source = SourceRkiCovid()

31

32

# Configuration (requires start_date)

33

config = {

34

"start_date": "2023-01-01" # UTC date in YYYY-MM-DD format

35

}

36

37

# Check connection

38

is_valid, error = source.check_connection(logger=None, config=config)

39

40

# Get available streams

41

streams = source.streams(config)

42

print(f"Available streams: {len(streams)}") # Returns 16 streams

43

```

44

45

## Architecture

46

47

The connector follows Airbyte's standard source architecture using the Airbyte CDK:

48

49

- **SourceRkiCovid**: Main source class inheriting from AbstractSource

50

- **Stream Classes**: 16 specialized stream classes for different data endpoints

51

- **Base Classes**: Abstract base classes providing common functionality

52

- **Configuration**: Simple schema requiring only a start_date parameter

53

54

The connector organizes COVID-19 data into logical streams covering:

55

- Current snapshots (Germany, states, age groups)

56

- Historical trends with incremental sync capability

57

- State-level historical data with full refresh

58

59

## Capabilities

60

61

### Main Source Interface

62

63

The primary connector interface providing connection testing and stream discovery functionality.

64

65

```python { .api }

66

class SourceRkiCovid(AbstractSource):

67

def check_connection(self, logger, config) -> Tuple[bool, any]: ...

68

def streams(self, config: Mapping[str, Any]) -> List[Stream]: ...

69

```

70

71

[Main Source](./main-source.md)

72

73

### Current Data Streams

74

75

Full-refresh streams providing current COVID-19 statistics snapshots for Germany overall, individual states, and age group breakdowns.

76

77

```python { .api }

78

class Germany(RkiCovidStream): ...

79

class GermanyStates(RkiCovidStream): ...

80

class GermanyAgeGroups(RkiCovidStream): ...

81

class GermanyStatesAgeGroups(RkiCovidStream): ...

82

```

83

84

[Current Data Streams](./current-data-streams.md)

85

86

### Historical Data Streams (Germany)

87

88

Incremental streams providing historical COVID-19 data for Germany with date-based cursor synchronization. Supports cases, deaths, recovered, incidence, frozen incidence, and hospitalization metrics.

89

90

```python { .api }

91

class GermanyHistoryCases(IncrementalRkiCovidStream): ...

92

class GermanHistoryIncidence(IncrementalRkiCovidStream): ...

93

class GermanHistoryDeaths(IncrementalRkiCovidStream): ...

94

class GermanHistoryRecovered(IncrementalRkiCovidStream): ...

95

class GermanHistoryFrozenIncidence(IncrementalRkiCovidStream): ...

96

class GermanHistoryHospitalization(IncrementalRkiCovidStream): ...

97

```

98

99

[Historical Data Streams (Germany)](./historical-data-streams.md)

100

101

### State Historical Data Streams

102

103

Full-refresh streams providing historical COVID-19 data for all German states. Covers the same metrics as Germany historical streams but with state-level granularity and different sync behavior.

104

105

```python { .api }

106

class StatesHistoryCases(ByStateRkiCovidStream): ...

107

class StatesHistoryIncidence(ByStateRkiCovidStream): ...

108

class StatesHistoryFrozenIncidence(ByStateRkiCovidStream): ...

109

class StatesHistoryDeaths(ByStateRkiCovidStream): ...

110

class StatesHistoryRecovered(ByStateRkiCovidStream): ...

111

class StatesHistoryHospitalization(ByStateRkiCovidStream): ...

112

```

113

114

[State Historical Data Streams](./state-historical-streams.md)

115

116

### Entry Point Functions

117

118

Console script entry point and programmatic execution functions for running the connector.

119

120

```python { .api }

121

def run(): ...

122

```

123

124

[Entry Point Functions](./entry-points.md)

125

126

## Configuration Schema

127

128

```python { .api }

129

{

130

"start_date": {

131

"type": "string",

132

"title": "Start Date",

133

"description": "UTC date in the format 2017-01-25. Any data before this date will not be replicated.",

134

"required": True

135

}

136

}

137

```

138

139

## Types

140

141

```python { .api }

142

from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple

143

from abc import ABC

144

from airbyte_cdk.sources import AbstractSource

145

from airbyte_cdk.sources.streams import Stream

146

from airbyte_cdk.sources.streams.http import HttpStream

147

import requests

148

```

149

150

## Stream Overview

151

152

The connector provides 16 total streams organized into three categories:

153

154

- **4 Current Data Streams**: Full-refresh snapshots of current statistics

155

- **6 Historical Germany Streams**: Incremental sync of historical national data

156

- **6 State Historical Streams**: Full-refresh historical data for all states

157

158

All streams connect to the RKI COVID API at `https://api.corona-zahlen.org/` and provide comprehensive coverage of German COVID-19 epidemiological data for analytics, reporting, and research applications.