airbyte-source-google-drive 0.0.9__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.11/PKG-INFO +128 -0
- airbyte_source_google_drive-0.0.11/README.md +104 -0
- airbyte_source_google_drive-0.0.11/pyproject.toml +41 -0
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/__init__.py +2 -0
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/run.py +1 -2
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/source.py +3 -2
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/spec.py +1 -1
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/stream_reader.py +2 -2
- {airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/utils.py +1 -0
- airbyte-source-google-drive-0.0.9/PKG-INFO +0 -102
- airbyte-source-google-drive-0.0.9/README.md +0 -100
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/PKG-INFO +0 -102
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/SOURCES.txt +0 -21
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/dependency_links.txt +0 -1
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/entry_points.txt +0 -2
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/requires.txt +0 -9
- airbyte-source-google-drive-0.0.9/airbyte_source_google_drive.egg-info/top_level.txt +0 -2
- airbyte-source-google-drive-0.0.9/integration_tests/__init__.py +0 -0
- airbyte-source-google-drive-0.0.9/integration_tests/abnormal_state.json +0 -35
- airbyte-source-google-drive-0.0.9/integration_tests/acceptance.py +0 -16
- airbyte-source-google-drive-0.0.9/integration_tests/configured_catalog.json +0 -60
- airbyte-source-google-drive-0.0.9/integration_tests/invalid_config.json +0 -19
- airbyte-source-google-drive-0.0.9/integration_tests/spec.json +0 -456
- airbyte-source-google-drive-0.0.9/setup.cfg +0 -97
- airbyte-source-google-drive-0.0.9/setup.py +0 -46
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: airbyte-source-google-drive
|
|
3
|
+
Version: 0.0.11
|
|
4
|
+
Summary: Source implementation for Google Drive.
|
|
5
|
+
Home-page: https://airbyte.com
|
|
6
|
+
License: ELv2
|
|
7
|
+
Author: Airbyte
|
|
8
|
+
Author-email: contact@airbyte.io
|
|
9
|
+
Requires-Python: >=3.9,<3.12
|
|
10
|
+
Classifier: License :: Other/Proprietary License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Requires-Dist: airbyte-cdk[file-based] (>=1,<2)
|
|
16
|
+
Requires-Dist: google-api-python-client (==2.104.0)
|
|
17
|
+
Requires-Dist: google-api-python-client-stubs (==1.18.0)
|
|
18
|
+
Requires-Dist: google-auth-httplib2 (==0.1.1)
|
|
19
|
+
Requires-Dist: google-auth-oauthlib (==1.1.0)
|
|
20
|
+
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/google-drive
|
|
21
|
+
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# Google Drive source connector
|
|
25
|
+
|
|
26
|
+
This is the repository for the Google Drive source connector, written in Python.
|
|
27
|
+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/google-drive).
|
|
28
|
+
|
|
29
|
+
## Local development
|
|
30
|
+
|
|
31
|
+
### Prerequisites
|
|
32
|
+
|
|
33
|
+
- Python (~=3.9)
|
|
34
|
+
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
35
|
+
|
|
36
|
+
### Installing the connector
|
|
37
|
+
|
|
38
|
+
From this connector directory, run:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
poetry install --with dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Create credentials
|
|
45
|
+
|
|
46
|
+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/google-drive)
|
|
47
|
+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.yaml` file.
|
|
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.
|
|
49
|
+
See `sample_files/sample_config.json` for a sample config file.
|
|
50
|
+
|
|
51
|
+
### Locally running the connector
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
poetry run source-google-drive spec
|
|
55
|
+
poetry run source-google-drive check --config secrets/config.json
|
|
56
|
+
poetry run source-google-drive discover --config secrets/config.json
|
|
57
|
+
poetry run source-google-drive read --config secrets/config.json --catalog sample_files/configured_catalog.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Running unit tests
|
|
61
|
+
|
|
62
|
+
To run unit tests locally, from the connector directory run:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
poetry run pytest unit_tests
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Building the docker image
|
|
69
|
+
|
|
70
|
+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
|
71
|
+
2. Run the following command to build the docker image:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
airbyte-ci connectors --name=source-google-drive build
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
An image will be available on your host with the tag `airbyte/source-google-drive:dev`.
|
|
78
|
+
|
|
79
|
+
### Running as a docker container
|
|
80
|
+
|
|
81
|
+
Then run any of the connector commands as follows:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
docker run --rm airbyte/source-google-drive:dev spec
|
|
85
|
+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
86
|
+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev discover --config /secrets/config.json
|
|
87
|
+
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-drive:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Running our CI test suite
|
|
91
|
+
|
|
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
|
+
|
|
94
|
+
```bash
|
|
95
|
+
airbyte-ci connectors --name=source-google-drive test
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Customizing acceptance Tests
|
|
99
|
+
|
|
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.
|
|
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.
|
|
102
|
+
|
|
103
|
+
### Dependency Management
|
|
104
|
+
|
|
105
|
+
All of your dependencies should be managed via Poetry.
|
|
106
|
+
To add a new dependency, run:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
poetry add <package-name>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
|
|
113
|
+
|
|
114
|
+
## Publishing a new version of the connector
|
|
115
|
+
|
|
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
|
+
|
|
118
|
+
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
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`
|
|
122
|
+
3. Make sure the `metadata.yaml` content is up to date.
|
|
123
|
+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
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).
|
|
125
|
+
6. Pat yourself on the back for being an awesome contributor.
|
|
126
|
+
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
|
127
|
+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
|
|
128
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Google Drive source connector
|
|
2
|
+
|
|
3
|
+
This is the repository for the Google Drive source connector, written in Python.
|
|
4
|
+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/google-drive).
|
|
5
|
+
|
|
6
|
+
## Local development
|
|
7
|
+
|
|
8
|
+
### Prerequisites
|
|
9
|
+
|
|
10
|
+
- Python (~=3.9)
|
|
11
|
+
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
12
|
+
|
|
13
|
+
### Installing the connector
|
|
14
|
+
|
|
15
|
+
From this connector directory, run:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
poetry install --with dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Create credentials
|
|
22
|
+
|
|
23
|
+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/google-drive)
|
|
24
|
+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.yaml` file.
|
|
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.
|
|
26
|
+
See `sample_files/sample_config.json` for a sample config file.
|
|
27
|
+
|
|
28
|
+
### Locally running the connector
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
poetry run source-google-drive spec
|
|
32
|
+
poetry run source-google-drive check --config secrets/config.json
|
|
33
|
+
poetry run source-google-drive discover --config secrets/config.json
|
|
34
|
+
poetry run source-google-drive read --config secrets/config.json --catalog sample_files/configured_catalog.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Running unit tests
|
|
38
|
+
|
|
39
|
+
To run unit tests locally, from the connector directory run:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
poetry run pytest unit_tests
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Building the docker image
|
|
46
|
+
|
|
47
|
+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
|
48
|
+
2. Run the following command to build the docker image:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
airbyte-ci connectors --name=source-google-drive build
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
An image will be available on your host with the tag `airbyte/source-google-drive:dev`.
|
|
55
|
+
|
|
56
|
+
### Running as a docker container
|
|
57
|
+
|
|
58
|
+
Then run any of the connector commands as follows:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
docker run --rm airbyte/source-google-drive:dev spec
|
|
62
|
+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
63
|
+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev discover --config /secrets/config.json
|
|
64
|
+
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-drive:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Running our CI test suite
|
|
68
|
+
|
|
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
|
+
|
|
71
|
+
```bash
|
|
72
|
+
airbyte-ci connectors --name=source-google-drive test
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Customizing acceptance Tests
|
|
76
|
+
|
|
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.
|
|
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.
|
|
79
|
+
|
|
80
|
+
### Dependency Management
|
|
81
|
+
|
|
82
|
+
All of your dependencies should be managed via Poetry.
|
|
83
|
+
To add a new dependency, run:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
poetry add <package-name>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
|
|
90
|
+
|
|
91
|
+
## Publishing a new version of the connector
|
|
92
|
+
|
|
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
|
+
|
|
95
|
+
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
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`
|
|
99
|
+
3. Make sure the `metadata.yaml` content is up to date.
|
|
100
|
+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
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).
|
|
102
|
+
6. Pat yourself on the back for being an awesome contributor.
|
|
103
|
+
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
|
104
|
+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"poetry-core>=1.0.0",
|
|
4
|
+
]
|
|
5
|
+
build-backend = "poetry.core.masonry.api"
|
|
6
|
+
|
|
7
|
+
[tool.poetry]
|
|
8
|
+
version = "0.0.11"
|
|
9
|
+
name = "airbyte-source-google-drive"
|
|
10
|
+
description = "Source implementation for Google Drive."
|
|
11
|
+
authors = [
|
|
12
|
+
"Airbyte <contact@airbyte.io>",
|
|
13
|
+
]
|
|
14
|
+
license = "ELv2"
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
documentation = "https://docs.airbyte.com/integrations/sources/google-drive"
|
|
17
|
+
homepage = "https://airbyte.com"
|
|
18
|
+
repository = "https://github.com/airbytehq/airbyte"
|
|
19
|
+
packages = [
|
|
20
|
+
{ include = "source_google_drive" },
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[tool.poetry.dependencies]
|
|
24
|
+
python = "^3.9,<3.12"
|
|
25
|
+
google-api-python-client = "==2.104.0"
|
|
26
|
+
google-auth-httplib2 = "==0.1.1"
|
|
27
|
+
google-auth-oauthlib = "==1.1.0"
|
|
28
|
+
google-api-python-client-stubs = "==1.18.0"
|
|
29
|
+
|
|
30
|
+
[tool.poetry.dependencies.airbyte-cdk]
|
|
31
|
+
extras = [
|
|
32
|
+
"file-based",
|
|
33
|
+
]
|
|
34
|
+
version = "^1"
|
|
35
|
+
|
|
36
|
+
[tool.poetry.scripts]
|
|
37
|
+
source-google-drive = "source_google_drive.run:run"
|
|
38
|
+
|
|
39
|
+
[tool.poetry.group.dev.dependencies]
|
|
40
|
+
pytest-mock = "^3.12.0"
|
|
41
|
+
pytest = "^7.4"
|
|
@@ -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
|
|
{airbyte-source-google-drive-0.0.9 → airbyte_source_google_drive-0.0.11}/source_google_drive/spec.py
RENAMED
|
@@ -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
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: airbyte-source-google-drive
|
|
3
|
-
Version: 0.0.9
|
|
4
|
-
Summary: Source implementation for Google Drive.
|
|
5
|
-
Author: Airbyte
|
|
6
|
-
Author-email: contact@airbyte.io
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: airbyte-cdk[file-based]>=0.61.0
|
|
9
|
-
Requires-Dist: google-api-python-client==2.104.0
|
|
10
|
-
Requires-Dist: google-auth-httplib2==0.1.1
|
|
11
|
-
Requires-Dist: google-auth-oauthlib==1.1.0
|
|
12
|
-
Requires-Dist: google-api-python-client-stubs==1.18.0
|
|
13
|
-
Provides-Extra: tests
|
|
14
|
-
Requires-Dist: pytest-mock~=3.6.1; extra == "tests"
|
|
15
|
-
Requires-Dist: pytest~=6.1; extra == "tests"
|
|
16
|
-
|
|
17
|
-
# Google Drive Source
|
|
18
|
-
|
|
19
|
-
This is the repository for the Google Drive source connector, written in Python.
|
|
20
|
-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/google-drive).
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**To iterate on this connector, make sure to complete this prerequisites section.**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
From this connector directory, create a virtual environment:
|
|
27
|
-
```
|
|
28
|
-
python -m venv .venv
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
|
|
32
|
-
development environment of choice. To activate it from the terminal, run:
|
|
33
|
-
```
|
|
34
|
-
source .venv/bin/activate
|
|
35
|
-
pip install -r requirements.txt
|
|
36
|
-
pip install '.[tests]'
|
|
37
|
-
```
|
|
38
|
-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
|
|
39
|
-
|
|
40
|
-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
|
|
41
|
-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
|
|
42
|
-
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
|
|
43
|
-
should work as you expect.
|
|
44
|
-
|
|
45
|
-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/google-drive)
|
|
46
|
-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.json` file.
|
|
47
|
-
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
|
-
See `integration_tests/sample_config.json` for a sample config file.
|
|
49
|
-
|
|
50
|
-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source google-drive test creds`
|
|
51
|
-
and place them into `secrets/config.json`.
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
python main.py spec
|
|
55
|
-
python main.py check --config secrets/config.json
|
|
56
|
-
python main.py discover --config secrets/config.json
|
|
57
|
-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
|
|
63
|
-
```bash
|
|
64
|
-
airbyte-ci connectors --name=source-google-drive build
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
An image will be built with the tag `airbyte/source-google-drive:dev`.
|
|
68
|
-
|
|
69
|
-
**Via `docker build`:**
|
|
70
|
-
```bash
|
|
71
|
-
docker build -t airbyte/source-google-drive:dev .
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Then run any of the connector commands as follows:
|
|
75
|
-
```
|
|
76
|
-
docker run --rm airbyte/source-google-drive:dev spec
|
|
77
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
78
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev discover --config /secrets/config.json
|
|
79
|
-
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-drive:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
|
83
|
-
```bash
|
|
84
|
-
airbyte-ci connectors --name=source-google-drive test
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
|
88
|
-
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.
|
|
89
|
-
|
|
90
|
-
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
|
|
91
|
-
We split dependencies between two groups, dependencies that are:
|
|
92
|
-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
|
|
93
|
-
* required for the testing need to go to `TEST_REQUIREMENTS` list
|
|
94
|
-
|
|
95
|
-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
|
96
|
-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
97
|
-
2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
|
|
98
|
-
3. Make sure the `metadata.yaml` content is up to date.
|
|
99
|
-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
100
|
-
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).
|
|
101
|
-
6. Pat yourself on the back for being an awesome contributor.
|
|
102
|
-
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# Google Drive Source
|
|
2
|
-
|
|
3
|
-
This is the repository for the Google Drive source connector, written in Python.
|
|
4
|
-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/google-drive).
|
|
5
|
-
|
|
6
|
-
## Local development
|
|
7
|
-
|
|
8
|
-
### Prerequisites
|
|
9
|
-
**To iterate on this connector, make sure to complete this prerequisites section.**
|
|
10
|
-
|
|
11
|
-
#### Minimum Python version required `= 3.10.0`
|
|
12
|
-
|
|
13
|
-
#### Build & Activate Virtual Environment and install dependencies
|
|
14
|
-
From this connector directory, create a virtual environment:
|
|
15
|
-
```
|
|
16
|
-
python -m venv .venv
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
|
|
20
|
-
development environment of choice. To activate it from the terminal, run:
|
|
21
|
-
```
|
|
22
|
-
source .venv/bin/activate
|
|
23
|
-
pip install -r requirements.txt
|
|
24
|
-
pip install '.[tests]'
|
|
25
|
-
```
|
|
26
|
-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
|
|
27
|
-
|
|
28
|
-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
|
|
29
|
-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
|
|
30
|
-
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
|
|
31
|
-
should work as you expect.
|
|
32
|
-
|
|
33
|
-
#### Create credentials
|
|
34
|
-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/google-drive)
|
|
35
|
-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.json` file.
|
|
36
|
-
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
|
|
37
|
-
See `integration_tests/sample_config.json` for a sample config file.
|
|
38
|
-
|
|
39
|
-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source google-drive test creds`
|
|
40
|
-
and place them into `secrets/config.json`.
|
|
41
|
-
|
|
42
|
-
### Locally running the connector
|
|
43
|
-
```
|
|
44
|
-
python main.py spec
|
|
45
|
-
python main.py check --config secrets/config.json
|
|
46
|
-
python main.py discover --config secrets/config.json
|
|
47
|
-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Locally running the connector docker image
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#### Build
|
|
54
|
-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
|
|
55
|
-
```bash
|
|
56
|
-
airbyte-ci connectors --name=source-google-drive build
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
An image will be built with the tag `airbyte/source-google-drive:dev`.
|
|
60
|
-
|
|
61
|
-
**Via `docker build`:**
|
|
62
|
-
```bash
|
|
63
|
-
docker build -t airbyte/source-google-drive:dev .
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### Run
|
|
67
|
-
Then run any of the connector commands as follows:
|
|
68
|
-
```
|
|
69
|
-
docker run --rm airbyte/source-google-drive:dev spec
|
|
70
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
71
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev discover --config /secrets/config.json
|
|
72
|
-
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-drive:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Testing
|
|
76
|
-
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
|
77
|
-
```bash
|
|
78
|
-
airbyte-ci connectors --name=source-google-drive test
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Customizing acceptance Tests
|
|
82
|
-
Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
|
83
|
-
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.
|
|
84
|
-
|
|
85
|
-
## Dependency Management
|
|
86
|
-
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
|
|
87
|
-
We split dependencies between two groups, dependencies that are:
|
|
88
|
-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
|
|
89
|
-
* required for the testing need to go to `TEST_REQUIREMENTS` list
|
|
90
|
-
|
|
91
|
-
### Publishing a new version of the connector
|
|
92
|
-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
|
93
|
-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
94
|
-
2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
|
|
95
|
-
3. Make sure the `metadata.yaml` content is up to date.
|
|
96
|
-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
97
|
-
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).
|
|
98
|
-
6. Pat yourself on the back for being an awesome contributor.
|
|
99
|
-
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
|
100
|
-
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: airbyte-source-google-drive
|
|
3
|
-
Version: 0.0.9
|
|
4
|
-
Summary: Source implementation for Google Drive.
|
|
5
|
-
Author: Airbyte
|
|
6
|
-
Author-email: contact@airbyte.io
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: airbyte-cdk[file-based]>=0.61.0
|
|
9
|
-
Requires-Dist: google-api-python-client==2.104.0
|
|
10
|
-
Requires-Dist: google-auth-httplib2==0.1.1
|
|
11
|
-
Requires-Dist: google-auth-oauthlib==1.1.0
|
|
12
|
-
Requires-Dist: google-api-python-client-stubs==1.18.0
|
|
13
|
-
Provides-Extra: tests
|
|
14
|
-
Requires-Dist: pytest-mock~=3.6.1; extra == "tests"
|
|
15
|
-
Requires-Dist: pytest~=6.1; extra == "tests"
|
|
16
|
-
|
|
17
|
-
# Google Drive Source
|
|
18
|
-
|
|
19
|
-
This is the repository for the Google Drive source connector, written in Python.
|
|
20
|
-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/google-drive).
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**To iterate on this connector, make sure to complete this prerequisites section.**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
From this connector directory, create a virtual environment:
|
|
27
|
-
```
|
|
28
|
-
python -m venv .venv
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
|
|
32
|
-
development environment of choice. To activate it from the terminal, run:
|
|
33
|
-
```
|
|
34
|
-
source .venv/bin/activate
|
|
35
|
-
pip install -r requirements.txt
|
|
36
|
-
pip install '.[tests]'
|
|
37
|
-
```
|
|
38
|
-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
|
|
39
|
-
|
|
40
|
-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
|
|
41
|
-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
|
|
42
|
-
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
|
|
43
|
-
should work as you expect.
|
|
44
|
-
|
|
45
|
-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/google-drive)
|
|
46
|
-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_drive/spec.json` file.
|
|
47
|
-
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
|
-
See `integration_tests/sample_config.json` for a sample config file.
|
|
49
|
-
|
|
50
|
-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source google-drive test creds`
|
|
51
|
-
and place them into `secrets/config.json`.
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
python main.py spec
|
|
55
|
-
python main.py check --config secrets/config.json
|
|
56
|
-
python main.py discover --config secrets/config.json
|
|
57
|
-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
|
|
63
|
-
```bash
|
|
64
|
-
airbyte-ci connectors --name=source-google-drive build
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
An image will be built with the tag `airbyte/source-google-drive:dev`.
|
|
68
|
-
|
|
69
|
-
**Via `docker build`:**
|
|
70
|
-
```bash
|
|
71
|
-
docker build -t airbyte/source-google-drive:dev .
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Then run any of the connector commands as follows:
|
|
75
|
-
```
|
|
76
|
-
docker run --rm airbyte/source-google-drive:dev spec
|
|
77
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev check --config /secrets/config.json
|
|
78
|
-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-drive:dev discover --config /secrets/config.json
|
|
79
|
-
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-drive:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
|
83
|
-
```bash
|
|
84
|
-
airbyte-ci connectors --name=source-google-drive test
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
|
88
|
-
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.
|
|
89
|
-
|
|
90
|
-
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
|
|
91
|
-
We split dependencies between two groups, dependencies that are:
|
|
92
|
-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
|
|
93
|
-
* required for the testing need to go to `TEST_REQUIREMENTS` list
|
|
94
|
-
|
|
95
|
-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
|
96
|
-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-drive test`
|
|
97
|
-
2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
|
|
98
|
-
3. Make sure the `metadata.yaml` content is up to date.
|
|
99
|
-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/google-drive.md`).
|
|
100
|
-
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).
|
|
101
|
-
6. Pat yourself on the back for being an awesome contributor.
|
|
102
|
-
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|