Skip to content

feat(itofin-py): expose Currency and weekends-only calendar - #869

Merged
benbenbang merged 3 commits into
mainfrom
fable/815
Aug 13, 2026
Merged

feat(itofin-py): expose Currency and weekends-only calendar#869
benbenbang merged 3 commits into
mainfrom
fable/815

Conversation

@benbenbang

@benbenbang benbenbang commented Aug 13, 2026

Copy link
Copy Markdown
Owner
  • feat(itofin-py): expose Currency and weekends-only calendar
  • feat(itofin-py): add general IborIndex base for rate helpers
  • test(itofin-py): add tests for IBOR index

close #815

This change adds Python bindings for currency and calendar functionality
needed by the ISDA CDS conventions.

**Currency bindings:**
* Added a new `currency.rs` module exposing `PyCurrency`, an ISO 4217
  currency specification. Only the EUR, USD and GBP currencies the core
  provides are exposed via static constructors, with `code()` and
  `__repr__()` accessors.
* Registered `PyCurrency` in the `indexes` module and documented the new
  `Currency` class in `indexes.pyi`.

**Weekends-only calendar:**
* Added a `weekends_only()` static constructor to `PyCalendar`, exposing
  the calendar the ISDA CDS conventions roll on, where only Saturdays and
  Sundays are holidays.
* Documented the new calendar in `time.pyi`.
This change introduces a general `IborIndex` facade that spells out every
convention the core constructor takes, so an index outside the named
families (such as the USD-3M `IsdaIbor` the ISDA CDS curve bootstraps off)
is expressible without a dedicated facade.

**New general index facade:**
* Added `PyIborIndex` with a full constructor (family name, tenor,
  settlement days, currency, calendar, convention, end-of-month, day
  counter, optional forwarding curve, settings) and a `fixing` method.
* Made `PyEuribor` a subclass of `PyIborIndex`, with a shared
  `init_euribor` initializer feeding one core index into both halves so
  the base and subclass read the same object.
* Registered `IborIndex` in the `indexes` module.

**Rate helper widening:**
* `DepositRateHelper` and `SwapRateHelper` now take `IborIndex`, so they
  accept either the general index or a `Euribor`.
* Removed the now-unneeded `dead_code` allowance on `PyCurrency::inner`.
Add a new test module `test_ibor_index.py` covering the IBOR index
functionality in the Python bindings.

close #815
@benbenbang
benbenbang enabled auto-merge (rebase) August 13, 2026 13:50
@github-actions github-actions Bot added the enhancement New feature or request label Aug 13, 2026
@benbenbang
benbenbang merged commit fde09e7 into main Aug 13, 2026
3 of 6 checks passed
@benbenbang
benbenbang deleted the fable/815 branch August 13, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Binding] Generic PyIborIndex + re-typed rate helpers (deferred from BIND)

1 participant