airbyte-custom-connector/source-crypto-market-extractor
Alexis Pentori 067652009e
crypto-market-extractor: Failsafe API
Signed-off-by: Alexis Pentori <alexis@status.im>
2024-02-09 11:10:48 +01:00
..
sample_files crypto-market-extractor: Failsafe API 2024-02-09 11:10:48 +01:00
source_crypto_market_extractor crypto-market-extractor: Failsafe API 2024-02-09 11:10:48 +01:00
Dockerfile source-crypto-market-extractor: init new connector 2024-01-12 19:16:53 +01:00
README.md crypto-market-extractor: Failsafe API 2024-02-09 11:10:48 +01:00
main.py source-crypto-market-extractor: init new connector 2024-01-12 19:16:53 +01:00
metadata.yaml crypto-market-extractor: Failsafe API 2024-02-09 11:10:48 +01:00
requirements.txt source-crypto-market-extractor: init new connector 2024-01-12 19:16:53 +01:00
setup.py source-crypto-market-extractor: init new connector 2024-01-12 19:16:53 +01:00

README.md

Crypto Market Extractor Source

This is the repository for the Crypto Market Extractor source connector, written in Python.

Usage

This connector fetch coins value on API.

The Supported API:

  • CoinGecko

Configuration

The connector takes the following input:

coins:
  type: array
  name: coins
  description: List of coin to fetch the price. List available at coingecko api under `/coins/list`
  items:
    type: string

Output

This connector will return a list of coin for each chain with the following models

  • name: Name of the coin.
  • price: Price in USD of the coin
  • date: Date of the sync.

Local development

Prerequisites

Activate Virtual Environment and install dependencies

From this connector directory, create a virtual environment:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Locally running the connector

python main.py spec
python main.py check --config sample_files/config-example.json
python main.py discover --config sample_files/config-example.json
python main.py read --config sample_files/config-example.json --catalog sample_files/configured_catalog.json

Locally running the connector docker image

docker build -t airbyte/crypto-market-extractor:dev .
# Running the spec command against your patched connector
docker run airbyte/crypto-market-extractor:dev spec

Run

Then run any of the connector commands as follows:

docker run --rm airbyte/crypto-market-extractor:dev spec
docker run --rm -v $(pwd)/sample_files:/sample_files airbyte/crypto-market-extractor:dev check --config /sample_files/coin_list.json
docker run --rm -v $(pwd)/sample_files:/sample_files airbyte/crypto-market-extractor:dev discover --config /sample_files/coin_list.json
docker run --rm -v $(pwd)/sample_files:/sample_files -v $(pwd)/sample_files:/sample_files airbyte/crypto-market-extractor:dev read --config /sample_files/coin_list.json --catalog /sample_files/configured_catalog.json