0
# Core Connector Interface
1
2
The main connector class and entry point functions that provide the foundation for Airbyte integration and command-line usage. These classes form the core interface for interacting with the Jina AI Reader connector.
3
4
## Capabilities
5
6
### Main Source Connector
7
8
The primary connector class that extends Airbyte's declarative source framework to provide Jina AI Reader functionality.
9
10
```python { .api }
11
class SourceJinaAiReader(YamlDeclarativeSource):
12
"""
13
Main connector class for Jina AI Reader source.
14
15
Inherits from YamlDeclarativeSource and automatically loads configuration
16
from the manifest.yaml file to define streams and connection behavior.
17
"""
18
def __init__(self):
19
"""
20
Initialize the source connector.
21
22
Automatically configures the connector using the manifest.yaml file
23
which defines the reader and search streams along with their schemas.
24
"""
25
```
26
27
**Usage Example:**
28
29
```python
30
from source_jina_ai_reader import SourceJinaAiReader
31
32
# Create connector instance
33
source = SourceJinaAiReader()
34
35
# Use with Airbyte framework for spec, check, discover, read operations
36
```
37
38
### Entry Point Function
39
40
The main entry point function for command-line execution of the connector.
41
42
```python { .api }
43
def run() -> None:
44
"""
45
Main entry point for the connector.
46
47
Handles command-line arguments, applies configuration migrations,
48
and launches the connector using Airbyte's entrypoint system.
49
50
This function:
51
1. Creates a SourceJinaAiReader instance
52
2. Applies any necessary config migrations via JinaAiReaderConfigMigration
53
3. Launches the connector with sys.argv arguments
54
55
Usage:
56
- Called automatically when using: poetry run source-jina-ai-reader
57
- Called from main.py when running the connector directly
58
"""
59
```
60
61
**Usage Example:**
62
63
```python
64
from source_jina_ai_reader.run import run
65
66
# Run the connector (typically called from command line)
67
run()
68
```
69
70
### Command Line Interface
71
72
The connector provides standard Airbyte operations through the command line:
73
74
```bash
75
# Get connector specification (configuration schema)
76
poetry run source-jina-ai-reader spec
77
78
# Validate configuration
79
poetry run source-jina-ai-reader check --config secrets/config.json
80
81
# Discover available streams and their schemas
82
poetry run source-jina-ai-reader discover --config secrets/config.json
83
84
# Read data from configured streams
85
poetry run source-jina-ai-reader read --config secrets/config.json --catalog catalog.json
86
```
87
88
## Integration with Airbyte Framework
89
90
The connector integrates seamlessly with Airbyte's declarative framework:
91
92
- **YamlDeclarativeSource**: Inherits standard Airbyte source behavior
93
- **Manifest-driven**: Configuration defined in `manifest.yaml`
94
- **Standard Operations**: Supports spec/check/discover/read operations
95
- **Stream Definition**: Two streams (reader, search) with JSON schemas
96
- **Authentication**: Optional Bearer token authentication
97
- **Error Handling**: Built-in Airbyte error handling and logging