From fdf5c97fe50dce1c7f2467856495c88d29b752f8 Mon Sep 17 00:00:00 2001 From: Aviraj Gour <100823015+avirajsingh7@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:57:54 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Source=20PokeApi=20-=20Migrated=20t?= =?UTF-8?q?o=20Low=20code=20(#30969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sajarin Co-authored-by: marcosmarxm Co-authored-by: Marcos Marx --- .../connectors/source-pokeapi/Dockerfile | 35 +- .../connectors/source-pokeapi/README.md | 97 +- .../{unit_tests/unit_test.py => __init__.py} | 4 - .../source-pokeapi/acceptance-test-config.yml | 26 +- .../source-pokeapi/acceptance-test-docker.sh | 1 + .../integration_tests/__init__.py | 2 +- .../integration_tests/abnormal_state.json | 5 + .../integration_tests/acceptance.py | 2 + .../integration_tests/config.json | 1 - .../integration_tests/configured_catalog.json | 10 +- .../integration_tests/invalid_config.json | 4 +- .../integration_tests/sample_config.json | 3 + .../integration_tests/sample_state.json | 5 + .../connectors/source-pokeapi/main.py | 1 + .../connectors/source-pokeapi/metadata.yaml | 25 +- .../source-pokeapi/requirements.txt | 1 + .../connectors/source-pokeapi/setup.py | 12 +- .../source-pokeapi/source_pokeapi/__init__.py | 3 +- .../source_pokeapi/manifest.yaml | 40 + .../source_pokeapi/pokemon_list.py | 909 ----------------- .../source_pokeapi/schemas/TODO.md | 25 - .../source_pokeapi/schemas/pokemon.json | 66 +- .../source-pokeapi/source_pokeapi/source.py | 70 +- .../source-pokeapi/source_pokeapi/spec.json | 19 - .../source-pokeapi/source_pokeapi/spec.yaml | 916 ++++++++++++++++++ docs/integrations/sources/pokeapi.md | 2 + 26 files changed, 1145 insertions(+), 1139 deletions(-) rename airbyte-integrations/connectors/source-pokeapi/{unit_tests/unit_test.py => __init__.py} (57%) mode change 100644 => 100755 airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh create mode 100644 airbyte-integrations/connectors/source-pokeapi/integration_tests/abnormal_state.json delete mode 100644 airbyte-integrations/connectors/source-pokeapi/integration_tests/config.json create mode 100644 airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_config.json create mode 100644 airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_state.json create mode 100644 airbyte-integrations/connectors/source-pokeapi/source_pokeapi/manifest.yaml delete mode 100644 airbyte-integrations/connectors/source-pokeapi/source_pokeapi/pokemon_list.py delete mode 100644 airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/TODO.md delete mode 100644 airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.json create mode 100644 airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.yaml diff --git a/airbyte-integrations/connectors/source-pokeapi/Dockerfile b/airbyte-integrations/connectors/source-pokeapi/Dockerfile index 31f309c2e920..0d27d3737d6f 100644 --- a/airbyte-integrations/connectors/source-pokeapi/Dockerfile +++ b/airbyte-integrations/connectors/source-pokeapi/Dockerfile @@ -1,17 +1,38 @@ -FROM python:3.9-slim +FROM python:3.9.11-alpine3.15 as base -# Bash is installed for more convenient debugging. -RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* +# build and load all requirements +FROM base as builder +WORKDIR /airbyte/integration_code + +# upgrade pip to the latest version +RUN apk --no-cache upgrade \ + && pip install --upgrade pip \ + && apk --no-cache add tzdata build-base +COPY setup.py ./ +# install necessary packages to a temporary folder +RUN pip install --prefix=/install . + +# build a clean environment +FROM base WORKDIR /airbyte/integration_code -COPY source_pokeapi ./source_pokeapi + +# copy all loaded and built libraries to a pure basic image +COPY --from=builder /install /usr/local +# add default timezone settings +COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime +RUN echo "Etc/UTC" > /etc/timezone + +# bash is installed for more convenient debugging. +RUN apk --no-cache add bash + +# copy payload code only COPY main.py ./ -COPY setup.py ./ -RUN pip install . +COPY source_pokeapi ./source_pokeapi ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.5 +LABEL io.airbyte.version=0.2.0 LABEL io.airbyte.name=airbyte/source-pokeapi diff --git a/airbyte-integrations/connectors/source-pokeapi/README.md b/airbyte-integrations/connectors/source-pokeapi/README.md index 8d422510264a..d91cab01c98e 100644 --- a/airbyte-integrations/connectors/source-pokeapi/README.md +++ b/airbyte-integrations/connectors/source-pokeapi/README.md @@ -1,34 +1,10 @@ # Pokeapi Source -This is the repository for the Pokeapi source connector, written in Python. -For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/pokeapi). +This is the repository for the Pokeapi configuration based source connector. +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/pokeapi). ## Local development -### Prerequisites -**To iterate on this connector, make sure to complete this prerequisites section.** - -#### Minimum Python version required `= 3.7.0` - -#### Build & Activate Virtual Environment and install dependencies -From this connector directory, create a virtual environment: -``` -python -m venv .venv -``` - -This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your -development environment of choice. To activate it from the terminal, run: -``` -source .venv/bin/activate -pip install -r requirements.txt -``` -If you are in an IDE, follow your IDE's instructions to activate the virtualenv. - -Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is -used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`. -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 -should work as you expect. - #### Building via Gradle You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow. @@ -38,29 +14,14 @@ To build using Gradle, from the Airbyte repository root, run: ``` #### Create credentials -**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/pokeapi) -to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_pokeapi/spec.json` file. +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/pokeapi) +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_pokeapi/spec.yaml` file. Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. -See `sample_files/sample_config.json` for a sample config file. +See `integration_tests/sample_config.json` for a sample config file. **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source pokeapi test creds` and place them into `secrets/config.json`. - -### Locally running the connector -``` -python main_dev.py spec -python main_dev.py check --config secrets/config.json -python main_dev.py discover --config secrets/config.json -python main_dev.py read --config secrets/config.json --catalog sample_files/configured_catalog.json -``` - -### Unit Tests -To run unit tests locally, from the connector directory run: -``` -python -m pytest unit_tests -``` - ### Locally running the connector docker image #### Build @@ -82,56 +43,40 @@ Then run any of the connector commands as follows: docker run --rm airbyte/source-pokeapi:dev spec docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-pokeapi:dev check --config /secrets/config.json docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-pokeapi:dev discover --config /secrets/config.json -docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-pokeapi:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-pokeapi:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json ``` - ## Testing -Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named. -First install test dependencies into your virtual environment: -``` -pip install .[tests] -``` -### Unit Tests -To run unit tests locally, from the connector directory run: -``` -python -m pytest unit_tests -``` - -### Integration Tests -There are two types of integration tests: Acceptance Tests (Airbyte's test suite for all source connectors) and custom integration tests (which are specific to this connector). -#### Custom Integration tests -Place custom tests inside `integration_tests/` folder, then, from the connector root, run -``` -python -m pytest integration_tests -``` #### Acceptance Tests -Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information. +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. 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. -To run your integration tests with acceptance tests, from the connector root, run + +To run your integration tests with Docker, run: ``` -python -m pytest integration_tests -p integration_tests.acceptance +./acceptance-test-docker.sh ``` -To run your integration tests with docker ### Using gradle to run tests All commands should be run from airbyte project root. -To run unittest run: +To run unit tests: ``` ./gradlew :airbyte-integrations:connectors:source-pokeapi:unitTest ``` -To run acceptance and custom integration tests run: +To run acceptance and custom integration tests: ``` -./gradlew :airbyte-integrations:connectors:source-pokeapi:IntegrationTest +./gradlew :airbyte-integrations:connectors:source-pokeapi:integrationTest ``` ## Dependency Management 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. +We split dependencies between two groups, dependencies that are: +* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. +* required for the testing need to go to `TEST_REQUIREMENTS` list ### Publishing a new version of the connector You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? -1. Make sure your changes are passing unit and integration tests -1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use SemVer). -1. Create a Pull Request -1. Pat yourself on the back for being an awesome contributor -1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master +1. Make sure your changes are passing unit and integration tests. +1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)). +1. Create a Pull Request. +1. Pat yourself on the back for being an awesome contributor. +1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master. diff --git a/airbyte-integrations/connectors/source-pokeapi/unit_tests/unit_test.py b/airbyte-integrations/connectors/source-pokeapi/__init__.py similarity index 57% rename from airbyte-integrations/connectors/source-pokeapi/unit_tests/unit_test.py rename to airbyte-integrations/connectors/source-pokeapi/__init__.py index 219ae0142c72..c941b3045795 100644 --- a/airbyte-integrations/connectors/source-pokeapi/unit_tests/unit_test.py +++ b/airbyte-integrations/connectors/source-pokeapi/__init__.py @@ -1,7 +1,3 @@ # # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # - - -def test_example_method(): - assert True diff --git a/airbyte-integrations/connectors/source-pokeapi/acceptance-test-config.yml b/airbyte-integrations/connectors/source-pokeapi/acceptance-test-config.yml index 2f23c6db6c7f..e0d96ad450b3 100644 --- a/airbyte-integrations/connectors/source-pokeapi/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-pokeapi/acceptance-test-config.yml @@ -1,23 +1,29 @@ +# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) +# for more information about how to configure these tests connector_image: airbyte/source-pokeapi:dev -test_strictness_level: high acceptance_tests: spec: - bypass_reason: "The spec is currently invalid: it has additionalProperties set to false" + tests: + - spec_path: "source_pokeapi/spec.yaml" + backward_compatibility_tests_config: + disable_for_version: "0.1.5" connection: tests: - - config_path: "integration_tests/config.json" + - config_path: "secrets/config.json" status: "succeed" discovery: tests: - - config_path: "integration_tests/config.json" + - config_path: "secrets/config.json" + backward_compatibility_tests_config: + disable_for_version: "0.1.5" basic_read: tests: - - config_path: "integration_tests/config.json" - expect_records: - bypass_reason: "We should create an expected_records file" + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + empty_streams: [] + incremental: + bypass_reason: "This connector does not implement incremental sync" full_refresh: tests: - - config_path: "integration_tests/config.json" + - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog.json" - incremental: - bypass_reason: "This connector does not support incremental syncs." diff --git a/airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh old mode 100644 new mode 100755 index 5797d20fe9a7..b6d65deeccb4 --- a/airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh +++ b/airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh @@ -1,2 +1,3 @@ #!/usr/bin/env sh + source "$(git rev-parse --show-toplevel)/airbyte-integrations/bases/connector-acceptance-test/acceptance-test-docker.sh" diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/__init__.py b/airbyte-integrations/connectors/source-pokeapi/integration_tests/__init__.py index 46b7376756ec..c941b3045795 100644 --- a/airbyte-integrations/connectors/source-pokeapi/integration_tests/__init__.py +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/__init__.py @@ -1,3 +1,3 @@ # -# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. # diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/abnormal_state.json new file mode 100644 index 000000000000..52b0f2c2118f --- /dev/null +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/abnormal_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "todo-abnormal-value" + } +} diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-pokeapi/integration_tests/acceptance.py index 82823254d266..9e6409236281 100644 --- a/airbyte-integrations/connectors/source-pokeapi/integration_tests/acceptance.py +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/acceptance.py @@ -11,4 +11,6 @@ @pytest.fixture(scope="session", autouse=True) def connector_setup(): """This fixture is a placeholder for external resources that acceptance test might require.""" + # TODO: setup test dependencies if needed. otherwise remove the TODO comments yield + # TODO: clean up test dependencies diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/config.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/config.json deleted file mode 100644 index 392328e8b027..000000000000 --- a/airbyte-integrations/connectors/source-pokeapi/integration_tests/config.json +++ /dev/null @@ -1 +0,0 @@ -{ "pokemon_name": "ditto" } diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/configured_catalog.json index 72ca528d90f7..81e82dbd2fe4 100644 --- a/airbyte-integrations/connectors/source-pokeapi/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/configured_catalog.json @@ -3,15 +3,7 @@ { "stream": { "name": "pokemon", - "json_schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "pokemon_name": { - "type": "string" - } - } - }, + "json_schema": {}, "supported_sync_modes": ["full_refresh"] }, "sync_mode": "full_refresh", diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/invalid_config.json index 0d853925b60a..8c41d238d6ee 100644 --- a/airbyte-integrations/connectors/source-pokeapi/integration_tests/invalid_config.json +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/invalid_config.json @@ -1 +1,3 @@ -{ "name": "datto" } +{ + "name": "datto" +} diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_config.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_config.json new file mode 100644 index 000000000000..021fea1002f3 --- /dev/null +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_config.json @@ -0,0 +1,3 @@ +{ + "pokemon_name": "ditto" +} diff --git a/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_state.json b/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_state.json new file mode 100644 index 000000000000..3587e579822d --- /dev/null +++ b/airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_state.json @@ -0,0 +1,5 @@ +{ + "todo-stream-name": { + "todo-field-name": "value" + } +} diff --git a/airbyte-integrations/connectors/source-pokeapi/main.py b/airbyte-integrations/connectors/source-pokeapi/main.py index 38a510a3f2d7..9ec4c483ecf9 100644 --- a/airbyte-integrations/connectors/source-pokeapi/main.py +++ b/airbyte-integrations/connectors/source-pokeapi/main.py @@ -2,6 +2,7 @@ # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # + import sys from airbyte_cdk.entrypoint import launch diff --git a/airbyte-integrations/connectors/source-pokeapi/metadata.yaml b/airbyte-integrations/connectors/source-pokeapi/metadata.yaml index dec58781459c..2a42c85e082c 100644 --- a/airbyte-integrations/connectors/source-pokeapi/metadata.yaml +++ b/airbyte-integrations/connectors/source-pokeapi/metadata.yaml @@ -1,24 +1,25 @@ data: + allowedHosts: + hosts: + - "*" + registries: + oss: + enabled: true + cloud: + enabled: true connectorSubtype: api connectorType: source definitionId: 6371b14b-bc68-4236-bfbd-468e8df8e968 - dockerImageTag: 0.1.5 + dockerImageTag: 0.2.0 dockerRepository: airbyte/source-pokeapi githubIssueLabel: source-pokeapi icon: pokeapi.svg license: MIT - name: PokeAPI - registries: - cloud: - enabled: true - oss: - enabled: true + name: Pokeapi + releaseDate: '2020-05-04' releaseStage: alpha + supportLevel: community documentationUrl: https://docs.airbyte.com/integrations/sources/pokeapi tags: - - language:python - ab_internal: - sl: 100 - ql: 100 - supportLevel: community + - language:lowcode metadataSpecVersion: "1.0" diff --git a/airbyte-integrations/connectors/source-pokeapi/requirements.txt b/airbyte-integrations/connectors/source-pokeapi/requirements.txt index d6e1198b1ab1..cf563bcab685 100644 --- a/airbyte-integrations/connectors/source-pokeapi/requirements.txt +++ b/airbyte-integrations/connectors/source-pokeapi/requirements.txt @@ -1 +1,2 @@ -e . +-e ../../bases/connector-acceptance-test \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-pokeapi/setup.py b/airbyte-integrations/connectors/source-pokeapi/setup.py index e5cdf3627e09..2fa7839b58fc 100644 --- a/airbyte-integrations/connectors/source-pokeapi/setup.py +++ b/airbyte-integrations/connectors/source-pokeapi/setup.py @@ -5,9 +5,15 @@ from setuptools import find_packages, setup -MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1"] +MAIN_REQUIREMENTS = [ + "airbyte-cdk", +] -TEST_REQUIREMENTS = ["requests-mock~=1.9.3", "pytest-mock~=3.6.1", "pytest~=6.1"] +TEST_REQUIREMENTS = [ + "requests-mock~=1.9.3", + "pytest~=6.2", + "pytest-mock~=3.6.1", +] setup( name="source_pokeapi", @@ -16,7 +22,7 @@ author_email="contact@airbyte.io", packages=find_packages(), install_requires=MAIN_REQUIREMENTS, - package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]}, + package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, extras_require={ "tests": TEST_REQUIREMENTS, }, diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/__init__.py b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/__init__.py index 091b006498ea..e21b6da3ff71 100644 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/__init__.py +++ b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/__init__.py @@ -1,7 +1,8 @@ # -# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. # + from .source import SourcePokeapi __all__ = ["SourcePokeapi"] diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/manifest.yaml b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/manifest.yaml new file mode 100644 index 000000000000..e556d07b2cb8 --- /dev/null +++ b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/manifest.yaml @@ -0,0 +1,40 @@ +version: "0.29.0" + +definitions: + selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: [] + requester: + type: HttpRequester + url_base: "https://pokeapi.co/api/v2/pokemon" + http_method: "GET" + authenticator: + type: NoAuth + retriever: + type: SimpleRetriever + record_selector: + $ref: "#/definitions/selector" + paginator: + type: NoPagination + requester: + $ref: "#/definitions/requester" + base_stream: + type: DeclarativeStream + retriever: + $ref: "#/definitions/retriever" + pokemon_stream: + $ref: "#/definitions/base_stream" + name: "pokemon" + primary_key: "id" + $parameters: + path: "/{{config['pokemon_name']}}" + +streams: + - "#/definitions/pokemon_stream" + +check: + type: CheckStream + stream_names: + - "pokemon" diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/pokemon_list.py b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/pokemon_list.py deleted file mode 100644 index fa640b8ec06a..000000000000 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/pokemon_list.py +++ /dev/null @@ -1,909 +0,0 @@ -# -# Copyright (c) 2023 Airbyte, Inc., all rights reserved. -# - - -""" -pokemon_list.py includes a list of all known pokemon for config validation in source.py. -""" - -POKEMON_LIST = [ - "bulbasaur", - "ivysaur", - "venusaur", - "charmander", - "charmeleon", - "charizard", - "squirtle", - "wartortle", - "blastoise", - "caterpie", - "metapod", - "butterfree", - "weedle", - "kakuna", - "beedrill", - "pidgey", - "pidgeotto", - "pidgeot", - "rattata", - "raticate", - "spearow", - "fearow", - "ekans", - "arbok", - "pikachu", - "raichu", - "sandshrew", - "sandslash", - "nidoranf", - "nidorina", - "nidoqueen", - "nidoranm", - "nidorino", - "nidoking", - "clefairy", - "clefable", - "vulpix", - "ninetales", - "jigglypuff", - "wigglytuff", - "zubat", - "golbat", - "oddish", - "gloom", - "vileplume", - "paras", - "parasect", - "venonat", - "venomoth", - "diglett", - "dugtrio", - "meowth", - "persian", - "psyduck", - "golduck", - "mankey", - "primeape", - "growlithe", - "arcanine", - "poliwag", - "poliwhirl", - "poliwrath", - "abra", - "kadabra", - "alakazam", - "machop", - "machoke", - "machamp", - "bellsprout", - "weepinbell", - "victreebel", - "tentacool", - "tentacruel", - "geodude", - "graveler", - "golem", - "ponyta", - "rapidash", - "slowpoke", - "slowbro", - "magnemite", - "magneton", - "farfetchd", - "doduo", - "dodrio", - "seel", - "dewgong", - "grimer", - "muk", - "shellder", - "cloyster", - "gastly", - "haunter", - "gengar", - "onix", - "drowzee", - "hypno", - "krabby", - "kingler", - "voltorb", - "electrode", - "exeggcute", - "exeggutor", - "cubone", - "marowak", - "hitmonlee", - "hitmonchan", - "lickitung", - "koffing", - "weezing", - "rhyhorn", - "rhydon", - "chansey", - "tangela", - "kangaskhan", - "horsea", - "seadra", - "goldeen", - "seaking", - "staryu", - "starmie", - "mrmime", - "scyther", - "jynx", - "electabuzz", - "magmar", - "pinsir", - "tauros", - "magikarp", - "gyarados", - "lapras", - "ditto", - "eevee", - "vaporeon", - "jolteon", - "flareon", - "porygon", - "omanyte", - "omastar", - "kabuto", - "kabutops", - "aerodactyl", - "snorlax", - "articuno", - "zapdos", - "moltres", - "dratini", - "dragonair", - "dragonite", - "mewtwo", - "mew", - "chikorita", - "bayleef", - "meganium", - "cyndaquil", - "quilava", - "typhlosion", - "totodile", - "croconaw", - "feraligatr", - "sentret", - "furret", - "hoothoot", - "noctowl", - "ledyba", - "ledian", - "spinarak", - "ariados", - "crobat", - "chinchou", - "lanturn", - "pichu", - "cleffa", - "igglybuff", - "togepi", - "togetic", - "natu", - "xatu", - "mareep", - "flaaffy", - "ampharos", - "bellossom", - "marill", - "azumarill", - "sudowoodo", - "politoed", - "hoppip", - "skiploom", - "jumpluff", - "aipom", - "sunkern", - "sunflora", - "yanma", - "wooper", - "quagsire", - "espeon", - "umbreon", - "murkrow", - "slowking", - "misdreavus", - "unown", - "wobbuffet", - "girafarig", - "pineco", - "forretress", - "dunsparce", - "gligar", - "steelix", - "snubbull", - "granbull", - "qwilfish", - "scizor", - "shuckle", - "heracross", - "sneasel", - "teddiursa", - "ursaring", - "slugma", - "magcargo", - "swinub", - "piloswine", - "corsola", - "remoraid", - "octillery", - "delibird", - "mantine", - "skarmory", - "houndour", - "houndoom", - "kingdra", - "phanpy", - "donphan", - "porygon2", - "stantler", - "smeargle", - "tyrogue", - "hitmontop", - "smoochum", - "elekid", - "magby", - "miltank", - "blissey", - "raikou", - "entei", - "suicune", - "larvitar", - "pupitar", - "tyranitar", - "lugia", - "ho-oh", - "celebi", - "treecko", - "grovyle", - "sceptile", - "torchic", - "combusken", - "blaziken", - "mudkip", - "marshtomp", - "swampert", - "poochyena", - "mightyena", - "zigzagoon", - "linoone", - "wurmple", - "silcoon", - "beautifly", - "cascoon", - "dustox", - "lotad", - "lombre", - "ludicolo", - "seedot", - "nuzleaf", - "shiftry", - "taillow", - "swellow", - "wingull", - "pelipper", - "ralts", - "kirlia", - "gardevoir", - "surskit", - "masquerain", - "shroomish", - "breloom", - "slakoth", - "vigoroth", - "slaking", - "nincada", - "ninjask", - "shedinja", - "whismur", - "loudred", - "exploud", - "makuhita", - "hariyama", - "azurill", - "nosepass", - "skitty", - "delcatty", - "sableye", - "mawile", - "aron", - "lairon", - "aggron", - "meditite", - "medicham", - "electrike", - "manectric", - "plusle", - "minun", - "volbeat", - "illumise", - "roselia", - "gulpin", - "swalot", - "carvanha", - "sharpedo", - "wailmer", - "wailord", - "numel", - "camerupt", - "torkoal", - "spoink", - "grumpig", - "spinda", - "trapinch", - "vibrava", - "flygon", - "cacnea", - "cacturne", - "swablu", - "altaria", - "zangoose", - "seviper", - "lunatone", - "solrock", - "barboach", - "whiscash", - "corphish", - "crawdaunt", - "baltoy", - "claydol", - "lileep", - "cradily", - "anorith", - "armaldo", - "feebas", - "milotic", - "castform", - "kecleon", - "shuppet", - "banette", - "duskull", - "dusclops", - "tropius", - "chimecho", - "absol", - "wynaut", - "snorunt", - "glalie", - "spheal", - "sealeo", - "walrein", - "clamperl", - "huntail", - "gorebyss", - "relicanth", - "luvdisc", - "bagon", - "shelgon", - "salamence", - "beldum", - "metang", - "metagross", - "regirock", - "regice", - "registeel", - "latias", - "latios", - "kyogre", - "groudon", - "rayquaza", - "jirachi", - "deoxys", - "turtwig", - "grotle", - "torterra", - "chimchar", - "monferno", - "infernape", - "piplup", - "prinplup", - "empoleon", - "starly", - "staravia", - "staraptor", - "bidoof", - "bibarel", - "kricketot", - "kricketune", - "shinx", - "luxio", - "luxray", - "budew", - "roserade", - "cranidos", - "rampardos", - "shieldon", - "bastiodon", - "burmy", - "wormadam", - "mothim", - "combee", - "vespiquen", - "pachirisu", - "buizel", - "floatzel", - "cherubi", - "cherrim", - "shellos", - "gastrodon", - "ambipom", - "drifloon", - "drifblim", - "buneary", - "lopunny", - "mismagius", - "honchkrow", - "glameow", - "purugly", - "chingling", - "stunky", - "skuntank", - "bronzor", - "bronzong", - "bonsly", - "mimejr", - "happiny", - "chatot", - "spiritomb", - "gible", - "gabite", - "garchomp", - "munchlax", - "riolu", - "lucario", - "hippopotas", - "hippowdon", - "skorupi", - "drapion", - "croagunk", - "toxicroak", - "carnivine", - "finneon", - "lumineon", - "mantyke", - "snover", - "abomasnow", - "weavile", - "magnezone", - "lickilicky", - "rhyperior", - "tangrowth", - "electivire", - "magmortar", - "togekiss", - "yanmega", - "leafeon", - "glaceon", - "gliscor", - "mamoswine", - "porygon-z", - "gallade", - "probopass", - "dusknoir", - "froslass", - "rotom", - "uxie", - "mesprit", - "azelf", - "dialga", - "palkia", - "heatran", - "regigigas", - "giratina", - "cresselia", - "phione", - "manaphy", - "darkrai", - "shaymin", - "arceus", - "victini", - "snivy", - "servine", - "serperior", - "tepig", - "pignite", - "emboar", - "oshawott", - "dewott", - "samurott", - "patrat", - "watchog", - "lillipup", - "herdier", - "stoutland", - "purrloin", - "liepard", - "pansage", - "simisage", - "pansear", - "simisear", - "panpour", - "simipour", - "munna", - "musharna", - "pidove", - "tranquill", - "unfezant", - "blitzle", - "zebstrika", - "roggenrola", - "boldore", - "gigalith", - "woobat", - "swoobat", - "drilbur", - "excadrill", - "audino", - "timburr", - "gurdurr", - "conkeldurr", - "tympole", - "palpitoad", - "seismitoad", - "throh", - "sawk", - "sewaddle", - "swadloon", - "leavanny", - "venipede", - "whirlipede", - "scolipede", - "cottonee", - "whimsicott", - "petilil", - "lilligant", - "basculin", - "sandile", - "krokorok", - "krookodile", - "darumaka", - "darmanitan", - "maractus", - "dwebble", - "crustle", - "scraggy", - "scrafty", - "sigilyph", - "yamask", - "cofagrigus", - "tirtouga", - "carracosta", - "archen", - "archeops", - "trubbish", - "garbodor", - "zorua", - "zoroark", - "minccino", - "cinccino", - "gothita", - "gothorita", - "gothitelle", - "solosis", - "duosion", - "reuniclus", - "ducklett", - "swanna", - "vanillite", - "vanillish", - "vanilluxe", - "deerling", - "sawsbuck", - "emolga", - "karrablast", - "escavalier", - "foongus", - "amoonguss", - "frillish", - "jellicent", - "alomomola", - "joltik", - "galvantula", - "ferroseed", - "ferrothorn", - "klink", - "klang", - "klinklang", - "tynamo", - "eelektrik", - "eelektross", - "elgyem", - "beheeyem", - "litwick", - "lampent", - "chandelure", - "axew", - "fraxure", - "haxorus", - "cubchoo", - "beartic", - "cryogonal", - "shelmet", - "accelgor", - "stunfisk", - "mienfoo", - "mienshao", - "druddigon", - "golett", - "golurk", - "pawniard", - "bisharp", - "bouffalant", - "rufflet", - "braviary", - "vullaby", - "mandibuzz", - "heatmor", - "durant", - "deino", - "zweilous", - "hydreigon", - "larvesta", - "volcarona", - "cobalion", - "terrakion", - "virizion", - "tornadus", - "thundurus", - "reshiram", - "zekrom", - "landorus", - "kyurem", - "keldeo", - "meloetta", - "genesect", - "chespin", - "quilladin", - "chesnaught", - "fennekin", - "braixen", - "delphox", - "froakie", - "frogadier", - "greninja", - "bunnelby", - "diggersby", - "fletchling", - "fletchinder", - "talonflame", - "scatterbug", - "spewpa", - "vivillon", - "litleo", - "pyroar", - "flabebe", - "floette", - "florges", - "skiddo", - "gogoat", - "pancham", - "pangoro", - "furfrou", - "espurr", - "meowstic", - "honedge", - "doublade", - "aegislash", - "spritzee", - "aromatisse", - "swirlix", - "slurpuff", - "inkay", - "malamar", - "binacle", - "barbaracle", - "skrelp", - "dragalge", - "clauncher", - "clawitzer", - "helioptile", - "heliolisk", - "tyrunt", - "tyrantrum", - "amaura", - "aurorus", - "sylveon", - "hawlucha", - "dedenne", - "carbink", - "goomy", - "sliggoo", - "goodra", - "klefki", - "phantump", - "trevenant", - "pumpkaboo", - "gourgeist", - "bergmite", - "avalugg", - "noibat", - "noivern", - "xerneas", - "yveltal", - "zygarde", - "diancie", - "hoopa", - "volcanion", - "rowlet", - "dartrix", - "decidueye", - "litten", - "torracat", - "incineroar", - "popplio", - "brionne", - "primarina", - "pikipek", - "trumbeak", - "toucannon", - "yungoos", - "gumshoos", - "grubbin", - "charjabug", - "vikavolt", - "crabrawler", - "crabominable", - "oricorio", - "cutiefly", - "ribombee", - "rockruff", - "lycanroc", - "wishiwashi", - "mareanie", - "toxapex", - "mudbray", - "mudsdale", - "dewpider", - "araquanid", - "fomantis", - "lurantis", - "morelull", - "shiinotic", - "salandit", - "salazzle", - "stufful", - "bewear", - "bounsweet", - "steenee", - "tsareena", - "comfey", - "oranguru", - "passimian", - "wimpod", - "golisopod", - "sandygast", - "palossand", - "pyukumuku", - "typenull", - "silvally", - "minior", - "komala", - "turtonator", - "togedemaru", - "mimikyu", - "bruxish", - "drampa", - "dhelmise", - "jangmo-o", - "hakamo-o", - "kommo-o", - "tapukoko", - "tapulele", - "tapubulu", - "tapufini", - "cosmog", - "cosmoem", - "solgaleo", - "lunala", - "nihilego", - "buzzwole", - "pheromosa", - "xurkitree", - "celesteela", - "kartana", - "guzzlord", - "necrozma", - "magearna", - "marshadow", - "poipole", - "naganadel", - "stakataka", - "blacephalon", - "zeraora", - "meltan", - "melmetal", - "grookey", - "thwackey", - "rillaboom", - "scorbunny", - "raboot", - "cinderace", - "sobble", - "drizzile", - "inteleon", - "skwovet", - "greedent", - "rookidee", - "corvisquire", - "corviknight", - "blipbug", - "dottler", - "orbeetle", - "nickit", - "thievul", - "gossifleur", - "eldegoss", - "wooloo", - "dubwool", - "chewtle", - "drednaw", - "yamper", - "boltund", - "rolycoly", - "carkol", - "coalossal", - "applin", - "flapple", - "appletun", - "silicobra", - "sandaconda", - "cramorant", - "arrokuda", - "barraskewda", - "toxel", - "toxtricity", - "sizzlipede", - "centiskorch", - "clobbopus", - "grapploct", - "sinistea", - "polteageist", - "hatenna", - "hattrem", - "hatterene", - "impidimp", - "morgrem", - "grimmsnarl", - "obstagoon", - "perrserker", - "cursola", - "sirfetchd", - "mrrime", - "runerigus", - "milcery", - "alcremie", - "falinks", - "pincurchin", - "snom", - "frosmoth", - "stonjourner", - "eiscue", - "indeedee", - "morpeko", - "cufant", - "copperajah", - "dracozolt", - "arctozolt", - "dracovish", - "arctovish", - "duraludon", - "dreepy", - "drakloak", - "dragapult", - "zacian", - "zamazenta", - "eternatus", - "kubfu", - "urshifu", - "zarude", - "regieleki", - "regidrago", - "glastrier", - "spectrier", - "calyrex", -] diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/TODO.md b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/TODO.md deleted file mode 100644 index cf1efadb3c9c..000000000000 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/TODO.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: Define your stream schemas -Your connector must describe the schema of each stream it can output using [JSONSchema](https://json-schema.org). - -The simplest way to do this is to describe the schema of your streams using one `.json` file per stream. You can also dynamically generate the schema of your stream in code, or you can combine both approaches: start with a `.json` file and dynamically add properties to it. - -The schema of a stream is the return value of `Stream.get_json_schema`. - -## Static schemas -By default, `Stream.get_json_schema` reads a `.json` file in the `schemas/` directory whose name is equal to the value of the `Stream.name` property. In turn `Stream.name` by default returns the name of the class in snake case. Therefore, if you have a class `class EmployeeBenefits(HttpStream)` the default behavior will look for a file called `schemas/employee_benefits.json`. You can override any of these behaviors as you need. - -Important note: any objects referenced via `$ref` should be placed in the `shared/` directory in their own `.json` files. - -## Dynamic schemas -If you'd rather define your schema in code, override `Stream.get_json_schema` in your stream class to return a `dict` describing the schema using [JSONSchema](https://json-schema.org). - -## Dynamically modifying static schemas -Override `Stream.get_json_schema` to run the default behavior, edit the returned value, then return the edited value: -``` -def get_json_schema(self): - schema = super().get_json_schema() - schema['dynamically_determined_property'] = "property" - return schema -``` - -Delete this file once you're done. Or don't. Up to you :) diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/pokemon.json b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/pokemon.json index 7c190d9cb6c4..c4cdb193909d 100644 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/pokemon.json +++ b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/schemas/pokemon.json @@ -14,7 +14,7 @@ "height": { "type": ["null", "integer"] }, - "is_default ": { + "is_default": { "type": ["null", "boolean"] }, "order": { @@ -27,6 +27,7 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "is_hidden": { "type": ["null", "boolean"] @@ -36,6 +37,7 @@ }, "ability": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -52,6 +54,7 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -66,12 +69,14 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "game_index": { "type": ["null", "integer"] }, "version": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -88,9 +93,11 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "item": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -104,9 +111,11 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "version": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -132,9 +141,11 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "move": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -148,9 +159,11 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "move_learn_method": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -162,6 +175,7 @@ }, "version_group": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -182,6 +196,7 @@ }, "sprites": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "front_default": { "type": ["null", "string"] @@ -211,6 +226,7 @@ }, "species": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -224,9 +240,11 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "stat": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "name": { "type": ["null", "string"] @@ -249,6 +267,7 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { "slot": { "type": ["null", "integer"] @@ -266,6 +285,51 @@ } } } + }, + "past_types": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": { + "generation": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": { + "name": { + "type": ["null", "string"] + }, + "url": { + "type": ["null", "string"] + } + } + }, + "types": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": { + "slot": { + "type": ["null", "integer"] + }, + "type": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": { + "name": { + "type": ["null", "string"] + }, + "url": { + "type": ["null", "string"] + } + } + } + } + } + } + } + } } } } diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/source.py b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/source.py index 650320579e9c..4e1813d78e7e 100644 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/source.py +++ b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/source.py @@ -2,67 +2,17 @@ # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # +from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource -from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple +""" +This file provides the necessary constructs to interpret a provided declarative YAML configuration file into +source connector. -import requests -from airbyte_cdk.sources import AbstractSource -from airbyte_cdk.sources.streams import Stream -from airbyte_cdk.sources.streams.http import HttpStream +WARNING: Do not modify this file. +""" -from . import pokemon_list - -class PokeapiStream(HttpStream): - url_base = "https://pokeapi.co/api/v2/" - - def __init__(self, pokemon_name: str, **kwargs): - super().__init__(**kwargs) - self.pokemon_name = pokemon_name - - def request_params( - self, - stream_state: Mapping[str, Any], - stream_slice: Mapping[str, Any] = None, - next_page_token: Mapping[str, Any] = None, - ) -> MutableMapping[str, Any]: - # The api requires that we include the Pokemon name as a query param so we do that in this method - return {"pokemon_name": self.pokemon_name} - - def parse_response( - self, - response: requests.Response, - stream_state: Mapping[str, Any], - stream_slice: Mapping[str, Any] = None, - next_page_token: Mapping[str, Any] = None, - ) -> Iterable[Mapping]: - # The response is a simple JSON whose schema matches our stream's schema exactly, - # so we just return a list containing the response - return [response.json()] - - def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]: - # The API does not offer pagination, - # so we return None to indicate there are no more pages in the response - return None - - -class Pokemon(PokeapiStream): - # Set this as a noop. - primary_key = None - - def path(self, **kwargs) -> str: - pokemon_name = self.pokemon_name - return f"pokemon/{pokemon_name}" - - -# Source -class SourcePokeapi(AbstractSource): - def check_connection(self, logger, config) -> Tuple[bool, any]: - input_pokemon = config["pokemon_name"] - if input_pokemon not in pokemon_list.POKEMON_LIST: - return False, f"Input Pokemon {input_pokemon} is invalid. Please check your spelling our input a valid Pokemon." - else: - return True, None - - def streams(self, config: Mapping[str, Any]) -> List[Stream]: - return [Pokemon(pokemon_name=config["pokemon_name"])] +# Declarative Source +class SourcePokeapi(YamlDeclarativeSource): + def __init__(self): + super().__init__(**{"path_to_yaml": "manifest.yaml"}) diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.json b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.json deleted file mode 100644 index 8798a9470575..000000000000 --- a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "documentationUrl": "https://docs.airbyte.com/integrations/sources/pokeapi", - "connectionSpecification": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Pokeapi Spec", - "type": "object", - "required": ["pokemon_name"], - "additionalProperties": false, - "properties": { - "pokemon_name": { - "type": "string", - "title": "Pokemon Name", - "description": "Pokemon requested from the API.", - "pattern": "^[a-z0-9_\\-]+$", - "examples": ["ditto", "luxray", "snorlax"] - } - } - } -} diff --git a/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.yaml b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.yaml new file mode 100644 index 000000000000..e08974cd37ec --- /dev/null +++ b/airbyte-integrations/connectors/source-pokeapi/source_pokeapi/spec.yaml @@ -0,0 +1,916 @@ +documentationUrl: "https://docs.airbyte.com/integrations/sources/pokeapi" +connectionSpecification: + $schema: "http://json-schema.org/draft-07/schema#" + title: "Pokeapi Spec" + type: object + required: + - pokemon_name + properties: + pokemon_name: + type: string + title: "Pokemon Name" + description: "Pokemon requested from the API." + pattern: "^[a-z0-9_\\-]+$" + enum: + - bulbasaur + - ivysaur + - venusaur + - charmander + - charmeleon + - charizard + - squirtle + - wartortle + - blastoise + - caterpie + - metapod + - butterfree + - weedle + - kakuna + - beedrill + - pidgey + - pidgeotto + - pidgeot + - rattata + - raticate + - spearow + - fearow + - ekans + - arbok + - pikachu + - raichu + - sandshrew + - sandslash + - nidoranf + - nidorina + - nidoqueen + - nidoranm + - nidorino + - nidoking + - clefairy + - clefable + - vulpix + - ninetales + - jigglypuff + - wigglytuff + - zubat + - golbat + - oddish + - gloom + - vileplume + - paras + - parasect + - venonat + - venomoth + - diglett + - dugtrio + - meowth + - persian + - psyduck + - golduck + - mankey + - primeape + - growlithe + - arcanine + - poliwag + - poliwhirl + - poliwrath + - abra + - kadabra + - alakazam + - machop + - machoke + - machamp + - bellsprout + - weepinbell + - victreebel + - tentacool + - tentacruel + - geodude + - graveler + - golem + - ponyta + - rapidash + - slowpoke + - slowbro + - magnemite + - magneton + - farfetchd + - doduo + - dodrio + - seel + - dewgong + - grimer + - muk + - shellder + - cloyster + - gastly + - haunter + - gengar + - onix + - drowzee + - hypno + - krabby + - kingler + - voltorb + - electrode + - exeggcute + - exeggutor + - cubone + - marowak + - hitmonlee + - hitmonchan + - lickitung + - koffing + - weezing + - rhyhorn + - rhydon + - chansey + - tangela + - kangaskhan + - horsea + - seadra + - goldeen + - seaking + - staryu + - starmie + - mrmime + - scyther + - jynx + - electabuzz + - magmar + - pinsir + - tauros + - magikarp + - gyarados + - lapras + - ditto + - eevee + - vaporeon + - jolteon + - flareon + - porygon + - omanyte + - omastar + - kabuto + - kabutops + - aerodactyl + - snorlax + - articuno + - zapdos + - moltres + - dratini + - dragonair + - dragonite + - mewtwo + - mew + - chikorita + - bayleef + - meganium + - cyndaquil + - quilava + - typhlosion + - totodile + - croconaw + - feraligatr + - sentret + - furret + - hoothoot + - noctowl + - ledyba + - ledian + - spinarak + - ariados + - crobat + - chinchou + - lanturn + - pichu + - cleffa + - igglybuff + - togepi + - togetic + - natu + - xatu + - mareep + - flaaffy + - ampharos + - bellossom + - marill + - azumarill + - sudowoodo + - politoed + - hoppip + - skiploom + - jumpluff + - aipom + - sunkern + - sunflora + - yanma + - wooper + - quagsire + - espeon + - umbreon + - murkrow + - slowking + - misdreavus + - unown + - wobbuffet + - girafarig + - pineco + - forretress + - dunsparce + - gligar + - steelix + - snubbull + - granbull + - qwilfish + - scizor + - shuckle + - heracross + - sneasel + - teddiursa + - ursaring + - slugma + - magcargo + - swinub + - piloswine + - corsola + - remoraid + - octillery + - delibird + - mantine + - skarmory + - houndour + - houndoom + - kingdra + - phanpy + - donphan + - porygon2 + - stantler + - smeargle + - tyrogue + - hitmontop + - smoochum + - elekid + - magby + - miltank + - blissey + - raikou + - entei + - suicune + - larvitar + - pupitar + - tyranitar + - lugia + - ho-oh + - celebi + - treecko + - grovyle + - sceptile + - torchic + - combusken + - blaziken + - mudkip + - marshtomp + - swampert + - poochyena + - mightyena + - zigzagoon + - linoone + - wurmple + - silcoon + - beautifly + - cascoon + - dustox + - lotad + - lombre + - ludicolo + - seedot + - nuzleaf + - shiftry + - taillow + - swellow + - wingull + - pelipper + - ralts + - kirlia + - gardevoir + - surskit + - masquerain + - shroomish + - breloom + - slakoth + - vigoroth + - slaking + - nincada + - ninjask + - shedinja + - whismur + - loudred + - exploud + - makuhita + - hariyama + - azurill + - nosepass + - skitty + - delcatty + - sableye + - mawile + - aron + - lairon + - aggron + - meditite + - medicham + - electrike + - manectric + - plusle + - minun + - volbeat + - illumise + - roselia + - gulpin + - swalot + - carvanha + - sharpedo + - wailmer + - wailord + - numel + - camerupt + - torkoal + - spoink + - grumpig + - spinda + - trapinch + - vibrava + - flygon + - cacnea + - cacturne + - swablu + - altaria + - zangoose + - seviper + - lunatone + - solrock + - barboach + - whiscash + - corphish + - crawdaunt + - baltoy + - claydol + - lileep + - cradily + - anorith + - armaldo + - feebas + - milotic + - castform + - kecleon + - shuppet + - banette + - duskull + - dusclops + - tropius + - chimecho + - absol + - wynaut + - snorunt + - glalie + - spheal + - sealeo + - walrein + - clamperl + - huntail + - gorebyss + - relicanth + - luvdisc + - bagon + - shelgon + - salamence + - beldum + - metang + - metagross + - regirock + - regice + - registeel + - latias + - latios + - kyogre + - groudon + - rayquaza + - jirachi + - deoxys + - turtwig + - grotle + - torterra + - chimchar + - monferno + - infernape + - piplup + - prinplup + - empoleon + - starly + - staravia + - staraptor + - bidoof + - bibarel + - kricketot + - kricketune + - shinx + - luxio + - luxray + - budew + - roserade + - cranidos + - rampardos + - shieldon + - bastiodon + - burmy + - wormadam + - mothim + - combee + - vespiquen + - pachirisu + - buizel + - floatzel + - cherubi + - cherrim + - shellos + - gastrodon + - ambipom + - drifloon + - drifblim + - buneary + - lopunny + - mismagius + - honchkrow + - glameow + - purugly + - chingling + - stunky + - skuntank + - bronzor + - bronzong + - bonsly + - mimejr + - happiny + - chatot + - spiritomb + - gible + - gabite + - garchomp + - munchlax + - riolu + - lucario + - hippopotas + - hippowdon + - skorupi + - drapion + - croagunk + - toxicroak + - carnivine + - finneon + - lumineon + - mantyke + - snover + - abomasnow + - weavile + - magnezone + - lickilicky + - rhyperior + - tangrowth + - electivire + - magmortar + - togekiss + - yanmega + - leafeon + - glaceon + - gliscor + - mamoswine + - porygon-z + - gallade + - probopass + - dusknoir + - froslass + - rotom + - uxie + - mesprit + - azelf + - dialga + - palkia + - heatran + - regigigas + - giratina + - cresselia + - phione + - manaphy + - darkrai + - shaymin + - arceus + - victini + - snivy + - servine + - serperior + - tepig + - pignite + - emboar + - oshawott + - dewott + - samurott + - patrat + - watchog + - lillipup + - herdier + - stoutland + - purrloin + - liepard + - pansage + - simisage + - pansear + - simisear + - panpour + - simipour + - munna + - musharna + - pidove + - tranquill + - unfezant + - blitzle + - zebstrika + - roggenrola + - boldore + - gigalith + - woobat + - swoobat + - drilbur + - excadrill + - audino + - timburr + - gurdurr + - conkeldurr + - tympole + - palpitoad + - seismitoad + - throh + - sawk + - sewaddle + - swadloon + - leavanny + - venipede + - whirlipede + - scolipede + - cottonee + - whimsicott + - petilil + - lilligant + - basculin + - sandile + - krokorok + - krookodile + - darumaka + - darmanitan + - maractus + - dwebble + - crustle + - scraggy + - scrafty + - sigilyph + - yamask + - cofagrigus + - tirtouga + - carracosta + - archen + - archeops + - trubbish + - garbodor + - zorua + - zoroark + - minccino + - cinccino + - gothita + - gothorita + - gothitelle + - solosis + - duosion + - reuniclus + - ducklett + - swanna + - vanillite + - vanillish + - vanilluxe + - deerling + - sawsbuck + - emolga + - karrablast + - escavalier + - foongus + - amoonguss + - frillish + - jellicent + - alomomola + - joltik + - galvantula + - ferroseed + - ferrothorn + - klink + - klang + - klinklang + - tynamo + - eelektrik + - eelektross + - elgyem + - beheeyem + - litwick + - lampent + - chandelure + - axew + - fraxure + - haxorus + - cubchoo + - beartic + - cryogonal + - shelmet + - accelgor + - stunfisk + - mienfoo + - mienshao + - druddigon + - golett + - golurk + - pawniard + - bisharp + - bouffalant + - rufflet + - braviary + - vullaby + - mandibuzz + - heatmor + - durant + - deino + - zweilous + - hydreigon + - larvesta + - volcarona + - cobalion + - terrakion + - virizion + - tornadus + - thundurus + - reshiram + - zekrom + - landorus + - kyurem + - keldeo + - meloetta + - genesect + - chespin + - quilladin + - chesnaught + - fennekin + - braixen + - delphox + - froakie + - frogadier + - greninja + - bunnelby + - diggersby + - fletchling + - fletchinder + - talonflame + - scatterbug + - spewpa + - vivillon + - litleo + - pyroar + - flabebe + - floette + - florges + - skiddo + - gogoat + - pancham + - pangoro + - furfrou + - espurr + - meowstic + - honedge + - doublade + - aegislash + - spritzee + - aromatisse + - swirlix + - slurpuff + - inkay + - malamar + - binacle + - barbaracle + - skrelp + - dragalge + - clauncher + - clawitzer + - helioptile + - heliolisk + - tyrunt + - tyrantrum + - amaura + - aurorus + - sylveon + - hawlucha + - dedenne + - carbink + - goomy + - sliggoo + - goodra + - klefki + - phantump + - trevenant + - pumpkaboo + - gourgeist + - bergmite + - avalugg + - noibat + - noivern + - xerneas + - yveltal + - zygarde + - diancie + - hoopa + - volcanion + - rowlet + - dartrix + - decidueye + - litten + - torracat + - incineroar + - popplio + - brionne + - primarina + - pikipek + - trumbeak + - toucannon + - yungoos + - gumshoos + - grubbin + - charjabug + - vikavolt + - crabrawler + - crabominable + - oricorio + - cutiefly + - ribombee + - rockruff + - lycanroc + - wishiwashi + - mareanie + - toxapex + - mudbray + - mudsdale + - dewpider + - araquanid + - fomantis + - lurantis + - morelull + - shiinotic + - salandit + - salazzle + - stufful + - bewear + - bounsweet + - steenee + - tsareena + - comfey + - oranguru + - passimian + - wimpod + - golisopod + - sandygast + - palossand + - pyukumuku + - typenull + - silvally + - minior + - komala + - turtonator + - togedemaru + - mimikyu + - bruxish + - drampa + - dhelmise + - jangmo-o + - hakamo-o + - kommo-o + - tapukoko + - tapulele + - tapubulu + - tapufini + - cosmog + - cosmoem + - solgaleo + - lunala + - nihilego + - buzzwole + - pheromosa + - xurkitree + - celesteela + - kartana + - guzzlord + - necrozma + - magearna + - marshadow + - poipole + - naganadel + - stakataka + - blacephalon + - zeraora + - meltan + - melmetal + - grookey + - thwackey + - rillaboom + - scorbunny + - raboot + - cinderace + - sobble + - drizzile + - inteleon + - skwovet + - greedent + - rookidee + - corvisquire + - corviknight + - blipbug + - dottler + - orbeetle + - nickit + - thievul + - gossifleur + - eldegoss + - wooloo + - dubwool + - chewtle + - drednaw + - yamper + - boltund + - rolycoly + - carkol + - coalossal + - applin + - flapple + - appletun + - silicobra + - sandaconda + - cramorant + - arrokuda + - barraskewda + - toxel + - toxtricity + - sizzlipede + - centiskorch + - clobbopus + - grapploct + - sinistea + - polteageist + - hatenna + - hattrem + - hatterene + - impidimp + - morgrem + - grimmsnarl + - obstagoon + - perrserker + - cursola + - sirfetchd + - mrrime + - runerigus + - milcery + - alcremie + - falinks + - pincurchin + - snom + - frosmoth + - stonjourner + - eiscue + - indeedee + - morpeko + - cufant + - copperajah + - dracozolt + - arctozolt + - dracovish + - arctovish + - duraludon + - dreepy + - drakloak + - dragapult + - zacian + - zamazenta + - eternatus + - kubfu + - urshifu + - zarude + - regieleki + - regidrago + - glastrier + - spectrier + - calyrex + examples: + - ditto + - luxray + - snorlax diff --git a/docs/integrations/sources/pokeapi.md b/docs/integrations/sources/pokeapi.md index 797a58d71857..dd6605758c33 100644 --- a/docs/integrations/sources/pokeapi.md +++ b/docs/integrations/sources/pokeapi.md @@ -36,6 +36,8 @@ The PokéAPI uses the same [JSONSchema](https://json-schema.org/understanding-js | Version | Date | Pull Request | Subject | | :------ | :--------- | :------------------------------------------------------- | :---------------------------------------------- | +| 0.2.0 | 2023-10-02 | [30969](https://github.com/airbytehq/airbyte/pull/30969) | Migrated to Low code + | | 0.1.5 | 2022-05-18 | [12942](https://github.com/airbytehq/airbyte/pull/12942) | Fix example inputs | | 0.1.4 | 2021-12-07 | [8582](https://github.com/airbytehq/airbyte/pull/8582) | Update connector fields title/description | | 0.1.3 | 2021-12-03 | [8432](https://github.com/airbytehq/airbyte/pull/8432) | Migrate from base_python to CDK, add SAT tests. |