Introduction
This project provides some tools to access data from the FDIC public API and data resources.
Work in progress; more docs coming soon.
Usage
To try out these tools, install via pip install fdic or download the source code from GitHub. Then start a python interpreter and do something like the following:
First we import various modules and set ftool to be the tool we want:
>>> import fdic.query, json
>>> ftool = fdic.query.FDICTools
Now we can get the institutional data from the FDIC and sort it first by assets and then by deposits. We print the result in JSON format as a sanity check and see the largest 3 banks by assets:
>>> inst_data = ftool.get_sorted_inst_data()
>>> top_3_by_assets = inst_data[:3]
>>> print(json.dumps({i['NAME']: {n: i[n] for n in ['ASSET', 'DEP']}
... for i in top_3_by_assets}, indent=2))
{
"JPMorgan Chase Bank, National Association": {
"ASSET": "3201942000",
"DEP": "2440722000"
},
"Bank of America, National Association": {
"ASSET": "2418508000",
"DEP": "2042255000"
},
"Citibank, National Association": {
"ASSET": "1766752000",
"DEP": "1399631000"
}
}
Next we pull in the Uniform Bank Performance Report data. Note that you will have to download a zip file with this data first. If you don’t, you will get a NeedUBPRZipFile exception telling you how to download the necessary file.
To save time in parsing, we can provide an rssdfilter to just get data for the top 200 banks by assets. After getting the data, we sort by the UBPRE569 field (unrealized losses as a percent of tier 1 capital for held-to-maturity assets) and then print the data:
>>> ubpr_data = ftool.get_ubpr_inst_data(rssd_filter={
... i['FED_RSSD'] for i in inst_data[:50]})
>>> htm_data = list(sorted(ubpr_data, key=lambda i: i['UBPRE569']))
>>> print(json.dumps({i['NAME']: {n: i[n] for n in ['NAME', 'UBPRE569']}
... for i in htm_data[:3]}, indent=2))
{
"Silicon Valley Bank": {
"NAME": "Silicon Valley Bank",
"UBPRE569": -89.2
},
"Bank of America, National Association": {
"NAME": "Bank of America, National Association",
"UBPRE569": -59.95
},
"Charles Schwab Bank, SSB": {
"NAME": "Charles Schwab Bank, SSB",
"UBPRE569": -46.87
}
}
You can find a list of the UBPR codes at the Federal Reserve. For example if you are interested in both UBPRE569 (unrealized losses on the held-to-maturity portfolio as percent of tier 1 capital) as well as UBPRM037 (appreciation in available for sale securities / percent of available for sale securities), you could do something like the following:
>>> codes = {
... 'UBPRE569': {'convert': float},
... 'UBPRM037': {'convert': float},
... }
>>> ubpr_data = ftool.get_ubpr_inst_data(rssd_filter={
... i['FED_RSSD'] for i in inst_data[:50]}, codes=codes)
>>> htm_data = list(sorted(ubpr_data, key=lambda i: i['UBPRE569']))
>>> print(json.dumps({i['NAME']: {n: i[n] for n in (['NAME']+list(codes))}
... for i in htm_data[:3]}, indent=2))
{
"Silicon Valley Bank": {
"NAME": "Silicon Valley Bank",
"UBPRE569": -89.2,
"UBPRM037": -8.86
},
"Bank of America, National Association": {
"NAME": "Bank of America, National Association",
"UBPRE569": -59.95,
"UBPRM037": -2.0
},
"Charles Schwab Bank, SSB": {
"NAME": "Charles Schwab Bank, SSB",
"UBPRE569": -46.87,
"UBPRM037": -8.17
}
}
Metadata
Release files for fdic 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fdic-0.1.3.tar.gz | 6.7 kB | Without provenance | Details for fdic-0.1.3.tar.gz |
Release files / fdic-0.1.3.tar.gz
| Download URL | fdic-0.1.3.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f390c04b22112a1e64198bac5a49e25527ca861f28a7973d831162889b98f6e6
|
|
BLAKE2b-256 checksum How to use checksums |
ec392c3b281f1cc6f977908b99e4dc299be77644b432045288f6e932920c251a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|
Security for fdic 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.