API

quantopian_tools

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

quantopian_tools.__author__ = u'Gitlit Team'

Author

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

Author Email

quantopian_tools.__license__ = u'BSD'

License

quantopian_tools.__maintainer__ = u'Derek Miller'

Maintainer

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

Maintainer Email

quantopian_tools.__pkg_name__ = u'quantopian-tools'

Package Name

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

Project Description

quantopian_tools.__project_name__ = u'Quantopian Tools'

Project Name

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

Project URL

quantopian_tools.__release_date__ = u'09/10/2016'

Release Date

quantopian_tools.__version__ = u'0.0.1a0'

Version

quantopian_tools.algorithms

quantopian_tools.backtests

quantopian_tools.exceptions

Sessions handle the details of authentication and transporting requests.

quantopian_tools.helpers

quantopian_tools.schema

class quantopian_tools.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_tools.securities

quantopian_tools.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_tools.exceptions.RequestError – If the request to the quantopian_tools server failed.
  • quantopian_tools.exceptions.ResponseValidationError – If the response from the quantopian_tools server is not of the format expected.

quantopian_tools.session

Sessions handle the details of authentication and transporting requests.

quantopian_tools.settings

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