Skip to content

Commit 7edaede

Browse files
authored
Docs(python-cdk): Add automated PDoc docs generation CI job (#46977)
1 parent cac9750 commit 7edaede

File tree

12 files changed

+493
-676
lines changed

12 files changed

+493
-676
lines changed

airbyte_cdk/__init__.py

+46-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,51 @@
1-
#
21
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
3-
#
2+
"""
3+
# Welcome to the Airbyte Python CDK!
44
5+
The Airbyte Python CDK is a Python library that provides a set of tools to help you build
6+
connectors for the Airbyte platform.
7+
8+
## Building Source Connectors
9+
10+
To build a source connector, you will want to refer to
11+
the following classes and modules:
12+
13+
- `airbyte_cdk.sources`
14+
- `airbyte_cdk.sources.concurrent_source`
15+
- `airbyte_cdk.sources.config`
16+
- `airbyte_cdk.sources.file_based`
17+
- `airbyte_cdk.sources.streams`
18+
19+
## Building Destination Connectors
20+
21+
To build a destination connector, you will want to refer to
22+
the following classes and modules:
23+
24+
- `airbyte_cdk.destinations`
25+
- `airbyte_cdk.destinations.Destination`
26+
- `airbyte_cdk.destinations.vector_db_based`
27+
28+
## Working with Airbyte Protocol Models
29+
30+
The Airbyte CDK provides a set of classes that help you work with the Airbyte protocol models:
31+
32+
- `airbyte_cdk.models.airbyte_protocol`
33+
- `airbyte_cdk.models.airbyte_protocol_serializers`
34+
35+
---
36+
37+
API Reference
38+
39+
---
40+
41+
"""
42+
43+
# Warning: The below imports are not stable and will cause circular
44+
# dependencies if auto-sorted with isort. Please keep them in the same order.
45+
# TODO: Submodules should import from lower-level modules, rather than importing from here.
46+
# Imports should also be placed in `if TYPE_CHECKING` blocks if they are only used as type
47+
# hints - again, to avoid circular dependencies.
48+
# Once those issues are resolved, the below can be sorted with isort.
549
from importlib import metadata
650

751
from .destinations import Destination
@@ -88,11 +132,9 @@
88132
# Availability strategy
89133
"AvailabilityStrategy",
90134
"HttpAvailabilityStrategy",
91-
92135
# Checkpoint
93136
"LegacyCursor",
94137
"ResumableFullRefreshCursor",
95-
96138
# Concurrent
97139
"ConcurrentCursor",
98140
"ConcurrentSource",
@@ -104,11 +146,9 @@
104146
"FinalStateCursor",
105147
"IsoMillisConcurrentStreamStateConverter",
106148
"StreamFacade",
107-
108149
# Config observation
109150
"create_connector_config_control_message",
110151
"emit_configuration_as_airbyte_control_message",
111-
112152
# Connector
113153
"AbstractSource",
114154
"BaseConfig",
@@ -117,7 +157,6 @@
117157
"Destination",
118158
"Source",
119159
"TState",
120-
121160
# Declarative
122161
"AddFields",
123162
"AddedFieldDefinition",
@@ -167,11 +206,9 @@
167206
"StreamSlice",
168207
"SubstreamPartitionRouter",
169208
"YamlDeclarativeSource",
170-
171209
# Entrypoint
172210
"launch",
173211
"AirbyteEntrypoint",
174-
175212
# HTTP
176213
"AbstractAPIBudget",
177214
"AbstractHeaderAuthenticator",
@@ -192,11 +229,9 @@
192229
"SingleUseRefreshTokenOauth2Authenticator",
193230
"TokenAuthenticator",
194231
"UserDefinedBackoffException",
195-
196232
# Logger
197233
"AirbyteLogFormatter",
198234
"init_logger",
199-
200235
# Protocol classes
201236
"AirbyteStream",
202237
"AirbyteConnectionStatus",
@@ -215,20 +250,16 @@
215250
"ConnectorSpecification",
216251
"Level",
217252
"AirbyteRecordMessage",
218-
219253
# Repository
220254
"InMemoryMessageRepository",
221255
"MessageRepository",
222-
223256
# State management
224257
"ConnectorStateManager",
225-
226258
# Stream
227259
"IncrementalMixin",
228260
"Stream",
229261
"StreamData",
230262
"package_name_from_class",
231-
232263
# Utils
233264
"AirbyteTracedException",
234265
"is_cloud_environment",
@@ -244,7 +275,6 @@
244275
"OneOfOptionConfig",
245276
"resolve_refs",
246277
"as_airbyte_message",
247-
248278
# Types
249279
"Config",
250280
"Record",

airbyte_cdk/destinations/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#
21
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
3-
#
2+
"""The destinations module provides classes for building destination connectors."""
43

54
from .destination import Destination
65

7-
__all__ = ["Destination"]
6+
__all__ = [
7+
"Destination",
8+
]

airbyte_cdk/sources/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@
1919
# this will not be thread-safe.
2020
dpath.options.ALLOW_EMPTY_STRING_KEYS = True
2121

22-
__all__ = ["AbstractSource", "BaseConfig", "Source"]
22+
__all__ = [
23+
"AbstractSource",
24+
"BaseConfig",
25+
"Source",
26+
]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
#
21
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3-
#
2+
"""The concurrent source model replaces the legacy Source model.
3+
4+
The concurrent source model is a new way to build sources in the Airbyte CDK. It is designed to
5+
be more ergonomic and performant than the legacy Source model.
6+
7+
To implement a source using the concurrent source model, check out the submodules in this package.
8+
"""

airbyte_cdk/sql/_processors/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)