Skip to main content

Demo library

Project description

Polygon Data

A library for fetching real-time forex data from polygon.io and store it into sqlite db.

The library has PolygonDataFetch class which has the main function of max code in the fetchData function of library.

It also includes ts_to_datetime(), reset_raw_data_tables(), initialize_raw_data_tables(), initialize_aggregated_tables(),

aggregate_raw_data_tables() functions which were the dependency for max christs main funtion.

Installation


pip install polygon_data

Dependency


polygon-api-client==0.2.11

sqlalchemy

math

datetime

time

Get started

How to fetch data with this lib?

(Note: Make sure you have a directory named sqlite at the root level)

from polygon_data import PolygonDataFetch



# Instantiate a PolygonDataFetch object

polygonDataFetch = PolygonDataFetch()



# A dictionary defining the set of currency pairs we will be pulling data for

currency_pairs = [["AUD","USD",[],portfolio("AUD","USD")],

                  ["GBP","EUR",[],portfolio("GBP","EUR")],

                  ["USD","CAD",[],portfolio("USD","CAD")],

                  ["USD","JPY",[],portfolio("USD","JPY")],

                  ["USD","MXN",[],portfolio("USD","MXN")],

                  ["EUR","USD",[],portfolio("EUR","USD")],

                  ["USD","CNY",[],portfolio("USD","CNY")],

                  ["USD","CZK",[],portfolio("USD","CZK")],

                  ["USD","PLN",[],portfolio("USD","PLN")],

                  ["USD","INR",[],portfolio("USD","INR")]]



# Call the fetchData method and pass currency_pairs dictionary as a parameter

polygonDataFetch.fetchData(currency_pairs = currency_pairs)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polygon-data-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polygon_data-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file polygon-data-0.1.0.tar.gz.

File metadata

  • Download URL: polygon-data-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for polygon-data-0.1.0.tar.gz
Algorithm Hash digest
SHA256 63af79b2a58a71736c6af08ccab2ae20cdff1b4842bafe70d7fa1fe3d4aa27e6
MD5 b818bdc608b931a50ab50e3eedd9b6ab
BLAKE2b-256 2ac25f9113bd11862711f98ac5875a1caa9a6701fff0313e9dee0c095a63eca7

See more details on using hashes here.

File details

Details for the file polygon_data-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: polygon_data-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for polygon_data-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4e38823112e8a1472fd1d11f453aabc84aea9158afd2543f8012c14ccd47b27
MD5 777041f7e38e577255ede0e70c5b4e4f
BLAKE2b-256 bd3ea17bcfdd997687050b620c927e8f0803069445559f9e2eaa47472df8cfc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page