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
start_session = pd.Timestamp('2017-01-02', tz='utc') | |
end_session = pd.Timestamp('2017-12-29', tz='utc') | |
# register the bundle | |
register( | |
'eu_stocks', # name we select for the bundle | |
csvdir_equities( | |
# name of the directory as specified above (named after data frequency) | |
['daily'], | |
# path to directory containing the |
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 twitter | |
# initialize api instance | |
twitter_api = twitter.Api(consumer_key='YOUR_CONSUMER_KEY', | |
consumer_secret='YOUR_CONSUMER_SECRET', | |
access_token_key='YOUR_ACCESS_TOKEN_KEY', | |
access_token_secret='YOUR_ACCESS_TOKEN_SECRET') | |
# test authentication | |
print(twitter_api.VerifyCredentials()) |
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
# Reference: https://svds.com/jupyter-notebook-best-practices-for-data-science/ | |
import os | |
from subprocess import check_call | |
def post_save(model, os_path, contents_manager): | |
"""post-save hook for converting notebooks to .py scripts""" | |
if model['type'] != 'notebook': | |
return # only do this for notebooks | |
d, fname = os.path.split(os_path) | |
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d) |