Welcome to Bitfinex Extractor to InfluxDB’s documentation!

Package

class DataSync

This is a class representation of an exchange scrapper that looks for configurations in a MYSQL server, extracts from Bitfinex Exchange candlesticks for the chosen pairs and time interval. It will retrieve from the beginning of the timeserie to nowadays and dump that information into INFLUXDB (Time Series Database).

Parameters
  • mysql_cursorpymysql.client.cursor cursor object for reading and writing from MYSQL.

  • pairs (list) –

    A list containing all pairs configuration.

    They must exist as rows in the pair table in MYSQL.

    You can check the available symbols for pairs here:

  • timeframes (list) –

    A list containing all timeframes configuration, run method will scrape one time series per each timeframe and pair.

    They must exist as rows in the timeframe table in MYSQL.

    Avaliable timeframes values: ‘1m’, ‘5m’, ‘15m’, ‘30m’, ‘1h’, ‘3h’, ‘6h’, ‘12h’, ‘1D’, ‘7D’, ‘14D’, ‘1M’

  • bucket (str) –

    InfluxDB Bucket name.

    Configured using the environemnt variable “INFLUX_BUCKET”

  • org (str) –

    InfluxDB organization name.

    Configured using the environemnt variable “INFLUX_ORG”

  • influx_client (InfluxDBClient) –

    InfluxDBClient InfluxDB API client.

    Configured using the environemnt variables “INFLUX_URL” and “INFLUX_TOKEN”

  • timeseries_start

    starting date for the timeseries to scrape.

    Configured using the environemnt variable “STARTING_YEAR”

  • logger (Logger) – Logger log handler.

query_pairs()

Query into MySQL’s pair table and return the values.

Returns

A list of pairs

Return type

list(str)

query_timeframes()

Query into MySQL’s timeframe table and return the values.

Returns

A list of timeframes

Return type

list(str)

run()

Extract time series from Bitfinex Exchange and store them into InfluxDB .

class DataSync

This is a class representation of an exchange scrapper that looks for configurations in a MYSQL server, extracts from Bitfinex Exchange candlesticks for the chosen pairs and time interval. It will retrieve from the beginning of the timeserie to nowadays and dump that information into INFLUXDB (Time Series Database).

Parameters
  • mysql_cursorpymysql.client.cursor cursor object for reading and writing from MYSQL.

  • pairs (list) –

    A list containing all pairs configuration.

    They must exist as rows in the pair table in MYSQL.

    You can check the available symbols for pairs here:

  • timeframes (list) –

    A list containing all timeframes configuration, run method will scrape one time series per each timeframe and pair.

    They must exist as rows in the timeframe table in MYSQL.

    Avaliable timeframes values: ‘1m’, ‘5m’, ‘15m’, ‘30m’, ‘1h’, ‘3h’, ‘6h’, ‘12h’, ‘1D’, ‘7D’, ‘14D’, ‘1M’

  • bucket (str) –

    InfluxDB Bucket name.

    Configured using the environemnt variable “INFLUX_BUCKET”

  • org (str) –

    InfluxDB organization name.

    Configured using the environemnt variable “INFLUX_ORG”

  • influx_client (InfluxDBClient) –

    InfluxDBClient InfluxDB API client.

    Configured using the environemnt variables “INFLUX_URL” and “INFLUX_TOKEN”

  • timeseries_start

    starting date for the timeseries to scrape.

    Configured using the environemnt variable “STARTING_YEAR”

  • logger (Logger) – Logger log handler.

query_pairs()

Query into MySQL’s pair table and return the values.

Returns

A list of pairs

Return type

list(str)

query_timeframes()

Query into MySQL’s timeframe table and return the values.

Returns

A list of timeframes

Return type

list(str)

run()

Extract time series from Bitfinex Exchange and store them into InfluxDB .