Objects#

sigtech.framework.infra.objects.register.cls(key: str) Type[sigtech.framework.internal.infra.objects.register.T]

Return a class given a string key, e.g. 'CashIndex' returns sigtech.framework.indices.cash_index.CashIndex.

Parameters

key – Class identifier.

Returns

FrameworkObjectMeta.

sigtech.framework.infra.objects.register.product_type(key: str) str

Return the product type given a string key.

Parameters

key – Class identifier.

Returns

str.

sigtech.framework.infra.objects.factory.instrument_class_name(iid: sigtech.framework.infra.data_adapter.identifier.Identifier, data, db: bool = True)

Return the class name of the given instrument id when created with data in the supplied dictionary.

Parameters
  • iid – Instrument identifier.

  • data – Input dictionary.

  • db – If set to True, use the internal naming (default is True).

Returns

str.

sigtech.framework.infra.objects.factory.exists(name: str) bool

Test if an FrameworkObject named name exists in the framework cache.

Parameters

name – Name of requested object

Returns

Boolean of whether FrameworkObject with requested name exists in object cache.

sigtech.framework.infra.objects.factory.get(name: str = '', symbology: Optional[sigtech.framework.infra.data_adapter.identifier.Symbology] = None, cache: bool = True, validate: bool = True, create_unmapped: bool = False, strict: bool = True) sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject

Retrieve an object using the configured environment.

Parameters
  • name – Object name.

  • symbology – Symbology, e.g. Symbology.SIG, Symbology.ICE`.

  • cache – Enable cache (default is True).

  • validate – If set to True, propagate any exception raised (default is True).

  • create_unmapped – Return an unmapped FrameworkObject class if the class not registered (default is True).

  • strict – Error if the object can not be retrieved (default is True).

Returns

FrameworkObject.

sigtech.framework.infra.objects.factory.get_many(names, symbology: Optional[sigtech.framework.infra.data_adapter.identifier.Symbology] = None, strict: bool = True, cache: bool = True) list[sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject]

Retrieve a list of objects using the configured environment.

Parameters
  • names – List of object names.

  • symbology – Symbology, e.g. Symbology.SIG, Symbology.ICE` (optional).

  • strict – Explode if the mapping to an object fails. Return None if the data does not exist (default is True).

  • cache – Enable cache (default is True).

Returns

List of FrameworkObject.

sigtech.framework.infra.objects.factory.get_many_with_history(names: Sequence[Union[str, sigtech.framework.infra.data_adapter.identifier.Identifier]], symbology: Optional[sigtech.framework.infra.data_adapter.identifier.Symbology] = None, fields=None, start=None, end=None, data_source: Optional[sigtech.framework.infra.data_adapter.common.DataSource] = None, method=None, header: sigtech.framework.internal.infra.data_adapter.common.DataHeader = 'FIELD', data_point: sigtech.framework.infra.data_adapter.common.DataPoint = 'EOD', data_set=None, strict: bool = True, cache: bool = True, batch_size: Optional[int] = None) list[sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject]

Retrieve a list of objects using the configured environment and call the adapter history method for each object.

Note

This method is currently experimental and will only work for instruments which would normally retrieve data using the underlying history method from the data service.

Parameters
  • names – List of object names.

  • symbology – Symbology, e.g. Symbology.SIG, Symbology.ICE` (optional).

  • fields – List of fields, e.g. 'LastPrice' (optional).

  • start – Start date for series (optional).

  • end – End date for series (optional).

  • data_source – Source of the data, e.g. Bloomberg, QA Direct (optional).

  • method – Physical source for the data, e.g. Bloomberg, internal database (optional).

  • header – Determine the ordering of multi-index columns (optional).

  • data_point – Data point, e.g. 'EOD' or 'LONDON_EOD' (optional).

  • data_set – Parameter to indicate clean or dirty series (optional).

  • strict – Explode if the mapping to an object fails. Return None if the data does not exist (default is True).

  • cache – Enable cache (default is True).

  • batch_size – Batch up the history requests into requests of this size

Returns

List of FrameworkObject.

sigtech.framework.infra.objects.factory.get_instruments(names, symbology: Optional[sigtech.framework.infra.data_adapter.identifier.Symbology] = None, cache: bool = False) list[sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject]

Retrieve a list of instruments. It only works for objects stored as instruments. This method will not cache objects.

Parameters
  • names – Names of instruments.

  • symbology – Symbology, e.g. Symbology.SIG, Symbology.ICE` (optional).

  • cache – Enable cache (default is False).

Returns

List of FrameworkObject.

sigtech.framework.infra.objects.factory.get_groups(names, symbology: Optional[sigtech.framework.infra.data_adapter.identifier.Symbology] = None, strict: bool = True, cache: bool = False) list[sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject]

Retrieve a list of groups. It only works for objects stored as groups. This method will not cache objects.

Parameters
  • names – Names of groups.

  • symbology – Symbology, e.g. Symbology.SIG, Symbology.ICE` (optional).

  • strict – Explode if the mapping to an object fails. Return None if the data does not exist (default is True).

  • cache – Enable cache (default is False).

Returns

List of FrameworkObject.