Skip to content

Pull and Clean Tickers and Make Trie Autocomplete #22

Pull and Clean Tickers and Make Trie Autocomplete

Pull and Clean Tickers and Make Trie Autocomplete #22

Workflow file for this run

name: Pull and Clean Tickers and Make Trie Autocomplete
on:
schedule:
- cron: '20 7 * * 0' # Runs every Sunday at 12:20 AM PST
workflow_dispatch: # Enable manual trigger
jobs:
update-tickers-and-clean-datasets-and-make-trie-pickle:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Pull NYSE tickers
run: |
wget https://raw.githubusercontent.com/rreichel3/US-Stock-Symbols/main/nyse/nyse_tickers.txt -O nyse_tickers.txt
- name: Pull NASDAQ tickers
run: |
wget https://raw.githubusercontent.com/rreichel3/US-Stock-Symbols/main/nasdaq/nasdaq_tickers.txt -O nasdaq_tickers.txt
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
- name: Clean tickers and retrieve market caps
run: |
python StockTickers/clean_datasets.py nyse_tickers.txt
python StockTickers/clean_datasets.py nasdaq_tickers.txt
- name: Create Trie for autocomplete of tickers
run: |
cd FlaskApp
python create_Trie.py
cd ..
- name: Add and commit cleaned dataset CSVs and Trie
run: |
git config --global user.email "jpnewman167@gmail.com"
git config --global user.name "JNewman-cell"
git pull origin main
git add StockTickers/nyse_tickers_cleaned.csv StockTickers/nasdaq_tickers_cleaned.csv FlaskApp/trie.pkl
git commit -m "Add cleaned dataset CSVs and Trie pickle"
git push origin main