finsec.base module#

class finsec.base.AmericanOptionExercise(*, exercise: ExerciseDatetime, style: OptionExerciseStyle = OptionExerciseStyle.AMERICAN)[source]#

Bases: BaseModel

exercise: ExerciseDatetime#
style: OptionExerciseStyle#
class finsec.base.BermudanOptionExercise(*, exercise: List[ExerciseDatetime], style: OptionExerciseStyle = OptionExerciseStyle.BERMUDAN)[source]#

Bases: BaseModel

exercise: List[ExerciseDatetime]#
style: OptionExerciseStyle#
class finsec.base.Derivative(*, gsid: GSID = None, ticker: Ticker, security_type: SecurityType, security_subtype: SecuritySubtype, identifiers: List[SecurityIdentifier], primary_exchange: Exchange | None = None, denominated_ccy: SecurityReference | None = None, issuer: str | None = None, description: str | None = None, website: str | None = None, as_of_date: datetime | None = None, version_id: GSID | None = None, underlying: SecurityReference = None, multiplier: Multiplier = None, exercise: DerivativeExercise = None)[source]#

Bases: Security

Derivative security, with some specified underlyer.

exercise: DerivativeExercise#
multiplier: Multiplier#
underlying: SecurityReference#
class finsec.base.DerivativeExercise(*, exercise: List[ExerciseDatetime] | ExerciseDatetime)[source]#

Bases: BaseModel

Config#

alias of standard_model_config

exercise: List[ExerciseDatetime] | ExerciseDatetime#
class finsec.base.EuropeanOptionExercise(*, exercise: ExerciseDatetime, style: OptionExerciseStyle = OptionExerciseStyle.EUROPEAN)[source]#

Bases: BaseModel

exercise: ExerciseDatetime#
style: OptionExerciseStyle#
class finsec.base.ExerciseDatetime(*, expiry_date: date, expiry_datetime: datetime | None = None, settlement_type: SettlementType = SettlementType.UNKNOWN, expiry_time_of_day: ExpiryTimeOfDay = ExpiryTimeOfDay.UNKNOWN, expiry_series_type: ExpirySeriesType = ExpirySeriesType.UNKNOWN)[source]#

Bases: BaseModel

Encodes information about a single exercise/expiration date/time a derivative.

classmethod date_str_to_datetime_date(v)[source]#
expiry_date: date#
expiry_datetime: datetime | None#
expiry_series_type: ExpirySeriesType#
expiry_time_of_day: ExpiryTimeOfDay#
settlement_type: SettlementType#
class finsec.base.ForwardExercise(*, exercise: ExerciseDatetime)[source]#

Bases: DerivativeExercise

exercise: ExerciseDatetime#
class finsec.base.Future(*, gsid: GSID = None, ticker: Ticker, security_type: SecurityType, security_subtype: SecuritySubtype, identifiers: List[SecurityIdentifier], primary_exchange: Exchange | None = None, denominated_ccy: SecurityReference | None = None, issuer: str | None = None, description: str | None = None, website: str | None = None, as_of_date: datetime | None = None, version_id: GSID | None = None, underlying: SecurityReference = None, multiplier: Multiplier = None, exercise: ForwardExercise = None, tick_size: CurrencyQty = None)[source]#

Bases: Derivative

Exchange-traded future object, derived from some underlying.

exercise: ForwardExercise#
tick_size: CurrencyQty#
class finsec.base.Option(*, gsid: GSID = None, ticker: Ticker, security_type: SecurityType, security_subtype: SecuritySubtype, identifiers: List[SecurityIdentifier], primary_exchange: Exchange | None = None, denominated_ccy: SecurityReference | None = None, issuer: str | None = None, description: str | None = None, website: str | None = None, as_of_date: datetime | None = None, version_id: GSID | None = None, underlying: SecurityReference = None, multiplier: Multiplier = None, exercise: OptionExercise = None, strike: CurrencyQty = None, option_flavor: OptionFlavor = None)[source]#

Bases: Derivative

Option object, derived from some underlying.

exercise: OptionExercise#
option_flavor: OptionFlavor#
strike: CurrencyQty#
class finsec.base.OptionExercise(*, exercise: List[ExerciseDatetime] | ExerciseDatetime, style: OptionExerciseStyle)[source]#

Bases: DerivativeExercise

style: OptionExerciseStyle#
class finsec.base.Security(*, gsid: GSID = None, ticker: Ticker, security_type: SecurityType, security_subtype: SecuritySubtype, identifiers: List[SecurityIdentifier], primary_exchange: Exchange | None = None, denominated_ccy: SecurityReference | None = None, issuer: str | None = None, description: str | None = None, website: str | None = None, as_of_date: datetime | None = None, version_id: GSID | None = None)[source]#

Bases: BaseModel

Foundational financial security object.

Config#

alias of standard_model_config

as_of_date: datetime | None#
denominated_ccy: SecurityReference | None#
description: str | None#
gsid: GSID#
identifiers: List[SecurityIdentifier]#
issuer: str | None#
primary_exchange: Exchange | None#
security_subtype: SecuritySubtype#
security_type: SecurityType#
ticker: Ticker#
version_id: GSID | None#
website: str | None#
class finsec.base.SecurityIdentifier(*, id_type: SecurityIdentifierType, value: str)[source]#

Bases: BaseModel

Object that identifies an existing security. This should be like ISIN, FIGI, etc.

Config#

alias of standard_model_config

id_type: SecurityIdentifierType#
value: str#
class finsec.base.SecurityReference(*, gsid: GSID = None, ticker: Ticker, security_type: SecurityType, security_subtype: SecuritySubtype)[source]#

Bases: BaseModel

References an existing security. Should be treated like pointer of sorts.

gsid: GSID#
security_subtype: SecuritySubtype#
security_type: SecurityType#
ticker: Ticker#
class finsec.base.standard_model_config[source]#

Bases: object

extra = 'forbid'#
json_encoders = {<class 'datetime.date'>: <function standard_model_config.<lambda>>, <class 'datetime.datetime'>: <function standard_model_config.<lambda>>, <class 'datetime.timedelta'>: <cyfunction timedelta_isoformat>}#
use_enum_values = True#