bayesline.api.equity.UniverseSettings#

pydantic model bayesline.api.equity.UniverseSettings#

Defines an asset universe as a set of regional, industry and market cap filters.

Show JSON schema
{
   "title": "UniverseSettings",
   "description": "Defines an asset universe as a set of regional, industry and market cap filters.",
   "type": "object",
   "properties": {
      "dataset": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the underlying dataset to use. If none is given then the configured default dataset is used.",
         "examples": [
            "Bayesline-US"
         ],
         "title": "Dataset"
      },
      "id_type": {
         "default": "bayesid",
         "description": "The default id type to use for the universe.",
         "enum": [
            "bayesid",
            "ticker",
            "composite_figi",
            "cik",
            "cusip8",
            "cusip9",
            "isin",
            "sedol6",
            "sedol7",
            "proxy",
            "name"
         ],
         "examples": [
            "cusip9",
            "bayesid"
         ],
         "title": "Id Type",
         "type": "string"
      },
      "calendar": {
         "$ref": "#/$defs/CalendarSettings",
         "description": "The calendar settings to use for the universe."
      },
      "industry": {
         "$ref": "#/$defs/IndustrySettings",
         "description": "\n        Filters that determine which industries to include and exclude in the universe.\n        "
      },
      "region": {
         "$ref": "#/$defs/RegionSettings",
         "description": "\n        Filters that determine which countries/continents to include and exclude in the\n        universe.\n        "
      },
      "mcap": {
         "$ref": "#/$defs/MCapSettings",
         "description": "\n        Filters that determine which market caps to include and exclude in the universe.\n        "
      }
   },
   "$defs": {
      "CalendarSettings": {
         "additionalProperties": false,
         "description": "Defines the settings for the calendar.",
         "properties": {
            "dataset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the underlying dataset to use. If none is given then the configured default dataset is used.",
               "examples": [
                  "Bayesline-US"
               ],
               "title": "Dataset"
            },
            "filters": {
               "default": [
                  [
                     "XNYS"
                  ]
               ],
               "description": "The filters to apply. Each filter is a list of exchange MIC codes. The outer list will be treated as an OR conditions, while the inner lists will be treated as an AND conditions. For example, `[['A', 'B'], ['C']]` means that the holidays are the days where either A and B are both holidays, or C is a holiday.",
               "examples": [
                  [
                     [
                        "XNYS"
                     ]
                  ],
                  [
                     [
                        "XNYS",
                        "XNAS"
                     ]
                  ],
                  [
                     [
                        "XNYS"
                     ],
                     [
                        "XNAS"
                     ]
                  ]
               ],
               "items": {
                  "items": {
                     "type": "string"
                  },
                  "type": "array"
               },
               "minItems": 1,
               "title": "Filters",
               "type": "array"
            }
         },
         "title": "CalendarSettings",
         "type": "object"
      },
      "IndustrySettings": {
         "additionalProperties": false,
         "description": "Specifies include and exclude filters for industries.\n\nAssets are includes if they are part of at least one include\nand not part of any exclude.\n\nBy default all industries for the given hierarchy are included.",
         "properties": {
            "hierarchy": {
               "default": "trbc",
               "description": "The industry hierarchy to use.",
               "examples": [
                  "trbc"
               ],
               "minLength": 1,
               "title": "Hierarchy",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "const": "All",
                     "type": "string"
                  }
               ],
               "default": "All",
               "description": "Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the highest level is used.",
               "examples": [
                  [
                     "3571"
                  ],
                  "All",
                  [
                     "Materials",
                     "1010"
                  ]
               ],
               "title": "Include"
            },
            "exclude": {
               "description": "Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the lowest level is used.",
               "examples": [
                  [
                     "3571"
                  ],
                  [
                     "Materials",
                     "1010"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            }
         },
         "title": "IndustrySettings",
         "type": "object"
      },
      "MCapSettings": {
         "additionalProperties": false,
         "description": "Specifies the lower and upper bound for the market cap filter.\n\nBy default the bounds are infinite.",
         "properties": {
            "lower": {
               "default": 0.0,
               "description": "Lower bound of the cap filter in USD.",
               "examples": [
                  10000000000.0
               ],
               "minimum": 0.0,
               "title": "Lower",
               "type": "number"
            },
            "upper": {
               "default": 1e+20,
               "description": "Upper bound of the cap filter in USD.",
               "examples": [
                  1000000000000.0
               ],
               "exclusiveMinimum": 0.0,
               "title": "Upper",
               "type": "number"
            },
            "gdp_deflator_asof": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n        The as of date to adjust the market cap bounds for GDP through time.\n        If no date is specified then the market cap bounds are static through time.\n        ",
               "title": "Gdp Deflator Asof"
            }
         },
         "title": "MCapSettings",
         "type": "object"
      },
      "RegionSettings": {
         "additionalProperties": false,
         "description": "Specifies include and exclude filters for countries and regions.\n\nAssets are includes if they are part of at least one include\nand not part of any exclude.\n\nBy default all countries for the given hierarchy are included.",
         "properties": {
            "hierarchy": {
               "default": "continent",
               "description": "The region hierarchy to use.",
               "examples": [
                  "continent"
               ],
               "minLength": 1,
               "title": "Hierarchy",
               "type": "string"
            },
            "include": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "const": "All",
                     "type": "string"
                  }
               ],
               "default": "All",
               "description": "Valid country/region codes or labels at any level. If labels are used which may be duplicated, then the code with the highest level is used.",
               "examples": [
                  [
                     "Europe",
                     "CAN"
                  ],
                  "All"
               ],
               "title": "Include"
            },
            "exclude": {
               "description": "Valid country/region codes or labels at any level. If labels are used which may be duplicated, then the code with the lowest level is used.",
               "examples": [
                  [
                     "DEU"
                  ]
               ],
               "items": {
                  "type": "string"
               },
               "title": "Exclude",
               "type": "array"
            }
         },
         "title": "RegionSettings",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • calendar (bayesline.api._src.equity.calendar_settings.CalendarSettings)

  • dataset (str | None)

  • id_type (Literal['bayesid', 'ticker', 'composite_figi', 'cik', 'cusip8', 'cusip9', 'isin', 'sedol6', 'sedol7', 'proxy', 'name'])

  • industry (bayesline.api._src.equity.universe_settings.IndustrySettings)

  • mcap (bayesline.api._src.equity.universe_settings.MCapSettings)

  • region (bayesline.api._src.equity.universe_settings.RegionSettings)

Validators:
  • propagate_dataset » all fields

classmethod default() UniverseSettings#

Creates default universe settings with no filters and cusip as the default id type.

field dataset: str | None = None#

The name of the underlying dataset to use. If none is given then the configured default dataset is used.

Validated by:
  • propagate_dataset

field id_type: Literal['bayesid', 'ticker', 'composite_figi', 'cik', 'cusip8', 'cusip9', 'isin', 'sedol6', 'sedol7', 'proxy', 'name'] = 'bayesid'#

The default id type to use for the universe.

Validated by:
  • propagate_dataset

field calendar: CalendarSettings [Optional]#

The calendar settings to use for the universe.

Validated by:
  • propagate_dataset

field industry: IndustrySettings [Optional]#

Filters that determine which industries to include and exclude in the universe.

Validated by:
  • propagate_dataset

field region: RegionSettings [Optional]#

Filters that determine which countries/continents to include and exclude in the universe.

Validated by:
  • propagate_dataset

field mcap: MCapSettings [Optional]#

Filters that determine which market caps to include and exclude in the universe.

Validated by:
  • propagate_dataset

validator propagate_dataset Any  »  all fields#

Propagates the dataset to the calendar.