fuggers_py.reference

Security metadata, market conventions, and reference-data types.

.. py:module:: fuggers_py.reference

Static reference data, conventions, metadata, and contract specs.

The reference package groups stable market descriptors used to build instruments, resolve conventions, and normalize external data. Public docs should treat this package as the home for identifiers, conventions, and reference records rather than pricing logic.

.. py:class:: BondType(value) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.BondType

Supported bond reference types used to select instrument builders.

.. py:class:: RateIndex(value) :module: fuggers_py.reference :canonical: fuggers_py.reference.bonds.types.rate_index.RateIndex

Reference rate indices used by floating-rate notes.

.. py:method:: RateIndex.display_name() :module: fuggers_py.reference

  Return a presentation-friendly name for the index.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\``

.. py:class:: Tenor(length, unit) :module: fuggers_py.reference :canonical: fuggers_py.reference.bonds.types.tenor.Tenor

A positive tenor measured in days, weeks, months, or years.

.. py:method:: Tenor.new(length, unit) :module: fuggers_py.reference :classmethod:

  Create a validated tenor.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.tenor.Tenor\``

.. py:method:: Tenor.parse(text) :module: fuggers_py.reference :classmethod:

  Parse a tenor string such as ``3M`` or ``5Y``.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.tenor.Tenor\``

.. py:method:: Tenor.add_to(date) :module: fuggers_py.reference

  Add the tenor to a date using calendar-aware date arithmetic.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.core.types.Date\``

.. py:method:: Tenor.to_years_approx() :module: fuggers_py.reference

  Return a rough year-equivalent for the tenor.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`float\``

.. py:class:: YieldCalculationRules(convention, compounding, frequency, calendar, business_day_convention, end_of_month, settlement_rules, stub_rules, ex_dividend_rules, accrued_convention, accrual_day_count, yield_day_count, discount_day_count, rounding, description) :module: fuggers_py.reference :canonical: fuggers_py.reference.bonds.types.yield_rules.YieldCalculationRules

Market convention bundle for bond pricing and accrued interest.

The day-count fields govern accrual, yield solving, and discounting. Raw coupon, yield, and spread values remain decimals unless wrapped in a higher level quote type.

.. py:method:: YieldCalculationRules.default() :module: fuggers_py.reference :classmethod:

  Return the default US Treasury convention bundle.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.us_treasury() :module: fuggers_py.reference :classmethod:

  Return the standard US Treasury pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.us_corporate() :module: fuggers_py.reference :classmethod:

  Return the standard US corporate pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.uk_gilt() :module: fuggers_py.reference :classmethod:

  Return the standard UK gilt pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.eurobond() :module: fuggers_py.reference :classmethod:

  Return the standard Eurobond pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.german_bund() :module: fuggers_py.reference :classmethod:

  Return the standard German Bund pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.japanese_jgb() :module: fuggers_py.reference :classmethod:

  Return the standard Japanese JGB pricing convention.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.yield\_rules.YieldCalculationRules\``

.. py:method:: YieldCalculationRules.accrual_day_count_obj() :module: fuggers_py.reference

  Return the day-count object used for coupon accrual.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.core.daycounts.DayCount\``

.. py:method:: YieldCalculationRules.yield_day_count_obj() :module: fuggers_py.reference

  Return the day-count object used for yield solving.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.core.daycounts.DayCount\``

.. py:method:: YieldCalculationRules.discount_day_count_obj() :module: fuggers_py.reference

  Return the day-count object used for discounting.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.core.daycounts.DayCount\``

.. py:attribute:: BondFutureContractReference :module: fuggers_py.reference

alias of :py:class:~fuggers_py.reference.reference_data.BondFutureReferenceData

.. py:class:: BondFutureReferenceData(instrument_id, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, delivery_month=None, contract_size=None, tick_size=None, exchange=None, first_delivery_date=None, last_delivery_date=None, final_delivery_date=None, standard_coupon_rate=None, coupon_frequency=None, underlying_basket=) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.BondFutureReferenceData

Reference metadata for a bond futures contract.

The record keeps delivery and basket metadata separate from pricing logic and normalizes the underlying basket into parsed instrument ids.

