modifications to enable financials api from bankfind

This commit is contained in:
Ross 2023-04-15 15:29:10 -07:00
parent 160576d073
commit e9cccc7e8b
3 changed files with 13 additions and 2 deletions

View File

@ -4,5 +4,5 @@ __version__ = '0.0.1'
from .main import (get_failures, get_history, get_institutions, # noqa from .main import (get_failures, get_history, get_institutions, # noqa
get_locations, get_summary) get_locations, get_summary, get_financials)
from .metadata import meta_dict # noqa from .metadata import meta_dict # noqa

View File

@ -50,6 +50,14 @@ class BF:
'offset': 0, 'offset': 0,
'format': 'json', 'format': 'json',
'search': False 'search': False
},
'financials': {
'sort_by': 'REPDTE',
'sort_order': 'DESC',
'limit': 10000,
'offset': 0,
'format': 'json',
'download': False
} }
} }
@ -121,6 +129,7 @@ class BF:
search: str = None, search: str = None,
**kwargs): **kwargs):
params = self._construct_params(key, filters, search, **kwargs) params = self._construct_params(key, filters, search, **kwargs)
print(urllib.parse.urlencode(params))
r = requests.get( r = requests.get(
f"https://banks.data.fdic.gov/api/{key}", f"https://banks.data.fdic.gov/api/{key}",
params=urllib.parse.urlencode(params) params=urllib.parse.urlencode(params)

View File

@ -3,6 +3,7 @@ from .history import history_dict
from .institution import institution_dict from .institution import institution_dict
from .location import location_dict from .location import location_dict
from .summary import summary_dict from .summary import summary_dict
from .financials import financials_dict
meta_dict = { meta_dict = {
@ -10,5 +11,6 @@ meta_dict = {
'history': history_dict, 'history': history_dict,
'institutions': institution_dict, 'institutions': institution_dict,
'locations': location_dict, 'locations': location_dict,
'summary': summary_dict 'summary': summary_dict,
'financials': financials_dict
} }