Back to Community
Newbie with zipline

I am using jupyter for zipline :
%%zipline --start 2000-1-1 --end 2014-1-1 --bundle my-yahoo-equities-bundle gives
UnknownBundle: No bundle registered with the name 'my-yahoo-equities-bundle'

Is there no option --bundle on zipline ? How do I specify my data bundle ?
With no --bundle option it works with the default "quantopian-quandl 2016-08-04 00:09:42.171731"
Thanx - balu raman

2 responses

This worked for me running jupyter in a virtualenv, but you might have to adjust it for your situation.
Before you import zipline, in a new jupyter cell enter:

from zipline.data.bundles import register  
from zipline.data.bundles.yahoo import yahoo_equities  
register(  
    'my-yahoo-equities-bundle',  
    yahoo_equities({}),  
)

This assumes that you have ingested your bundle outside of jupyter.
I cant explain why the jupyter %%zipline magic command doesnt seem to read or process .zipline/extensions.py .

Richard

I get the exact same error trying to ingest the CSVDIR bundle. Richard Prokopyshen wrote an excellent article on this subject, but I think he wrote it prior to the publication of CSVDIR, didn't you Richard?

As I understand it, CSVDIR is supposed to be an easier way to ingest data into zipline from a CSV file, so with respects to Richard who offered an alternative to CSVDIR, I'm hoping to take the CSVDIR approach, but I'm not a contributor to the zipline project, so unlike all the people who are close to the code, I can't easily get an idea how to make this work by digging down into the source or by reading Github threads that assume a lot of prior knowledge.

Following the instructions in the Zipline docset, I added the following code to the extension.py file:

from zipline.data.bundles import register  
from zipline.data.bundles.csvdir import csvdir_equities

import pandas as pd

start_session = pd.Timestamp('2016-1-1', tz='utc')  
end_session = pd.Timestamp('2018-1-1', tz='utc')

register (  
    'custom-csvdir-bundle',  
    csvdir_equities (  
        ['daily'],  
        'G:\DATA\csvdir'  
    ),  
    calendar_name=None,  
    start_session=start_session,  
    end_session=end_session  
)

But I get the following errors:

No module named 'zipline.data.bundles.csvdir'

Error: No bundle registered with the name 'custom-csvdir-bundle'

I've updated zipline in the conda environment where I have it installed. Why am I told that there is "No module named 'zipline.data.bundles.csvdir'"?

I am doing this on Windows 10.