Skip to content

Commit

Permalink
🎉 New Source: Newsdata [low-code CDK] (#18576)
Browse files Browse the repository at this point in the history
* Initial Newsdata source connector implementation

* Update docs, source_definitions and upload icon

* Set single input for `sources` stream

* Remove unused definition

* Update `spec.yaml` config

* Support Pagination

* Remove `is_free_tier`, because as of now, dynamic `page_size` is not supported

* auto-bump connector version

Co-authored-by: Octavia Squidington III <[email protected]>
Co-authored-by: Marcos Marx <[email protected]>
  • Loading branch information
3 people authored and akashkulk committed Nov 17, 2022
1 parent 1439a07 commit cb86da5
Show file tree
Hide file tree
Showing 27 changed files with 1,022 additions and 0 deletions.
89 changes: 89 additions & 0 deletions airbyte-config/init/src/main/resources/icons/newsdata.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,13 @@
documentationUrl: https://docs.airbyte.com/integrations/sources/news-api
sourceType: api
releaseStage: alpha
- name: Newsdata
sourceDefinitionId: 60bd11d8-2632-4daa-a688-b47336d32093
dockerRepository: airbyte/source-newsdata
dockerImageTag: 0.1.0
documentationUrl: https://docs.airbyte.com/integrations/sources/newsdata
sourceType: api
releaseStage: alpha
- name: Notion
sourceDefinitionId: 6e00b415-b02e-4160-bf02-58176a0ae687
dockerRepository: airbyte/source-notion
Expand Down
205 changes: 205 additions & 0 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8924,6 +8924,211 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-newsdata:0.1.0"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/newsdata"
connectionSpecification:
$schema: "http://json-schema.org/draft-07/schema#"
title: "Newsdata Spec"
type: "object"
required:
- "api_key"
additionalProperties: true
properties:
api_key:
type: "string"
description: "API Key"
airbyte_secret: true
order: 0
OneOf:
query:
type: "string"
description: "Keywords or phrases to search for in the news title and\
\ content. Advanced Search options:\n - Search `Social`: query = \"\
social\"\n - Search `Social Pizza`: query = \"social pizza\"\n - Search\
\ `Social` but not with `pizza`: query = \"social -pizza\"\n - Search\
\ `Social` but not with `pizza` and `wildfire`: query = \"social -pizza\
\ -wildfire\"\n - Search `Social` and `pizza`: query = \"social AND\
\ pizza\"\n - Search `Social` and `pizza` and `pasta`: query = \"social\
\ AND pizza AND pasta\"\n - Search `Social` or `pizza`: query = \"\
social OR pizza\"\n - Search `Social` or `pizza` but not `pasta`: query\
\ = \"social OR pizza -pasta\"\n - Search `Social` or `pizza` or `pasta`:\
\ query = \"social OR pizza OR pasta\"\nNote: You can't use AND and\
\ OR in the same query."
order: 1
query_in_title:
type: "string"
description: "Same as `query`, but restricting the search to only the\
\ news title. It cannot be used along with `query`."
order: 1
domain:
type: "array"
description: "Domains (maximum 5) to restrict the search to. Use the sources\
\ stream to find top sources id."
maxitems: 5
items:
type: "string"
order: 2
country:
type: "array"
description: "2-letter ISO 3166-1 countries (maximum 5) to restrict the\
\ search to."
maxitems: 5
order: 3
items:
type: "string"
enum:
- "ar"
- "au"
- "at"
- "bd"
- "by"
- "be"
- "br"
- "bg"
- "ca"
- "cl"
- "cn"
- "co"
- "cr"
- "cu"
- "cz"
- "dk"
- "do"
- "ec"
- "eg"
- "ee"
- "et"
- "fi"
- "fr"
- "de"
- "gr"
- "hk"
- "hu"
- "in"
- "id"
- "iq"
- "ie"
- "il"
- "it"
- "jp"
- "kz"
- "kw"
- "lv"
- "lb"
- "lt"
- "my"
- "mx"
- "ma"
- "mm"
- "nl"
- "nz"
- "ng"
- "kp"
- "no"
- "pk"
- "pe"
- "ph"
- "pl"
- "pt"
- "pr"
- "ro"
- "ru"
- "sa"
- "rs"
- "sg"
- "sk"
- "si"
- "za"
- "kr"
- "es"
- "se"
- "ch"
- "tw"
- "tz"
- "th"
- "tr"
- "ua"
- "ae"
- "gb"
- "us"
- "ve"
- "vi"
category:
type: "array"
description: "Categories (maximum 5) to restrict the search to."
maxitems: 5
order: 4
items:
type: "string"
enum:
- "business"
- "entertainment"
- "environment"
- "food"
- "health"
- "politics"
- "science"
- "sports"
- "technology"
- "top"
- "world"
language:
type: "array"
description: "Languages (maximum 5) to restrict the search to."
maxitems: 5
order: 5
items:
type: "string"
enum:
- "be"
- "am"
- "ar"
- "bn"
- "bs"
- "bg"
- "my"
- "ckb"
- "zh"
- "hr"
- "cs"
- "da"
- "nl"
- "en"
- "et"
- "fi"
- "fr"
- "de"
- "el"
- "he"
- "hi"
- "hu"
- "in"
- "it"
- "jp"
- "ko"
- "lv"
- "lt"
- "ms"
- "no"
- "pl"
- "pt"
- "ro"
- "ru"
- "sr"
- "sk"
- "sl"
- "es"
- "sw"
- "sv"
- "th"
- "tr"
- "uk"
- "ur"
- "vi"
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-notion:0.1.10"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/notion"
Expand Down
6 changes: 6 additions & 0 deletions airbyte-integrations/connectors/source-newsdata/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*
!Dockerfile
!main.py
!source_newsdata
!setup.py
!secrets
38 changes: 38 additions & 0 deletions airbyte-integrations/connectors/source-newsdata/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM python:3.9.11-alpine3.15 as base

# 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 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 source_newsdata ./source_newsdata

ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.0
LABEL io.airbyte.name=airbyte/source-newsdata
Loading

0 comments on commit cb86da5

Please sign in to comment.