.. py:class:: BondReferenceData(instrument_id, bond_type, issuer_type, issue_date, maturity_date, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, notional=Decimal(‘100’), coupon_rate=None, frequency=None, yield_rules=None, floating_rate_terms=None, call_schedule=, put_schedule=, issuer_name=None, sector=None, rating=None, amount_outstanding=None, benchmark_flag=None, futures_deliverable_flags=, liquidity_score=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.BondReferenceData

Bond reference record used to construct bond instruments.

The record normalizes identifiers, sorts optional schedules, and uses the issuer type to infer default yield rules when none are supplied. Coupon rate, notional, and amount fields are stored as raw decimals.

.. py:method:: BondReferenceData.to_instrument() :module: fuggers_py.reference

  Convert the reference record into a bond instrument instance.

  Fixed-rate and zero-coupon records are converted directly. Callable and
  puttable records use the sorted embedded exercise schedules, and
  floating-rate records require ``floating_rate_terms``.

.. py:class:: BondReferenceSource(*args, **kwargs) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.BondReferenceSource

Protocol for retrieving bond reference records by instrument id.

.. py:class:: CallScheduleEntry(exercise_date, price) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.CallScheduleEntry

Single callable or puttable exercise point.

:type exercise_date: :sphinx_autodoc_typehints_type:\:py\:class\:\~fuggers_py.core.types.Date`    :param exercise_date: Exercise date in the bond's schedule, stored as a calendar date.    :type price: :sphinx_autodoc_typehints_type::py:class:`~decimal.Decimal`` :param price: Exercise price as a raw decimal amount, typically per 100 notional.

.. py:class:: CdsReferenceData(instrument_id, reference_entity, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, tenor=None, seniority=None, restructuring_clause=None, coupon=None, recovery_rate=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.CdsReferenceData

CDS reference record with raw decimal coupon and recovery fields.

.. py:class:: DeliverableBondReference(instrument_id, issue_date, maturity_date, coupon_rate, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, frequency=Frequency.SEMI_ANNUAL, notional=Decimal(‘100’), yield_rules=None, published_conversion_factor=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.DeliverableBondReference

Deliverable bond metadata for a bond futures basket.

published_conversion_factor records the source-provided factor and is distinct from any model-implied conversion factor.

.. py:method:: DeliverableBondReference.to_instrument() :module: fuggers_py.reference

  Convert the deliverable bond reference into a bond instrument.

  The resulting instrument uses Treasury-style yield rules unless an
  explicit rule bundle is supplied.

.. py:class:: EtfHoldingsSource(*args, **kwargs) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.EtfHoldingsSource

Protocol for retrieving ETF holdings as a normalized tuple.

.. py:class:: FloatingRateTerms(index_name, spread, reset_frequency, current_reference_rate=None, cap_rate=None, floor_rate=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.FloatingRateTerms

Floating-rate note terms with raw decimal rate fields.

The index name is normalized to uppercase and the spread, caps, floors, and current reference rate are stored as raw decimals.

.. py:method:: FloatingRateTerms.rate_index() :module: fuggers_py.reference

  Map the normalized index name to the bond-layer rate index.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.bonds.types.rate\_index.RateIndex\``

.. py:attribute:: FutureReferenceData :module: fuggers_py.reference

alias of :py:class:~fuggers_py.reference.reference_data.BondFutureReferenceData

.. py:class:: IssuerReferenceData(issuer_name, issuer_type=IssuerType.OTHER, issuer_id=None, country=None, sector=None, rating=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.IssuerReferenceData

Issuer metadata used as a lookup and normalization target.

The issuer name is required and non-empty; optional fields are normalized but otherwise left as descriptive text.

.. py:class:: IssuerReferenceSource(*args, **kwargs) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.IssuerReferenceSource

Protocol for retrieving issuer reference records by issuer name.

.. py:class:: IssuerType(value) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.IssuerType

Normalized issuer categories used for default yield rules.

.. py:class:: RatingRecord(rating, agency=None, outlook=None, instrument_id=None, issuer_name=None, effective_date=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.RatingRecord

Credit rating record keyed by instrument or issuer.

Ratings are kept as simple agency buckets with optional outlook, issuer, instrument, and effective-date metadata.

.. py:class:: RatingSource(*args, **kwargs) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.RatingSource

Protocol for retrieving ratings by instrument or issuer.

.. py:class:: ReferenceDataProvider(bond_source=None, issuer_source=None, rating_source=None, etf_holdings_source=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.ReferenceDataProvider

Composite provider that delegates to optional reference-data sources.

Each source is optional. Missing sources return None or an empty tuple instead of raising, which keeps snapshot-backed workflows deterministic.

.. py:method:: ReferenceDataProvider.get_bond_reference(instrument_id) :module: fuggers_py.reference

  Return a bond reference from the configured bond source.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.reference\_data.BondReferenceData\` \| \:py\:obj\:\`None\``

.. py:method:: ReferenceDataProvider.get_issuer_reference(issuer_name) :module: fuggers_py.reference

  Return an issuer reference from the configured issuer source.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.reference\_data.IssuerReferenceData\` \| \:py\:obj\:\`None\``

.. py:method:: ReferenceDataProvider.get_rating(*, instrument_id=None, issuer_name=None) :module: fuggers_py.reference

  Return a rating from the configured rating source.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~fuggers\_py.reference.reference\_data.RatingRecord\` \| \:py\:obj\:\`None\``

.. py:method:: ReferenceDataProvider.get_etf_holdings(etf_id) :module: fuggers_py.reference

  Return ETF holdings from the configured holdings source.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`tuple\`\\ \\\[\:py\:class\:\`\~fuggers\_py.market.market\_data.EtfHolding\`\, \:py\:data\:\`...\<Ellipsis\>\`\]`

.. py:class:: RepoReferenceData(instrument_id, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, collateral_currency=None, term=None, collateral_type=None, haircut=None, settlement_lag_days=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.RepoReferenceData

Repo reference record with raw decimal haircut semantics.

Haircut values are kept as raw decimals and settlement lags remain as integer business-day counts where supplied.

.. py:class:: SwapReferenceData(instrument_id, currency=Currency.<bound method Currency.name of <Currency.USD: ‘USD’>>, tenor=None, floating_index=None, fixed_frequency=None, floating_frequency=None, day_count=None, calendar=None) :module: fuggers_py.reference :canonical: fuggers_py.reference.reference_data.SwapReferenceData

Swap reference metadata with normalized role descriptors.

The tenor, floating index, day-count, and calendar descriptors are stored as normalized strings so downstream builders can map them deterministically onto convention objects.