From b066af248f14762d184aafd6fedff60761af5f68 Mon Sep 17 00:00:00 2001 From: Dhroov Makwana Date: Wed, 29 May 2024 03:31:09 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Source=20Google=20Webfonts:=20Make=20C?= =?UTF-8?q?onnector=20Compatible=20with=20Builder=20(#38684)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexandre Girard --- .../source-google-webfonts/.dockerignore | 6 - .../source-google-webfonts/__init__.py | 2 +- .../integration_tests/__init__.py | 2 +- .../integration_tests/acceptance.py | 2 +- .../connectors/source-google-webfonts/main.py | 2 +- .../source-google-webfonts/metadata.yaml | 2 +- .../source-google-webfonts/pyproject.toml | 2 +- .../source-google-webfonts/requirements.txt | 1 - .../source_google_webfonts/__init__.py | 2 +- .../source_google_webfonts/manifest.yaml | 294 ++++++++++-------- .../source_google_webfonts/run.py | 5 +- .../source_google_webfonts/source.py | 2 +- .../source_google_webfonts/spec.yaml | 22 -- docs/integrations/sources/google-webfonts.md | 3 +- 14 files changed, 174 insertions(+), 173 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-google-webfonts/.dockerignore delete mode 100644 airbyte-integrations/connectors/source-google-webfonts/requirements.txt delete mode 100644 airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/spec.yaml diff --git a/airbyte-integrations/connectors/source-google-webfonts/.dockerignore b/airbyte-integrations/connectors/source-google-webfonts/.dockerignore deleted file mode 100644 index b7c1ebe6c666..000000000000 --- a/airbyte-integrations/connectors/source-google-webfonts/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -* -!Dockerfile -!main.py -!source_google_webfonts -!setup.py -!secrets diff --git a/airbyte-integrations/connectors/source-google-webfonts/__init__.py b/airbyte-integrations/connectors/source-google-webfonts/__init__.py index c941b3045795..66f6de8cb2bb 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/__init__.py +++ b/airbyte-integrations/connectors/source-google-webfonts/__init__.py @@ -1,3 +1,3 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # diff --git a/airbyte-integrations/connectors/source-google-webfonts/integration_tests/__init__.py b/airbyte-integrations/connectors/source-google-webfonts/integration_tests/__init__.py index c941b3045795..66f6de8cb2bb 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/integration_tests/__init__.py +++ b/airbyte-integrations/connectors/source-google-webfonts/integration_tests/__init__.py @@ -1,3 +1,3 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # diff --git a/airbyte-integrations/connectors/source-google-webfonts/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-google-webfonts/integration_tests/acceptance.py index 9e6409236281..aaeb7f6c2529 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/integration_tests/acceptance.py +++ b/airbyte-integrations/connectors/source-google-webfonts/integration_tests/acceptance.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # diff --git a/airbyte-integrations/connectors/source-google-webfonts/main.py b/airbyte-integrations/connectors/source-google-webfonts/main.py index 70cd774d0a01..b8cf8aa2b733 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/main.py +++ b/airbyte-integrations/connectors/source-google-webfonts/main.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # from source_google_webfonts.run import run diff --git a/airbyte-integrations/connectors/source-google-webfonts/metadata.yaml b/airbyte-integrations/connectors/source-google-webfonts/metadata.yaml index a3b7a09904c9..f77d3b5d2d19 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/metadata.yaml +++ b/airbyte-integrations/connectors/source-google-webfonts/metadata.yaml @@ -7,7 +7,7 @@ data: connectorSubtype: api connectorType: source definitionId: a68fbcde-b465-4ab3-b2a6-b0590a875835 - dockerImageTag: 0.1.3 + dockerImageTag: 0.1.4 dockerRepository: airbyte/source-google-webfonts documentationUrl: https://docs.airbyte.com/integrations/sources/google-webfonts githubIssueLabel: source-google-webfonts diff --git a/airbyte-integrations/connectors/source-google-webfonts/pyproject.toml b/airbyte-integrations/connectors/source-google-webfonts/pyproject.toml index cde9c8706de2..df19c80d264d 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/pyproject.toml +++ b/airbyte-integrations/connectors/source-google-webfonts/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "0.1.3" +version = "0.1.4" name = "source-google-webfonts" description = "Source implementation for Google Webfonts." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-google-webfonts/requirements.txt b/airbyte-integrations/connectors/source-google-webfonts/requirements.txt deleted file mode 100644 index d6e1198b1ab1..000000000000 --- a/airbyte-integrations/connectors/source-google-webfonts/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e . diff --git a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/__init__.py b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/__init__.py index 4b9191b0ec2f..85d83bd7e550 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/__init__.py +++ b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # diff --git a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/manifest.yaml b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/manifest.yaml index 5a29d12b5463..3348be5b8904 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/manifest.yaml +++ b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/manifest.yaml @@ -1,148 +1,176 @@ -version: "0.29.0" +version: 0.78.1 + +type: DeclarativeSource + +check: + type: CheckStream + stream_names: + - fonts definitions: - selector: - extractor: - field_path: ["items"] - requester: - url_base: "https://webfonts.googleapis.com/v1" - http_method: "GET" + streams: + fonts: + type: DeclarativeStream + name: fonts + retriever: + type: SimpleRetriever + requester: + $ref: "#/definitions/base_requester" + path: >- + /webfonts?key={{ config['api_key'] }}&sort={{ config['sort'] or + 'SORT_UNDEFINED'}}&prettyPrint={{ config['prettyPrint'] or + 'true'}}&alt={{ config['alt'] or 'json'}} + http_method: GET + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: + - items + schema_loader: + type: InlineSchemaLoader + schema: + $ref: "#/schemas/fonts" + base_requester: + type: HttpRequester + url_base: https://webfonts.googleapis.com/v1 authenticator: type: ApiKeyAuthenticator - header: "apikey" api_token: "{{ config['api_key'] }}" + inject_into: + type: RequestOption + inject_into: header + field_name: apikey - retriever: - record_selector: - $ref: "#/definitions/selector" - paginator: - type: NoPagination - requester: - $ref: "#/definitions/requester" +streams: + - $ref: "#/definitions/streams/fonts" - base_stream: - retriever: - $ref: "#/definitions/retriever" +spec: + type: Spec + connection_specification: + type: object + $schema: http://json-schema.org/draft-07/schema# + required: + - api_key + properties: + api_key: + type: string + title: API Key + airbyte_secret: true + description: >- + API key is required to access google apis, For getting your's goto + google console and generate api key for Webfonts + order: 0 + alt: + type: string + description: Optional, Available params- json, media, proto + order: 1 + prettyPrint: + type: string + description: Optional, boolean type + order: 2 + sort: + type: string + description: Optional, to find how to sort + order: 3 + additionalProperties: true - fonts_stream: - $ref: "#/definitions/base_stream" - $parameters: - name: "fonts" - path: - "/webfonts?key={{ config['api_key'] }}&sort={{ config['sort'] or 'SORT_UNDEFINED'}}&prettyPrint={{ - config['prettyPrint'] or 'true'}}&alt={{ config['alt'] or 'json'}}" +metadata: + autoImportSchema: + fonts: false - schema_loader: - type: InlineSchemaLoader - schema: - definitions: {} - $schema: http://json-schema.org/draft-07/schema# - $id: https://example.com/object1666796406.json - title: Root - type: object - properties: - kind: - description: The API resource kind, always set to 'webfonts#webfontList' - $id: "#root/kind" - title: Kind - type: string - default: "" - pattern: ^.*$ - items: - description: List of fonts available in the API - $id: "#root/items" - title: Items - type: array - default: [] - items: - $id: "#root/items/items" - title: Items +schemas: + fonts: + type: object + $id: https://example.com/object1666796406.json + $schema: http://json-schema.org/draft-07/schema# + additionalProperties: true + properties: + items: + type: array + $id: "#root/items" + default: [] + description: List of fonts available in the API + items: + type: object + $id: "#root/items/items" + properties: + version: + type: string + $id: "#root/items/items/version" + description: Version of the font data + pattern: ^.*$ + title: Version + category: + type: string + $id: "#root/items/items/category" + description: The category the font belongs to (e.g. 'sans-serif', 'serif') + pattern: ^.*$ + title: Category + family: + type: string + $id: "#root/items/items/family" + description: The name of the font family (e.g. 'Roboto', 'Open Sans') + pattern: ^.*$ + title: Family + files: type: object + $id: "#root/items/items/files" + description: Different file variants available for the font properties: - family: - description: The name of the font family (e.g. 'Roboto', 'Open Sans') - $id: "#root/items/items/family" - title: Family - type: string - default: "" - pattern: ^.*$ - variants: - description: Different styles and weights available for the font - $id: "#root/items/items/variants" - title: Variants - type: array - default: [] - items: - $id: "#root/items/items/variants/items" - title: Items - type: string - default: "" - pattern: ^.*$ - subsets: - description: List of language subsets supported by the font - $id: "#root/items/items/subsets" - title: Subsets - type: array - default: [] - items: - $id: "#root/items/items/subsets/items" - title: Items - type: string - default: "" - pattern: ^.*$ - version: - description: Version of the font data - $id: "#root/items/items/version" - title: Version + italic: type: string - default: "" + $id: "#root/items/items/files/italic" + description: URL to the italic font file pattern: ^.*$ - lastModified: - description: Timestamp of the last modification date of the font - $id: "#root/items/items/lastModified" - title: Lastmodified + title: Italic + regular: type: string - default: "" + $id: "#root/items/items/files/regular" + description: URL to the regular font file pattern: ^.*$ - files: - description: Different file variants available for the font - $id: "#root/items/items/files" - title: Files - type: object - properties: - regular: - description: URL to the regular font file - $id: "#root/items/items/files/regular" - title: Regular - type: string - default: "" - pattern: ^.*$ - italic: - description: URL to the italic font file - $id: "#root/items/items/files/italic" - title: Italic - type: string - default: "" - pattern: ^.*$ - category: - description: - The category the font belongs to (e.g. 'sans-serif', - 'serif') - $id: "#root/items/items/category" - title: Category - type: string - default: "" - pattern: ^.*$ - kind: - description: The resource kind, should always be 'webfonts#webfont' - $id: "#root/items/items/kind" - title: Kind - type: string - default: "" - pattern: ^.*$ -streams: - - "#/definitions/fonts_stream" - -check: - stream_names: - - "fonts" + title: Regular + title: Files + kind: + type: string + $id: "#root/items/items/kind" + description: The resource kind, should always be 'webfonts#webfont' + pattern: ^.*$ + title: Kind + lastModified: + type: string + $id: "#root/items/items/lastModified" + description: Timestamp of the last modification date of the font + pattern: ^.*$ + title: Lastmodified + subsets: + type: array + $id: "#root/items/items/subsets" + default: [] + description: List of language subsets supported by the font + items: + type: string + $id: "#root/items/items/subsets/items" + pattern: ^.*$ + title: Items + title: Subsets + variants: + type: array + $id: "#root/items/items/variants" + default: [] + description: Different styles and weights available for the font + items: + type: string + $id: "#root/items/items/variants/items" + pattern: ^.*$ + title: Items + title: Variants + title: Items + title: Items + kind: + type: string + $id: "#root/kind" + description: The API resource kind, always set to 'webfonts#webfontList' + pattern: ^.*$ + title: Kind + title: Root diff --git a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/run.py b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/run.py index fbce9176984d..44fc74cd643c 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/run.py +++ b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/run.py @@ -1,12 +1,13 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # import sys from airbyte_cdk.entrypoint import launch -from source_google_webfonts import SourceGoogleWebfonts + +from .source import SourceGoogleWebfonts def run(): diff --git a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/source.py b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/source.py index 702be83a0b16..0a706123fb78 100644 --- a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/source.py +++ b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/source.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# Copyright (c) 2024 Airbyte, Inc., all rights reserved. # from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource diff --git a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/spec.yaml b/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/spec.yaml deleted file mode 100644 index ebc80b05ad5a..000000000000 --- a/airbyte-integrations/connectors/source-google-webfonts/source_google_webfonts/spec.yaml +++ /dev/null @@ -1,22 +0,0 @@ -documentationUrl: https://docs.airbyte.com/integrations/sources/google-webfonts -connectionSpecification: - $schema: http://json-schema.org/draft-07/schema# - title: Google Webfonts Spec - type: object - required: - - api_key - additionalProperties: true - properties: - api_key: - type: string - description: API key is required to access google apis, For getting your's goto google console and generate api key for Webfonts - airbyte_secret: true - sort: - type: string - description: Optional, to find how to sort - prettyPrint: - type: string - description: Optional, boolean type - alt: - type: string - description: Optional, Available params- json, media, proto diff --git a/docs/integrations/sources/google-webfonts.md b/docs/integrations/sources/google-webfonts.md index a1cfab9ecde8..784722a70a65 100644 --- a/docs/integrations/sources/google-webfonts.md +++ b/docs/integrations/sources/google-webfonts.md @@ -64,7 +64,8 @@ Google Webfont's [API reference](https://developers.google.com/fonts/docs/develo ## Changelog | Version | Date | Pull Request | Subject | -| :------ | :--------- | :------------------------------------------------------- | :------------------------------------------------------------------------------ | +| :------ | :--------- | :------------------------------------------------------- |:--------------------------------------------------------------------------------| +| 0.1.4 | 2024-05-28 | [38684](https://github.com/airbytehq/airbyte/pull/38684) | Make connector compatible with Builder | | 0.1.3 | 2024-04-19 | [37172](https://github.com/airbytehq/airbyte/pull/37172) | Upgrade to CDK 0.80.0 and manage dependencies with Poetry. | | 0.1.2 | 2024-04-15 | [37172](https://github.com/airbytehq/airbyte/pull/37172) | Base image migration: remove Dockerfile and use the python-connector-base image | | 0.1.1 | 2024-04-12 | [37172](https://github.com/airbytehq/airbyte/pull/37172) | schema descriptions |