mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-11 20:01:16 +00:00
* Move openbb_provider * Add lock file for provider core * Move sdk core * Move openbb-provider readme text to the correct location * Move data providers code * Remove decoupling leftovers * Lower the supported python version to 3.8 * Move sdk extensions * Rename provider imports * Update openbb pyproject toml * Fix import statements after the move * Update lock files * Change ignored path for the static assets * Add obb mascot * Fix providers not being available in the openbb package * Remove providers extension in favor of the coverage router in sdk core * username is optional * linting * Change openbb_sdk_core to openbb_core * Bump ruff pre-commit to latest version * Bump ruff to latest in github actions * Make ruff and pylint lint only the code in diff in GHA * Attempt to fix broken linting action * Attempt to fix the broken linting action II * Lint code with pre-commit * Revert all changes to github actions * Revert to using ruff 0.0.256 * Use dot for local imports * Re-commit lost forex pairs * Fix fmp's typo that made it to the openbb data points * Add other_investing_activities field that has a typo in fmp's api --------- Co-authored-by: montezdesousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
66 lines
1.9 KiB
Python
66 lines
1.9 KiB
Python
"""FMP Earnings Call Transcript fetcher."""
|
|
|
|
# IMPORT STANDARD
|
|
from typing import Dict, List, Optional
|
|
|
|
# IMPORT INTERNAL
|
|
from openbb_provider.model.data.earnings_call_transcript import (
|
|
EarningsCallTranscriptData,
|
|
EarningsCallTranscriptQueryParams,
|
|
)
|
|
from openbb_provider.provider.abstract.fetcher import Fetcher
|
|
from openbb_provider.provider.provider_helpers import data_transformer
|
|
|
|
# IMPORT THIRD-PARTY
|
|
from .helpers import create_url, get_data_many
|
|
|
|
|
|
class FMPEarningsCallTranscriptQueryParams(EarningsCallTranscriptQueryParams):
|
|
"""FMP Earnings Calendar query.
|
|
|
|
Source: https://site.financialmodelingprep.com/developer/docs/earnings-calendar-api/
|
|
|
|
Parameter
|
|
---------
|
|
symbol : str
|
|
The symbol of the company.
|
|
"""
|
|
|
|
|
|
class FMPEarningsCallTranscriptData(EarningsCallTranscriptData):
|
|
"""FMP Earnings Call Transcript data."""
|
|
|
|
|
|
class FMPEarningsCallTranscriptFetcher(
|
|
Fetcher[
|
|
EarningsCallTranscriptQueryParams,
|
|
EarningsCallTranscriptData,
|
|
FMPEarningsCallTranscriptQueryParams,
|
|
FMPEarningsCallTranscriptData,
|
|
]
|
|
):
|
|
@staticmethod
|
|
def transform_query(
|
|
query: EarningsCallTranscriptQueryParams, extra_params: Optional[Dict] = None
|
|
) -> FMPEarningsCallTranscriptQueryParams:
|
|
return FMPEarningsCallTranscriptQueryParams.parse_obj(query)
|
|
|
|
@staticmethod
|
|
def extract_data(
|
|
query: FMPEarningsCallTranscriptQueryParams, api_key: str
|
|
) -> List[FMPEarningsCallTranscriptData]:
|
|
url = create_url(
|
|
4,
|
|
f"batch_earning_call_transcript/{query.symbol}",
|
|
api_key,
|
|
query,
|
|
["symbol"],
|
|
)
|
|
return get_data_many(url, FMPEarningsCallTranscriptData)
|
|
|
|
@staticmethod
|
|
def transform_data(
|
|
data: List[FMPEarningsCallTranscriptData],
|
|
) -> List[EarningsCallTranscriptData]:
|
|
return data_transformer(data, EarningsCallTranscriptData)
|