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
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 |
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 re | |
from nltk.corpus import stopwords | |
Small = { | |
'zero': 0, | |
'one': 1, | |
'two': 2, | |
'three': 3, | |
'four': 4, |
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 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) |
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
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" |
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
def cryptoprices(pair): | |
from poloniex import Poloniex | |
apiKey = "" | |
secret = "" | |
polo = Poloniex(apiKey, secret) | |
market_data = polo.returnTicker()[pair] | |
bid = market_data["highestBid"] |
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 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 |
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 pandas as pd | |
import io | |
import requests | |
import time | |
def google_stocks(symbol, startdate=(1, 1, 2005), enddate=None): | |
startdate = str(startdate[0]) + '+' + str(startdate[1]) + '+' + str(startdate[2]) | |
if not enddate: |
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
def stocktrack(stock,buysell,qty): | |
import sqlite3 | |
from yahoo_finance import Share | |
conn = sqlite3.connect('Stocks.db') | |
c = conn.cursor() | |
c.execute('''CREATE TABLE IF NOT EXISTS stocks | |
(date text, trans text, symbol text, qty real, price real, total real)''') |
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 lxml import html | |
import csv, os, json | |
import requests | |
#from exceptions import ValueError | |
from time import sleep | |
def AmzonParser(url): | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'} |
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 _mssql | |
# Connect to the SQL Server Database | |
conn = _mssql.connect(server='Servernamehere', user='serverusername', password='serverpassword', \ | |
database='databasename') | |
# Run The Select Query against the Database | |
conn.execute_query('SELECT TOP 10 [Item ID],[Custom Label],[Quantity Available] FROM [bsusa_active_staging]') | |
# Create the Lists |
NewerOlder