Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
importing libraries to quantopian (web ide)

Hi guys,

I have been reading a lot about web ide, which we can use to build algorithms and that there is no allowance to import third party modules or libraries. However for the purpose of test, I imported numpy and it seems it works. My question is, which libraries, can we use, is there any guidence? I would appreciate your reply. Thank you

5 responses

The third party module limitation is driven by our security needs. Since we let anyone run arbitrary python on our servers, we have to disallow libraries that could be used to hack our platform - os for instance. Many libraries add references to things like os, so we are careful about what we allow access to.

If you have a library you are interested in, let us know so that we can review it.

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 Dan, it would be useful if you allow users to import modules that are user-defined, but that do not use those potentially security-compromising libraries. For instance, it is possible traders composed their algorithms natively using a shell class:

class Equity(object):  
    ...  
    @property  
    def net_income(self):  
         ...  

This is useful because users can compose algorithms quickly using an interface they define, then plug in the Quantopian data API to implement such interface later. Having modules for these shell classes make notebooks code cleaner.

Hi Bao,

Thanks for the feedback. You're right that your workspace would be a lot cleaner if you could define your own modules and import them in Research and the IDE. This is actually a request that has been made by our own engineers as well and it's on our long-term roadmap. We don't have a timeline on when it will be done, but as someone who writes many examples in the community, I recognize the benefit that it will bring to the workflow on Q.

Thanks again for the suggestion. I'll mark this thread down internally so we can post an update here when we take on this project.

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.

From Quantopian's documentation:
* Research Whitelist
* Algorithm IDE Whitelist