Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add Multi-Country Support & ECB Yield Curves To fixedincome.goverment.yield_curve(provider='econdb') #6946

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

deeleeramone
Copy link
Contributor

  1. Why?:

  2. What?:

    • In, obb.fixedincome.goverment.yield_curve(provider='econdb'), multiple items allowed for:
      • 'country'
      • 'date'
    • Adds a @computed_field to the output, maturity_years, which is the decimal representation of years-to-maturity.
      • It assumes that the maturity field is formatted as: 'month_X', 'year_X', or 'year_X_month_X'. If not, computes as None
  3. Impact:

    • Improved data coverage and enhanced user experience.
  4. Testing Done:

Screenshot 2024-11-14 at 11 40 19 AM

@deeleeramone deeleeramone added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels Nov 14, 2024
months = 0
for i in range(0, len(parts), 2):
number = int(parts[i + 1])
if parts[i] == "year":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this?

parts = self.maturity.split("_")
    months = sum(
        int(parts[i + 1]) * (12 if parts[i] == "year" else 1)
        for i in range(0, len(parts), 2)
    )
    return months / 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants