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

[Feature] FOMC Documents With Workspace Multi-File Viewer Widget #7065

Merged
merged 13 commits into from
Mar 30, 2025

Conversation

deeleeramone
Copy link
Contributor

  1. Why?:

    • This adds requested functionality for cataloging and serving current and historical FOMC minutes and other documents.
  2. What?:

    • Adds new endpoint with no standard model:
      • obb.economy.fomc_documents
        • Provider: federal_reserve
    • Historical documents from 1959 to 2024 are stored in a static JSON file, new items are read from items posted to the FOMC calendar on the Federal Reserve website.
    • Supplying a URL overrides other parameters to download the file directly.
      • A PDF file will return as a base64-encoded string.
      • Other files are returned, "as-is".
    • Endpoint is configured to produce a multi-file PDF viewer in Workspace.
  3. Impact:

This function is anti-pattern for a few reasons.

Response is not an OBBject

  • When no parameters are supplied, all historical and current documents are returned as a list[dict[str, str]] with keys:
    • date
    • doc_type
    • doc_format
    • url
In [3]: obb.economy.fomc_documents()[0]
Out[3]: 
{'date': '2025-01-29',
 'doc_type': 'monetary_policy',
 'doc_format': 'pdf',
 'url': 'https://www.federalreserve.gov/monetarypolicy/files/monetary20250129a1.pdf'}
  • When a URL is supplied, all other parameters are ignored. A dict[str, Any] is returned with keys:
    • filename
    • content
    • data_format
In [4]: obb.economy.fomc_documents(url='https://www.federalreserve.gov/monetarypolicy/files/monetary20250129a1.pdf').keys()
Out[4]: dict_keys(['filename', 'content', 'data_format'])

In [5]: obb.economy.fomc_documents(url='https://www.federalreserve.gov/monetarypolicy/files/monetary20250129a1.pdf')["data_format"]
Out[5]: {'data_type': 'pdf', 'filename': 'monetary20250129a1.pdf'}
  • When, as_choices = True, an array compatible with Workspace Params Options is returned.
In [6]: obb.economy.fomc_documents(year=2025, as_choices=True, pdf_only=True)
Out[6]: 
[{'label': 'Monetary Policy - 2025-01-29',
  'value': 'https://www.federalreserve.gov/monetarypolicy/files/monetary20250129a1.pdf'},
 {'label': 'Minutes - 2025-01-29',
  'value': 'https://www.federalreserve.gov/monetarypolicy/files/fomcminutes20250129.pdf'}]

CLI has no adapter for this type of scenario.

  • CLI has been modified to handle the base, no parameters scenario.
  • The url param is not compatible with the command execution because of slashes.
  1. Testing Done:

    • Unit and integration tests, modified to accommodate not returning OBBject.
    • CLI scenarios.
      Screenshot 2025-03-14 at 9 59 58 AM

image

@deeleeramone deeleeramone added platform OpenBB Platform v4 PRs for v4 feature New feature labels Mar 14, 2025
@github-actions github-actions bot added the enhancement Enhancement label Mar 14, 2025
@Hanymato
Copy link

@OpenBB-finance OpenBB-finance deleted a comment from Hanymato Mar 15, 2025
@deeleeramone deeleeramone requested a review from piiq March 24, 2025 21:00
@deeleeramone deeleeramone added this pull request to the merge queue Mar 30, 2025
Merged via the queue into develop with commit a1b95cf Mar 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement feature New feature platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants