Requesting CSVDIR help from Ed Bartosh

92 views
Skip to first unread message

Apoorv Vishnoi

unread,
Oct 30, 2017, 7:15:11 AM10/30/17
to Zipline Python Opensource Backtester
Requesting help from Ed regarding CSVDIR. Help from anyone else is also more than welcome.

I have tried using CSVDIR for several hours, trying different things reading from past posts but nothing seems to work.

Here is what I have done:
Step 1: Created environment variable  
CSVDIR=C:\csvdir
created folders daily and monthly in folder csvdir and added the attached file to the hourly folder

Step 2: Created the file csvdir.py in the following folder:
C:\Users\Apoorv\Miniconda3\envs\35\Lib\site-packages\zipline\data\bundles

Step 3: Added zipline ingest -b csvdir in conda prompt and got the following error:
C:\Users\Apoorv\Miniconda3\envs\35\lib\site-packages\zipline\__main__.py:50: UserWarning: Failed to load extension: 'C:\\Users\\Apoorv/.zipline\\extension.py'
cannot import name 'csvdir_equities'
  os.environ,
Error: No bundle registered with the name 'csvdir'

Looking forward to hear from you.
Apoorv
ADANIPORTS.csv

Ed Bartosh

unread,
Oct 30, 2017, 7:29:09 AM10/30/17
to Apoorv Vishnoi, Zipline Python Opensource Backtester
Hi Apoorv,

It's hard to say what's the reason without seeing the code. 

Can you show your extension.py please?

created folders daily and monthly in folder csvdir and added the attached file to the hourly folder
csvdir supports only daily and minute time frames. 
I'd suggest to take recent version from csvdir branch. It's under review now and hopefully will be merged into zipline codebase soon.

cannot import name 'csvdir_equities'
Can you show me the output of this command: python -c 'from zipline.data.bundles.csvdir import csvdir_equities'

Regards,
Ed



--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
BR,
Ed

Apoorv Vishnoi

unread,
Oct 30, 2017, 9:53:15 AM10/30/17
to Zipline Python Opensource Backtester

Hi Ed,

First of all thanks a lot for your prompt reply.

Can you show your extension.py please?
Please find attached.
 
created folders daily and monthly in folder csvdir and added the attached file to the hourly folder
csvdir supports only daily and minute time frames. 
Yes, I have added the daily values csv to the daily folder and left the minute folder blank for the time being.  

I'd suggest to take recent version from csvdir branch. It's under review now and hopefully will be merged into zipline codebase soon.
I have tried with the recent version as well, but unfortunately, I am getting the same error.  

cannot import name 'csvdir_equities'
Can you show me the output of this command: python -c 'from zipline.data.bundles.csvdir import csvdir_equities'
This is actually working on python console. There is no error. upon importing when I enter csvdir_equities I get:  <function zipline.data.bundles.csvdir.csvdir_equities>


Thanks again
Apoorv
 





2017-10-30 13:15 GMT+02:00 Apoorv Vishnoi <vishnoi...@gmail.com>:
Requesting help from Ed regarding CSVDIR. Help from anyone else is also more than welcome.

I have tried using CSVDIR for several hours, trying different things reading from past posts but nothing seems to work.

Here is what I have done:
Step 1: Created environment variable  
CSVDIR=C:\csvdir
created folders daily and monthly in folder csvdir and added the attached file to the hourly folder

Step 2: Created the file csvdir.py in the following folder:
C:\Users\Apoorv\Miniconda3\envs\35\Lib\site-packages\zipline\data\bundles

Step 3: Added zipline ingest -b csvdir in conda prompt and got the following error:
C:\Users\Apoorv\Miniconda3\envs\35\lib\site-packages\zipline\__main__.py:50: UserWarning: Failed to load extension: 'C:\\Users\\Apoorv/.zipline\\extension.py'
cannot import name 'csvdir_equities'
  os.environ,
Error: No bundle registered with the name 'csvdir'

Looking forward to hear from you.
Apoorv

--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
BR,
Ed
extension.py

Ed Bartosh

unread,
Oct 30, 2017, 11:35:30 AM10/30/17
to Apoorv Vishnoi, Zipline Python Opensource Backtester
Hi Apoorv,

It looks like your extension.py imports csvdir_equities from incorrect location:
from zipline.data.bundles import csvdir_equities, register
it should be:
from zipline.data.bundles import register
from zipline.data.bundles.csvdir import csvdir_equities


Regards,
Ed
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
BR,
Ed

Apoorv Vishnoi

unread,
Oct 30, 2017, 12:19:02 PM10/30/17
to Zipline Python Opensource Backtester
Gosh..... that worked. I can see csvdir 2017-10-30 15:49:57.007856 now on typing zipline bundles
Thanks a lot Ed. You are awesome.

Regards
Apoorv 
Reply all
Reply to author
Forward
0 new messages