Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Unable to fetch CSV, my_universe doesn't seem to be called

I'm trying to fetch securities from an external CSV, following examples here on forum, but something doesn't seem to work as intended. The code fails with error "AttributeError: 'str' object has no attribute 'start_date'" on the last line. Logs don't contain output from my_universe, however have "WARN Dropped 2838 rows from fetched csv." (which is the number of lines in the CSV).

# Called once at the start of the simulation.  
def initialize(context):  
    fetch_csv('https://docs.google.com/spreadsheets/d/1oMHOIy1qus83dy7g2vHNjbFqQ2Da6AWk63P8Xd7MIGY/export?format=csv', universe_func=(my_universe), decimal=',', quotechar='"')

# Function for returning a set of SIDs from fetcher_data  
def my_universe(context, fetcher_data):  
    print 'Hello, world'  
    sids = set(fetcher_data['sid'])  
    symbols = [s.symbol for s in sids]  
    context.count = len(symbols)  
    print "total universe size: {c}".format(c=context.count)  
    return sids  

# Called every minute of the simulation.  
def handle_data(context, data):  
    if 'price' in data['R:AKCII']:  
        record(data['R:AKCII'].price)  
3 responses

I'm having the same problem, and I've noticed that universe_func is no longer mentioned in the Fetcher help section. Has this feature been removed?

I have the same problem too. Is there answer to this thread?

I have the same problem, the algo don´t recognize the my_universe parameter from the fetch_csv method.

Maybe as Arthur mentioned above, the parameter was removed

any help??