Skip to content

Commit 2dbe53e

Browse files
committed
update earnings
1 parent 38f529e commit 2dbe53e

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fmp-py"
3-
version = "0.0.14.0"
3+
version = "0.0.14.1"
44
description = "Python package for Financial Modeling Prep API"
55
authors = ["TexasCoding <[email protected]>"]
66
readme = "README.md"

src/fmp_py/fmp_base.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import pandas as pd
23
import requests
34
from requests.adapters import HTTPAdapter
45
from urllib3.util import Retry
@@ -38,6 +39,16 @@ def __init__(self, api_key: str = FMP_API_KEY) -> None:
3839
self.session.mount("https://", self.adapter)
3940
self.session.mount("http://", self.adapter)
4041

42+
def fill_na(self, df: pd.DataFrame) -> pd.DataFrame:
43+
for col in df:
44+
dt = df[col].dtype
45+
if dt is int or dt is float:
46+
df[col].fillna(0, inplace=True)
47+
else:
48+
df[col].fillna("", inplace=True)
49+
50+
return df
51+
4152
def clean_value(self, value, type) -> Any:
4253
if type is int:
4354
return int(value) if value else int(0)

src/fmp_py/fmp_earnings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
load_dotenv()
88

9+
pd.set_option('future.no_silent_downcasting', True)
10+
911
"""
1012
This module provides functions to retrieve earnings data from the Financial Modeling Prep API.
1113
References:

0 commit comments

Comments
 (0)