Skip to content

Instantly share code, notes, and snippets.

View justindavies's full-sized avatar

Justin Davies justindavies

View GitHub Profile
@justindavies
justindavies / doc2vec.py
Created June 11, 2017 14:11
Create doc2vec model from data
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 = []
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 June 5, 2017 12:17
Import NASDAQ stocks from Quandl EOD data
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 June 5, 2017 11:46
Import NASDAQ companies data into Mongo or Cosmos DB
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"