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
#!/usr/bin/python | |
import smtplib | |
import requests | |
import traceback | |
from bs4 import BeautifulSoup | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText |
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
import requests | |
from bs4 import BeautifulSoup | |
def getWikipediaPageWithListOfStocks(): | |
r = requests.get('https://en.wikipedia.org/wiki/List_of_S%26P_500_companies') | |
if(r.status_code != 200): | |
return | |
return processDocument(r.text) |
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
import json | |
import requests | |
from dateutil.parser import parse | |
from dateutil.parser import parserinfo | |
from datetime import datetime | |
from datetime import timedelta | |
from bs4 import BeautifulSoup | |
def getNewsFromFinViz(ticker): |
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
import pylab | |
import numpy as np | |
# The function finds the probability of two people have the same | |
# birthday with the given number of people in the room | |
def findProbability(n): | |
x = [] # the x range of values to plot | |
y = [] # the y range of values to plot | |
p = 1 # the probability | |
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
#! usr/bin/python | |
""" | |
Plays the music in the directory specified | |
""" | |
import sys | |
from os import listdir, system | |
from os.path import isfile, isdir, join | |
def get_music_files(path): |
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
''' | |
Email Sender | |
''' | |
import smtplib | |
import traceback | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
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
# coding: utf-8 | |
''' | |
### Benefits of CD Ladder vs. Online Savings | |
Find the benefit of investing in a CD Ladder compared to the High Yield Online Savings account given some assumptions. | |
Assumptions: | |
* Investment in CD Ladder for various buckets; not the highest CD bucket rate available for the term. | |
* Only considers CD buckets that have the higher interest rate than the online savings account. | |
* Equal distribution into each selected bucket; based on the above assumptions. |
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
from multiprocessing.pool import Pool | |
import requests | |
import time | |
def page(symbol): | |
requests.get(url='https://finviz.com/quote.ashx?t=' + symbol) | |
start = time.time() | |
p = Pool() | |
p.map(page, ['AAPL', 'AMZN', 'GOOG', 'MSFT', 'FB']) |
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
import io | |
import json | |
import math | |
import requests | |
import pandas as pd | |
import datetime as dt | |
from os import makedirs | |
from os.path import isdir | |
from bs4 import BeautifulSoup | |
from itertools import compress |
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
import uuid | |
import json | |
max_count = 200 #982 # use sys.setrecursionlimit(1000) for higher limits | |
count = 0 | |
dd = { 'id': str(uuid.uuid4()), 'obj': None } | |
def objectOfObject(obj, count, max_count): | |
# print(obj) | |
obj['obj'] = { 'id': str(uuid.uuid4()) } |
OlderNewer