-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💼 feat(data): unemployment rate 💼 (#91)
* progress * changes * remove unnecessary code * endpoint update * remove get_endpoint * add unrate * add to workflows * flake * forgot to add workflow * fix test
- Loading branch information
Showing
10 changed files
with
277 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This workflow will automatically update data files | ||
# For more information see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule | ||
|
||
name: Unemployment | ||
|
||
on: | ||
schedule: | ||
- cron: "0 8 15 * *" | ||
# 3:00am EST | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Cache pip dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Update unemployment | ||
env: | ||
BLS: ${{ secrets.BLS }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
S3_BUCKET: ${{ secrets.S3_BUCKET }} | ||
run: python scripts/update_unrate.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import sys | ||
sys.path.append('src') | ||
from DataSource import LaborStats # noqa | ||
|
||
bls = LaborStats() | ||
bls.save_unemployment_rate(timeframe='2y') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import sys | ||
sys.path.append('src') | ||
from Storage import Store # noqa autopep8 | ||
from DataSource import Polygon # noqa autopep8 | ||
|
||
|
||
store = Store() | ||
poly = Polygon() | ||
|
||
|
||
# to_download = ['DOW', 'DUK', 'FOX', | ||
# 'GD', 'GE', 'GILD', 'GLD', 'GM'] | ||
to_download = ['HD', 'INSG'] | ||
|
||
# symbols = ['VTRS', 'IAC', 'CTVA', 'CARR', 'OTIS', 'HWM', 'GOOG'] | ||
# s3://hyperdrive.pro/data/intraday/polygon/ | ||
symbols = ['IBM', 'ICLN', 'INO', 'INTC', | ||
'IPO', 'IQ', 'ISRG'] | ||
# F, G, H, I | ||
if __name__ == '__main__': | ||
# for symbol in symbols: | ||
# store.upload_dir(path=f'data/intraday/polygon/{symbol}') | ||
store.upload_dir(path='data/intraday/polygon') | ||
for symbol in symbols: | ||
store.upload_dir(path=f'data/intraday/polygon/{symbol}') | ||
poly.save_intraday( | ||
symbol=symbol, | ||
timeframe='30d', | ||
retries=1 | ||
) | ||
for symbol in to_download: | ||
poly.save_intraday( | ||
symbol=symbol, | ||
timeframe='6250d', | ||
retries=1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.