Skip to content

Instantly share code, notes, and snippets.

View clintmjohnson's full-sized avatar

Clint Johnson clintmjohnson

View GitHub Profile
@clintmjohnson
clintmjohnson / Historic_Stock_Download
Created October 10, 2017 22:33
This Function downloads Historic stock prices for a Symbol, and Saves them to CSV file, using Pandas and Yahoo finance API
"""
This function combines data from Pandas data on stocks, and the Yahoo Finance API
"""
def stockhistory(stock2check):
import pandas_datareader.data as web
import datetime
from yahoo_finance import Share
stock = Share(stock2check)
ylp = stock.get_year_low() # Returns the Year Low price for the stock
@clintmjohnson
clintmjohnson / poloniex_crypto_watch.py
Last active October 11, 2017 18:52
Crypto Currency watch with Poloniex
def cryptoprices(pair):
from poloniex import Poloniex
apiKey = ""
secret = ""
polo = Poloniex(apiKey, secret)
market_data = polo.returnTicker()[pair]
bid = market_data["highestBid"]
@clintmjohnson
clintmjohnson / google_vision.py
Created October 17, 2017 21:17
This Python program connects to Google Vision API, to identify Images
def google_vision():
import io
import os
from google.cloud import vision
from google.cloud.vision import types
#https://cloud.google.com/vision/docs/auth
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "Path to Application default credentials JSON ADC"
@clintmjohnson
clintmjohnson / textblob.py
Created October 18, 2017 19:46
TextBlob Sample Usage
from textblob import TextBlob
text = """TextBlob aims to provide access to common text-processing operations through a familiar interface. /
You can treat TextBlob objects as if they were Python strengs that learned how to do Natural Language Processing."""
#"This is bad " = Sentiment Sentiment(polarity=-0.6999999999999998, subjectivity=0.6666666666666666)
#"This is Good" = Sentiment Sentiment(polarity=0.7, subjectivity=0.6000000000000001)
blob = TextBlob(text)
@clintmjohnson
clintmjohnson / wordtonumber.py
Created October 19, 2017 20:20
Convert Word numbers to Integer numbers
import re
from nltk.corpus import stopwords
Small = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
@clintmjohnson
clintmjohnson / binancealerts.py
Created January 10, 2018 02:34
Send Crypto Currency price Alerts via Text, using Binance API
def alertonlow():
""" This Program uses the Binance API to Send Text Alerts for Price Action. Right now it's set up to
send a Text Alert, when any Crypto Coin is Less than or Equal to 2% of the 24HR Low """
from binance.client import Client
from twilio.rest import Client as twilioclient
twilioclientsid = '' # Twilio User ID
twilioclienttok = '' # Twilio User Token