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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polygon-data-0.1.1.tar.gz.
File metadata
- Download URL: polygon-data-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7812b348c0f7a46fd51bfb1d235aa1421cdefd3e6a71e7898eed26bc1242a56
|
|
| MD5 |
dfff3e281eabdf4fb7b2ce33740a49d7
|
|
| BLAKE2b-256 |
cf0cd189dca2d2b54cf31e6c177c1c18c1772db668d9a2fb22cfb09dc5e445e6
|
File details
Details for the file polygon_data-0.1.1-py3-none-any.whl.
File metadata
- Download URL: polygon_data-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fd55a8c9435cf59c152ff17f393751e2f387ad15108c180f31d1b7d2d7d7e4e
|
|
| MD5 |
3c96df231ef80feac37ad7b9c732c503
|
|
| BLAKE2b-256 |
6a82619271ef89a6b6744fc1bad54edeeb2d0373a32942c1700e40d53a8f61f6
|