API

quantopian

A collection of functions for automating actions on the Quantopian platform.

quantopian.__author__ = u'Gitlit Team'

Author

quantopian.__author_email__ = u'support@gitlit.io'

Author Email

quantopian.__license__ = u'BSD'

License

quantopian.__maintainer__ = u'Derek Miller'

Maintainer

quantopian.__maintainer_email__ = u'derek@gitlit.io'

Maintainer Email

quantopian.__pkg_name__ = u'quantopian'

Package Name

quantopian.__project_description__ = u'A collection of functions for automating actions on the Quantopian platform.'

Project Description

quantopian.__project_name__ = u'Quantopian API'

Project Name

quantopian.__project_url__ = u'https://github.com/Gitlitio/quantopian-api'

Project URL

quantopian.__release_date__ = u'09/03/2016'

Release Date

quantopian.__version__ = u'0.0.1a0'

Version

quantopian.algorithms

quantopian.backtests

quantopian.exceptions

Sessions handle the details of authentication and transporting requests.

quantopian.helpers

quantopian.schema

class quantopian.schema.CustomValidator(*args, **kwargs)[source]

Bases: cerberus.validator.Validator

Validator class. Normalizes and/or validates any mapping against a validation-schema which is provided as an argument at class instantiation or upon calling the validate(), validated() or normalized() method. An instance itself is callable and executes a validation.

All instantiation parameters are optional.

There are the introspective properties types, validators, coercers, default_setters, rules, normalization_rules and validation_rules.

The attributes reflecting the available rules are assembled considering constraints that are defined in the docstrings of rules’ methods and is effectively used as validation schema for schema.

Parameters:
  • schema (any mapping) – See schema. Defaults to None.
  • ignore_none_values (bool) – See ignore_none_values. Defaults to False.
  • allow_unknown (bool or any mapping) – See allow_unknown. Defaults to False.
  • purge_unknown (bool) – See purge_unknown. Defaults to to False.
  • error_handler (class or instance based on BaseErrorHandler or tuple) – The error handler that formats the result of errors. When given as two-value tuple with an error-handler class and a dictionary, the latter is passed to the initialization of the error handler. Default: BasicErrorHandler.

quantopian.securities

quantopian.securities.lookup_sid(sid)[source]

Lookup a security by id.

>>> lookup_sid(45149)
{u'symbol': u'HTBX', u'name': u'HEAT BIOLOGICS INC', u'sid': 45149}
>>> lookup_sid(1111111)  # Returns None of no security is found
Parameters:

sid (int) – Security id.

Returns:

A dictionary containing the security’s name, sid, and symbol or None if no security is found.

Return type:

dict

Raises:
  • quantopian.exceptions.RequestError – If the request to the quantopian server failed.
  • quantopian.exceptions.ResponseValidationError – If the response from the quantopian server is not of the format expected.

quantopian.session

Sessions handle the details of authentication and transporting requests.

quantopian.settings

Settings for the project. All settings can be configured in the environment.