- Go to: 'System Preferences' >> 'MySQL' and stop MySQL
OR,
- sudo /usr/local/mysql/support-files/mysql.server start
- sudo /usr/local/mysql/support-files/mysql.server stop
| from urllib.parse import urlsplit | |
| import advertools as adv | |
| sites = [ | |
| 'https://www.who.int', | |
| 'https://www.nytimes.com', | |
| 'https://www.washingtonpost.com', | |
| ] |
| # Import packages | |
| import yfinance as yf | |
| import pandas as pd | |
| # Read and print the stock tickers that make up S&P500 | |
| tickers = pd.read_html( | |
| 'https://en.wikipedia.org/wiki/List_of_S%26P_500_companies')[0] | |
| print(tickers.head()) | |
| # Get the data for this tickers from yahoo finance |
The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.
You'll need the packages
| import numpy as np | |
| import warnings | |
| from pandas_datareader import data as pdr | |
| import yfinance as yf | |
| import datetime as dt | |
| from yahoo_fin import stock_info as si | |
| import pandas as pd | |
| pd.set_option('display.max_rows', None) | |
| warnings.filterwarnings("ignore") | |
| yf.pdr_override() |
| import pandas as pd | |
| import numpy as np | |
| from bs4 import BeautifulSoup as soup | |
| from urllib.request import Request, urlopen | |
| pd.set_option('display.max_colwidth', 25) | |
| # Input | |
| symbol = input('Enter a ticker: ') | |
| print ('Getting data for ' + symbol + '...\n') |
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask_httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
| # Terminal Cheat Sheet | |
| pwd # print working directory | |
| ls # list files in directory | |
| cd # change directory | |
| ~ # home directory | |
| .. # up one directory | |
| - # previous working directory | |
| help # get help | |
| -h # get help |