Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Get "Method Not Allowed" when trying to fetch csv from URL

Hi,

Im trying to fetch the following csv file into my algo:

csv_file= http://annfetcher.appspot.com/test.csv

with this code:

fetch_csv(csv_file, pre_func=preview, post_func=preview, date_column='date', date_format='%m/%d/%y', universe_func=my_universe)

When I run it I get the following error message:

"Error loading csv data from http://annfetcher.appspot.com/test.csv: 405 - Method Not Allowed"

the code works fine if i try fetching the csv from Dropbox.

Is there anything i am doing wrong, or can do in another way to fetch the file?

/Erik

2 responses

Hi Erik,

Fetcher requires the url to support GET and HEAD requests. Based on the url you are testing, looks like you are providing a service from app engine (super cool). That means you'll need to implement GET and HEAD in your service. Since retrieving the document in the browser works, the problem must be that HEAD is not implemented for the service.

thanks,
fawce

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi fawce,

Thank you for the reply!

ill try to implement HEAD in my app engine - and see how it works

/Erik