otp.config#

config = <onetick.py.configuration.Config object>#

This object is used to access onetick.py configuration options.

Configuration options may be changed by modifying properties of this object or by setting environment variables. Also, configuration options may be accessed via config.['...'] syntax, e.g. config['tz']

The following is the order of priority of configuration values:

  1. Value that is set explicitly

  2. Value that is set via environment variable

  3. Default value listed on this page

To reset configuration value that has been set explicitly, None should be assigned to it.

The following properties can be changed:

tz: <class 'NoneType'> or <class 'str'> = None#

Default timezone for queries and databases

Can be set using environment variable OTP_DEFAULT_TZ

context: <class 'str'> = DEFAULT#

Default context for query execution

Can be set using environment variable OTP_CONTEXT

default_start_time: <class 'datetime.datetime'> = <class 'onetick.py.configuration.nothing'>#

Default start time for queries

Can be set using environment variable OTP_DEFAULT_START_TIME

Format of the env variable: %Y/%m/%d %H:%M:%S.%f, %Y/%m/%d %H:%M:%S

default_end_time: <class 'datetime.datetime'> = <class 'onetick.py.configuration.nothing'>#

Default end time for queries

Can be set using environment variable OTP_DEFAULT_END_TIME

Format of the env variable: %Y/%m/%d %H:%M:%S.%f, %Y/%m/%d %H:%M:%S

default_db: <class 'str'> = <class 'onetick.py.configuration.nothing'>#

Default database

Can be set using environment variable OTP_DEFAULT_DB

default_symbol: <class 'str'> = <class 'onetick.py.configuration.nothing'>#

Default symbol

Can be set using environment variable OTP_DEFAULT_SYMBOL

default_symbology: <class 'str'> = BZX#

Default database symbology

Can be set using environment variable OTP_DEFAULT_SYMBOLOGY

default_concurrency: <class 'int'> = 32#

Default concurrency for queries

Can be set using environment variable OTP_DEFAULT_CONCURRENCY

default_batch_size: <class 'int'> = 0#

Default batch size for queries

Can be set using environment variable OTP_DEFAULT_BATCH_SIZE

default_license_dir: <class 'str'> or <class 'str'> = /license#

Default path for license directory

Can be set using environment variable OTP_DEFAULT_LICENSE_DIR

default_license_file: <class 'str'> or <class 'str'> = /license/license.dat#

Default path for license file

Can be set using environment variable OTP_DEFAULT_LICENSE_FILE

default_fault_tolerance: <class 'str'> or <class 'str'> = FALSE#

Default value for USE_FT query property

Can be set using environment variable OTP_DEFAULT_FAULT_TOLERANCE

default_auth_username: <class 'NoneType'> or <class 'str'> = None#

Default username used for authentication

Can be set using environment variable OTP_DEFAULT_AUTH_USERNAME

default_password: <class 'NoneType'> or <class 'str'> = None#

Default password used for authentication

Can be set using environment variable OTP_DEFAULT_PASSWORD

max_expected_ticks_per_symbol: <class 'int'> or <class 'int'> = 2000#

Expected maximum number of ticks per symbol (used for performance optimizations)

Can be set using environment variable OTP_MAX_EXPECTED_TICKS_PER_SYMBOL

The following properties are derived and thus read-only:

default_db_symbol: <class 'NoneType'> = None#

Default symbol with database.Defined as config.default_db + "::" + config.default_symbol

default_date: <class 'NoneType'> = None#

Default date.Defined as a date part of config.default_start_time