Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Davies justindavies

View GitHub Profile
@justindavies
justindavies / doc2vec.py
Created Jun 11, 2017
Create doc2vec model from data
View doc2vec.py
from gensim.models.doc2vec import LabeledSentence
from os import listdir
from os.path import isfile, join
import gensim
import DocIterator as DocIt
import MySQLdb
docLabels = []
data = []
View get_tweets.py
import tweepy
from tweepy import Stream
from tweepy.streaming import StreamListener
import sys
from newspaper import Article
from time import mktime
auth = tweepy.OAuthHandler("XXXXXXXXXXXX")
auth.set_access_token("XXXXXXXXXXXX")
@justindavies
justindavies / import_candles.py
Created Jun 5, 2017
Import NASDAQ stocks from Quandl EOD data
View import_candles.py
import pymongo
from pymongo import MongoClient
import csv
import urllib2
import sys
import os.path
from datetime import datetime, timedelta
QUANDL_API_KEY = "YOUR_API_KEY"
@justindavies
justindavies / import_nyse_companies.py
Created Jun 5, 2017
Import NASDAQ companies data into Mongo or Cosmos DB
View import_nyse_companies.py
import pymongo
from pymongo import MongoClient
import urllib2
import csv
# Are we using development or Production ?
# uri = "mongodb://USERNAME:PASSWORD@INSTANCE.documents.azure.com:10255/?ssl=true&replicaSet=globaldb"