airbyte-source-google-drive 0.0.10__tar.gz → 0.0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of airbyte-source-google-drive might be problematic. Click here for more details.
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/PKG-INFO +25 -12
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/README.md +23 -10
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/pyproject.toml +2 -2
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/__init__.py +2 -0
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/run.py +1 -2
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/source.py +3 -2
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/spec.py +1 -1
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/stream_reader.py +2 -2
- {airbyte_source_google_drive-0.0.10 → airbyte_source_google_drive-0.0.11}/source_google_drive/utils.py +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: airbyte-source-google-drive
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: Source implementation for Google Drive.
|
|
5
5
|
Home-page: https://airbyte.com
|
|
6
6
|
License: ELv2
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Requires-Dist: airbyte-cdk[file-based] (>=
|
|
15
|
+
Requires-Dist: airbyte-cdk[file-based] (>=1,<2)
|
|
16
16
|
Requires-Dist: google-api-python-client (==2.104.0)
|
|
17
17
|
Requires-Dist: google-api-python-client-stubs (==1.18.0)
|
|
18
18
|
Requires-Dist: google-auth-httplib2 (==0.1.1)
|
|
@@ -23,32 +23,33 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
|
|
24
24
|
# Google Drive source connector
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
This is the repository for the Google Drive source connector, written in Python.
|
|
28
27
|
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/google-drive).
|
|
29
28
|
|
|
30
29
|
## Local development
|
|
31
30
|
|
|
32
31
|
### Prerequisites
|
|
33
|
-
* Python (~=3.9)
|
|
34
|
-
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
35
32
|
|
|
33
|
+
- Python (~=3.9)
|
|
34
|
+
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
36
35
|
|
|
37
36
|
### Installing the connector
|
|
37
|
+
|
|
38
38
|
From this connector directory, run:
|
|
39
|
+
|
|
39
40
|
```bash
|
|
40
41
|
poetry install --with dev
|
|
41
42
|
```
|
|
42
43
|
|
|
43
|
-
|
|
44
44
|
### Create credentials
|
|
45
|
+
|
|
45
46
|
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/google-drive)
|
|
46
47
|
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.yaml` file.
|
|
47
48
|
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
|
|
48
49
|
See `sample_files/sample_config.json` for a sample config file.
|
|
49
50
|
|
|
50
|
-
|
|
51
51
|
### Locally running the connector
|
|
52
|
+
|
|
52
53
|
```
|
|
53
54
|
poetry run source-google-drive spec
|
|
54
55
|
poetry run source-google-drive check --config secrets/config.json
|
|
@@ -57,23 +58,28 @@ poetry run source-google-drive read --config secrets/config.json --catalog sampl
|
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
### Running unit tests
|
|
61
|
+
|
|
60
62
|
To run unit tests locally, from the connector directory run:
|
|
63
|
+
|
|
61
64
|
```
|
|
62
65
|
poetry run pytest unit_tests
|
|
63
66
|
```
|
|
64
67
|
|
|
65
68
|
### Building the docker image
|
|
69
|
+
|
|
66
70
|
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
|
67
71
|
2. Run the following command to build the docker image:
|
|
72
|
+
|
|
68
73
|
```bash
|
|
69
74
|
airbyte-ci connectors --name=source-google-drive build
|
|
70
75
|
```
|
|
71
76
|
|
|
72
77
|
An image will be available on your host with the tag `airbyte/source-google-drive:dev`.
|
|
73
78
|
|
|
74
|
-
|
|
75
79
|
### Running as a docker container
|
|
80
|
+
|
|
76
81
|
Then run any of the connector commands as follows:
|
|
82
|
+
|
|
77
83
|
```
|
|
78
84
|
docker run --rm airbyte/source-google-drive:dev spec
|
|
79
85
|
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
@@ -82,18 +88,23 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
|
|
|
82
88
|
```
|
|
83
89
|
|
|
84
90
|
### Running our CI test suite
|
|
91
|
+
|
|
85
92
|
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
|
93
|
+
|
|
86
94
|
```bash
|
|
87
95
|
airbyte-ci connectors --name=source-google-drive test
|
|
88
96
|
```
|
|
89
97
|
|
|
90
98
|
### Customizing acceptance Tests
|
|
99
|
+
|
|
91
100
|
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
|
92
101
|
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
|
|
93
102
|
|
|
94
103
|
### Dependency Management
|
|
95
|
-
|
|
104
|
+
|
|
105
|
+
All of your dependencies should be managed via Poetry.
|
|
96
106
|
To add a new dependency, run:
|
|
107
|
+
|
|
97
108
|
```bash
|
|
98
109
|
poetry add <package-name>
|
|
99
110
|
```
|
|
@@ -101,11 +112,13 @@ poetry add <package-name>
|
|
|
101
112
|
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
|
|
102
113
|
|
|
103
114
|
## Publishing a new version of the connector
|
|
115
|
+
|
|
104
116
|
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
|
117
|
+
|
|
105
118
|
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
106
|
-
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
|
|
120
|
+
- bump the `dockerImageTag` value in in `metadata.yaml`
|
|
121
|
+
- bump the `version` value in `pyproject.toml`
|
|
109
122
|
3. Make sure the `metadata.yaml` content is up to date.
|
|
110
123
|
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
111
124
|
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
# Google Drive source connector
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
This is the repository for the Google Drive source connector, written in Python.
|
|
5
4
|
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/google-drive).
|
|
6
5
|
|
|
7
6
|
## Local development
|
|
8
7
|
|
|
9
8
|
### Prerequisites
|
|
10
|
-
* Python (~=3.9)
|
|
11
|
-
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
12
9
|
|
|
10
|
+
- Python (~=3.9)
|
|
11
|
+
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
13
12
|
|
|
14
13
|
### Installing the connector
|
|
14
|
+
|
|
15
15
|
From this connector directory, run:
|
|
16
|
+
|
|
16
17
|
```bash
|
|
17
18
|
poetry install --with dev
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
21
|
### Create credentials
|
|
22
|
+
|
|
22
23
|
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/google-drive)
|
|
23
24
|
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.yaml` file.
|
|
24
25
|
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
|
|
25
26
|
See `sample_files/sample_config.json` for a sample config file.
|
|
26
27
|
|
|
27
|
-
|
|
28
28
|
### Locally running the connector
|
|
29
|
+
|
|
29
30
|
```
|
|
30
31
|
poetry run source-google-drive spec
|
|
31
32
|
poetry run source-google-drive check --config secrets/config.json
|
|
@@ -34,23 +35,28 @@ poetry run source-google-drive read --config secrets/config.json --catalog sampl
|
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
### Running unit tests
|
|
38
|
+
|
|
37
39
|
To run unit tests locally, from the connector directory run:
|
|
40
|
+
|
|
38
41
|
```
|
|
39
42
|
poetry run pytest unit_tests
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
### Building the docker image
|
|
46
|
+
|
|
43
47
|
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
|
44
48
|
2. Run the following command to build the docker image:
|
|
49
|
+
|
|
45
50
|
```bash
|
|
46
51
|
airbyte-ci connectors --name=source-google-drive build
|
|
47
52
|
```
|
|
48
53
|
|
|
49
54
|
An image will be available on your host with the tag `airbyte/source-google-drive:dev`.
|
|
50
55
|
|
|
51
|
-
|
|
52
56
|
### Running as a docker container
|
|
57
|
+
|
|
53
58
|
Then run any of the connector commands as follows:
|
|
59
|
+
|
|
54
60
|
```
|
|
55
61
|
docker run --rm airbyte/source-google-drive:dev spec
|
|
56
62
|
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
@@ -59,18 +65,23 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
|
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
### Running our CI test suite
|
|
68
|
+
|
|
62
69
|
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
|
70
|
+
|
|
63
71
|
```bash
|
|
64
72
|
airbyte-ci connectors --name=source-google-drive test
|
|
65
73
|
```
|
|
66
74
|
|
|
67
75
|
### Customizing acceptance Tests
|
|
76
|
+
|
|
68
77
|
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
|
69
78
|
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
|
|
70
79
|
|
|
71
80
|
### Dependency Management
|
|
72
|
-
|
|
81
|
+
|
|
82
|
+
All of your dependencies should be managed via Poetry.
|
|
73
83
|
To add a new dependency, run:
|
|
84
|
+
|
|
74
85
|
```bash
|
|
75
86
|
poetry add <package-name>
|
|
76
87
|
```
|
|
@@ -78,11 +89,13 @@ poetry add <package-name>
|
|
|
78
89
|
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
|
|
79
90
|
|
|
80
91
|
## Publishing a new version of the connector
|
|
92
|
+
|
|
81
93
|
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
|
94
|
+
|
|
82
95
|
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
83
|
-
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
|
|
97
|
+
- bump the `dockerImageTag` value in in `metadata.yaml`
|
|
98
|
+
- bump the `version` value in `pyproject.toml`
|
|
86
99
|
3. Make sure the `metadata.yaml` content is up to date.
|
|
87
100
|
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
88
101
|
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
|
|
@@ -5,7 +5,7 @@ requires = [
|
|
|
5
5
|
build-backend = "poetry.core.masonry.api"
|
|
6
6
|
|
|
7
7
|
[tool.poetry]
|
|
8
|
-
version = "0.0.
|
|
8
|
+
version = "0.0.11"
|
|
9
9
|
name = "airbyte-source-google-drive"
|
|
10
10
|
description = "Source implementation for Google Drive."
|
|
11
11
|
authors = [
|
|
@@ -31,7 +31,7 @@ google-api-python-client-stubs = "==1.18.0"
|
|
|
31
31
|
extras = [
|
|
32
32
|
"file-based",
|
|
33
33
|
]
|
|
34
|
-
version = "^
|
|
34
|
+
version = "^1"
|
|
35
35
|
|
|
36
36
|
[tool.poetry.scripts]
|
|
37
37
|
source-google-drive = "source_google_drive.run:run"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
3
3
|
#
|
|
4
|
+
|
|
5
|
+
|
|
4
6
|
from typing import Any, Mapping, Optional
|
|
5
7
|
|
|
6
|
-
from airbyte_cdk
|
|
8
|
+
from airbyte_cdk import AdvancedAuth, ConfiguredAirbyteCatalog, ConnectorSpecification, OAuthConfigSpecification, TState
|
|
7
9
|
from airbyte_cdk.sources.file_based.file_based_source import FileBasedSource
|
|
8
10
|
from airbyte_cdk.sources.file_based.stream.cursor.default_file_based_cursor import DefaultFileBasedCursor
|
|
9
|
-
from airbyte_cdk.sources.source import TState
|
|
10
11
|
from source_google_drive.spec import SourceGoogleDriveSpec
|
|
11
12
|
from source_google_drive.stream_reader import SourceGoogleDriveStreamReader
|
|
12
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
from typing import Any, Dict, Literal, Union
|
|
7
7
|
|
|
8
8
|
import dpath.util
|
|
9
|
+
from airbyte_cdk import OneOfOptionConfig
|
|
9
10
|
from airbyte_cdk.sources.file_based.config.abstract_file_based_spec import AbstractFileBasedSpec
|
|
10
|
-
from airbyte_cdk.utils.oneof_option_config import OneOfOptionConfig
|
|
11
11
|
from pydantic import BaseModel, Field
|
|
12
12
|
|
|
13
13
|
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
import io
|
|
6
7
|
import json
|
|
7
8
|
import logging
|
|
8
|
-
import re
|
|
9
9
|
from datetime import datetime
|
|
10
10
|
from io import IOBase
|
|
11
11
|
from typing import Iterable, List, Optional, Set
|
|
12
12
|
|
|
13
|
+
from airbyte_cdk import AirbyteTracedException, FailureType
|
|
13
14
|
from airbyte_cdk.sources.file_based.file_based_stream_reader import AbstractFileBasedStreamReader, FileReadMode
|
|
14
15
|
from airbyte_cdk.sources.file_based.remote_file import RemoteFile
|
|
15
|
-
from airbyte_cdk.utils.traced_exception import AirbyteTracedException, FailureType
|
|
16
16
|
from google.oauth2 import credentials, service_account
|
|
17
17
|
from googleapiclient.discovery import build
|
|
18
18
|
from googleapiclient.http import MediaIoBaseDownload
|