Compare commits

..

No commits in common. "gh-pages" and "master" have entirely different histories.

75 changed files with 38441 additions and 4030 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto

View File

@ -0,0 +1,54 @@
name: Test bankfind
run-name: ${{ gitea.actor }} is testing out bankfind 🐍
on:
- push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8' ]
name: Python ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setup Tests and Dependencies
run: |
python --version
pip install -U pip
pip install pytest coverage pytest-cov
pip install -r requirements.txt
- name: Run tests
run: |
pytest
- name: build package with flit
run: |
pip install -U flit
flit build
find dist
- name: upload package as artifact
# v4 doesn't work
# uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: bankfind
path: dist
- name: Build docs with mkdocs
run: |
pip install mkdocs mkdocs-material mkdocs-material-extensions
cd docs
mkdocs build
find site
- name: upload docs as artifact
# v4 doesn't work
# uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: bankfind-docs
path: docs/site

81
.gitignore vendored Normal file
View File

@ -0,0 +1,81 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# PyBuilder
target/
# pyenv
.python-version
# Environments
.venv
# mkdocs documentation
*/docs/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# Project
.vscode/
reference/
next.py
docs/site

25
.travis.yml Normal file
View File

@ -0,0 +1,25 @@
language: python
python:
- 3.6
- 3.7
- 3.8
before_install:
- python --version
- pip install -U pip
- pip install -U pytest
- pip install codecov
install:
- pip install Cython
- pip install -r requirements.txt
- pip install ".[test]" .
script: pytest
after_success:
- codecov
# deploy:
# provider: pypi
# username: "__token__"
# password:
# secure:
# on:
# tags: true
# python: 3.8

335
404.html
View File

@ -1,335 +0,0 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Python wrapper allowing developers access to the FDICs publically available bank data">
<meta name="author" content="Doug Guthrie">
<link rel="shortcut icon" href="/img/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.5.5">
<title>bankfind</title>
<link rel="stylesheet" href="/assets/stylesheets/main.63b94e9e.min.css">
<link rel="stylesheet" href="/assets/stylesheets/palette.7f672a1f.min.css">
<meta name="theme-color" content="">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
<link rel="stylesheet" href="/css/termynal.css">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-175202147-1","auto"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview",document.location.pathname)})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="black" data-md-color-accent="">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href="/." title="bankfind" class="md-header-nav__button md-logo" aria-label="bankfind">
<img src="/img/small_logo.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
bankfind
</span>
<span class="md-header-nav__topic md-ellipsis">
</span>
</div>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="/." title="bankfind" class="md-nav__button md-logo" aria-label="bankfind">
<img src="/img/small_logo.png" alt="logo">
</a>
bankfind
</label>
<div class="md-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="/." title="Home" class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="/functions/" title="Functions" class="md-nav__link">
Functions
</a>
</li>
<li class="md-nav__item">
<a href="/filtering/" title="Filtering" class="md-nav__link">
Filtering
</a>
</li>
<li class="md-nav__item">
<a href="/release_notes/" title="Release notes" class="md-nav__link">
Release notes
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<h1>404 - Not found</h1>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-footer-social">
<a href="https://github.com/dpguthrie" target="_blank" rel="noopener" title="github.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</a>
<a href="https://www.linkedin.com/in/douglas-guthrie-07994a48/" target="_blank" rel="noopener" title="www.linkedin.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg>
</a>
<a href="https://medium.com/@douglas.p.guthrie" target="_blank" rel="noopener" title="medium.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 32v448h448V32H0zm372.2 106.1l-24 23c-2.1 1.6-3.1 4.2-2.7 6.7v169.3c-.4 2.6.6 5.2 2.7 6.7l23.5 23v5.1h-118V367l24.3-23.6c2.4-2.4 2.4-3.1 2.4-6.7V199.8l-67.6 171.6h-9.1L125 199.8v115c-.7 4.8 1 9.7 4.4 13.2l31.6 38.3v5.1H71.2v-5.1l31.6-38.3c3.4-3.5 4.9-8.4 4.1-13.2v-133c.4-3.7-1-7.3-3.8-9.8L75 138.1V133h87.3l67.4 148L289 133.1h83.2v5z"/></svg>
</a>
<a href="https://dpguthrie.com" target="_blank" rel="noopener" title="dpguthrie.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="/assets/javascripts/vendor.d1f5a259.min.js"></script>
<script src="/assets/javascripts/bundle.f9edbbd5.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
<script>
app = initialize({
base: "/",
features: [],
search: Object.assign({
worker: "/assets/javascripts/worker/search.fae956e7.min.js"
}, typeof search !== "undefined" && search)
})
</script>
<script src="/js/termynal.js"></script>
<script src="/js/custom.js"></script>
</body>
</html>

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
# Changelog
## 0.0.1
- Ability to hit 5 separate endpoints (institutions, failures, history, locations, and summary) as well as filter and search according to the API specifications

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Doug Guthrie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

85
README.md Normal file
View File

@ -0,0 +1,85 @@
<p align="center">
<a href="#"><img src="docs/docs/img/logo.png"></a>
</p>
<p align="center">
<em>Python interface to the FDIC's API for publically available bank data</em>
</p>
<p align="center">
<a href="https://travis-ci.com/dpguthrie/bankfind" target="_blank">
<img src="https://travis-ci.com/dpguthrie/bankfind.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/dpguthrie/bankfind" target="_blank">
<img src="https://img.shields.io/codecov/c/github/dpguthrie/bankfind" alt="Coverage">
</a>
<a href="https://pypi.org/project/bankfind" target="_blank">
<img src="https://badge.fury.io/py/bankfind.svg" alt="Package version">
</a>
</p>
---
**Documentation**: <a target="_blank" href="https://bankfind.dpguthrie.com">https://bankfind.dpguthrie.com</a>
**Source Code**: <a target="_blank" href="https://github.com/dpguthrie/bankfind">https://github.com/dpguthrie/bankfind</a>
**FDIC Documentation**: <a target="_blank" href="https://banks.data.fdic.gov/docs/">https://banks.data.fdic.gov/docs/</a>
---
## Overview
**bankfind** is a python interface to publically available bank data from the FDIC.
There are currently, as of 4/15/2023, five endpoints that the FDIC has exposed to the public:
- **failures** - returns detail on failed financial institutions
- **institutions** - returns a list of financial institutions
- **history** - returns detail on structure change events
- **locations** - returns locations / branches of financial institutions
- **summary** - returns aggregate financial and structure data, subtotaled by year, regarding financial institutions
- **financial** - returns financial information for financial institutions
## Requirements
Python 2.7, 3.5+
- [Requests](https://requests.readthedocs.io/en/master/) - The elegant and simple HTTP library for Python, built for human beings.
- [Pandas](https://pandas.pydata.org/) - Fast, powerful, flexible and easy to use open source data analysis and manipulation tool
## Installation
```python
pip install bankfind
```
## Example
```python
import bankfind as bf
# Get Institutions
data = bf.get_institutions()
# Get Institutions from Colorado with high ROE
data = bf.get_institutions(filters="STNAME:Colorado AND ROE:[25 TO *]")
# Get Commercial Banks from Colorado that aren't S-Corps
data = bf.get_institutions(filters="STNAME:Colorado AND SUBCHAPS:0 AND CB:1")
```
## License
This project is licensed under the terms of the MIT license.
## Development
### Running Tests Locally
```bash
brew install python@3.8
mkvirtualenv -p /opt/homebrew/bin/python3.8 bankfind
pip install -U pip
pip install pytest coverage pytest-cov
pip install -r requirements.txt
pytest
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
/*!
* Lunr languages, `Danish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=f.cursor+3;if(d=f.limit,0<=r&&r<=f.limit){for(a=r;;){if(e=f.cursor,f.in_grouping(w,97,248)){f.cursor=e;break}if(f.cursor=e,e>=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d<a&&(d=a)}}function n(){var e,r;if(f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n<p.length;n++)r?a.push(new e.Token(p[n],{position:[f,p[n].length],index:a.length})):a.push(p[n]),f+=p[n].length;l=c+1}return a},e.ja.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.ja.stemmer,"stemmer-ja"),e.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.ja.trimmer=e.trimmerSupport.generateTrimmer(e.ja.wordCharacters),e.Pipeline.registerFunction(e.ja.trimmer,"trimmer-ja"),e.ja.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.ja.stopWordFilter,"stopWordFilter-ja"),e.jp=e.ja,e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.Pipeline.registerFunction(e.jp.trimmer,"trimmer-jp"),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});

View File

@ -1 +0,0 @@
module.exports=require("./lunr.ja");

View File

@ -1 +0,0 @@
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var t=Array.prototype.slice.call(arguments),i=t.join("-"),r="",n=[],s=[],p=0;p<t.length;++p)"en"==t[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[t[p]].wordCharacters,e[t[p]].stopWordFilter&&n.unshift(e[t[p]].stopWordFilter),e[t[p]].stemmer&&(n.push(e[t[p]].stemmer),s.push(e[t[p]].stemmer)));var o=e.trimmerSupport.generateTrimmer(r);return e.Pipeline.registerFunction(o,"lunr-multi-trimmer-"+i),n.unshift(o),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,n),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,s))}}}});

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
/*!
* Lunr languages, `Norwegian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});

View File

@ -1,18 +0,0 @@
/*!
* Lunr languages, `Swedish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
bankfind/__init__.py Normal file
View File

@ -0,0 +1,8 @@
"""Python interface to the FDIC's API for publically available bank data"""
__version__ = '0.0.1'
from .main import (get_failures, get_history, get_institutions, # noqa
get_locations, get_summary, get_financials)
from .metadata import meta_dict # noqa

140
bankfind/base.py Normal file
View File

@ -0,0 +1,140 @@
from io import StringIO
import urllib.parse
import pandas as pd
import requests
from requests.models import Response
from bankfind.metadata import meta_dict
class BF:
DEFAULTS = {
'institutions': {
'sort_by': 'OFFICES',
'sort_order': 'ASC',
'limit': 10000,
'offset': 0,
'format': 'json',
'search': True
},
'locations': {
'sort_by': 'NAME',
'sort_order': 'ASC',
'limit': 10000,
'offset': 0,
'format': 'json',
'search': False
},
'history': {
'sort_by': 'PROCDATE',
'sort_order': 'DESC',
'limit': 10000,
'offset': 0,
'format': 'json',
'search': True
},
'summary': {
'sort_by': 'YEAR',
'sort_order': 'DESC',
'limit': 10000,
'offset': 0,
'format': 'json',
'search': False
},
'failures': {
'sort_by': 'FAILDATE',
'sort_order': 'DESC',
'limit': 10000,
'offset': 0,
'format': 'json',
'search': False
},
'financials': {
'sort_by': 'REPDTE',
'sort_order': 'DESC',
'limit': 10000,
'offset': 0,
'format': 'json',
'download': False
}
}
def __init__(self):
pass
def _construct_params(
self,
key: str,
filters: str = None,
search: str = None,
**kwargs):
d = self.DEFAULTS[key]
params = {
'sort_by': kwargs.get('sort_by', d['sort_by']),
'sort_order': kwargs.get(
'sort_order', d['sort_order']),
'limit': kwargs.get('limit', d['limit']),
'offset': kwargs.get('offset', d['offset']),
'format': 'csv' if kwargs.get('output') == 'pandas' else 'json',
'download': 'false',
'fields': kwargs.get(
'fields', ','.join(list(meta_dict[key].keys())))
}
if filters:
params.update({'filters': filters})
if search and d['search']:
params.update({'search': search})
return params
def _friendly_fields(self, key, data, dataframe=True):
meta = meta_dict[key]
if isinstance(data, list):
data = pd.DataFrame([i['data'] for i in data])
data.columns = data.columns.map(
dict((k, meta[k]['title'])
for k in meta.keys() if k in data.columns))
if dataframe:
return data
return data.to_dict(orient='records')
def _to_json(
self,
key: str,
response: Response,
friendly_fields: bool = False):
json_data = response.json()
if friendly_fields:
json_data['data'] = self._friendly_fields(
key, json_data['data'], dataframe=False)
else:
json_data['data'] = [i['data'] for i in json_data['data']]
return json_data
def _to_pandas(
self,
key: str,
response: Response,
friendly_fields: bool = False):
df = pd.read_csv(StringIO(response.text))
if friendly_fields:
df = self._friendly_fields(key, df)
return df
def _get_data(
self,
key: str,
filters: str = None,
search: str = None,
**kwargs):
params = self._construct_params(key, filters, search, **kwargs)
print(urllib.parse.urlencode(params))
r = requests.get(
f"https://banks.data.fdic.gov/api/{key}",
params=urllib.parse.urlencode(params)
)
if r.ok:
return getattr(self, f"_to_{kwargs.get('output', 'json')}")(
key, r, kwargs.get('friendly_fields', False))
return r

195
bankfind/main.py Normal file
View File

@ -0,0 +1,195 @@
from bankfind.base import BF
def get_failures(filters: str = None, **kwargs):
"""
Detail on failed financial institutions
Arguments
---------
filters: str, default None, optional
Filter for the bank search
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
format: str, default json, optional
Format of the data to return
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("failures", filters, **kwargs)
def get_history(filters: str = None, search: str = None, **kwargs):
"""
Detail on structure change events
Arguments
---------
filters: str, default None, optional
Filter for the bank search
search: str
Flexible text search against institution records. Currently, only
supports name search. Text search and fuzzy matching is supported
as well.
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
output: str, default json, optional
Format of the data to return, json or pandas
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("history", filters, search, **kwargs)
def get_institutions(filters: str = None, search: str = None, **kwargs):
"""
List of financial institutions
Arguments
---------
filters: str, default None, optional
Filter for the bank search
search: str
Flexible text search against institution records. Currently, only
supports name search. Text search and fuzzy matching is supported
as well.
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
format: str, default json, optional
Format of the data to return
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("institutions", filters, search, **kwargs)
def get_locations(filters: str = None, **kwargs):
"""
List of locations / branches of financial institutions
Arguments
---------
filters: str, default None, optional
Filter for the bank search
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
format: str, default json, optional
Format of the data to return
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("locations", filters, **kwargs)
def get_summary(filters: str = None, **kwargs):
"""
Aggregate financial and structure data, subtotaled by year
Arguments
---------
filters: str, default None, optional
Filter for the bank search
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
format: str, default json, optional
Format of the data to return
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("summary", filters, **kwargs)
def get_financials(filters: str = None, **kwargs):
"""
Get Financial Information for FDIC Insured Institutions
Arguments
---------
filters: str, default None, optional
Filter for the bank search
Keyword Arguments
-----------------
fields: str, default ALL FIELDS, optional
Comma delimited list of fields to search
sort_by: str, default OFFICES, optional
Field name by which to sort returned data
sort_order: str, default ASC, optional
Indicator if ascending (ASC) or descending (DESC)
limit: int, default 10,000, optional
Number of records to return. Maximum is 10,000
offset: int, default 0, optional
Offset of page to return
agg_by: str, default blank
The field(s) by which data will be aggregated.
agg_term_fields: str, default blank
The field(s) for which aggregations will be counted for each unique term.
agg_sum_fields: str, default blank
The field(s) for which aggregations will be summed or aggregated.
agg_limit: int,
The limit on how many aggregated results will be displayed
format: str, default json, optional
Format of the data to return
download: bool, default False
Whether the data should be downloaded as a file.
filename: str,
The filename to use when downloading data
friendly_fields: bool, default False, optional
Return friendly field names
"""
return BF()._get_data("financials", filters, **kwargs)

View File

@ -0,0 +1,16 @@
from .failure import failure_dict
from .history import history_dict
from .institution import institution_dict
from .location import location_dict
from .summary import summary_dict
from .financials import financials_dict
meta_dict = {
'failures': failure_dict,
'history': history_dict,
'institutions': institution_dict,
'locations': location_dict,
'summary': summary_dict,
'financials': financials_dict
}

View File

@ -0,0 +1,93 @@
failure_dict = {
'NAME': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Institution Name',
'description': "This is the legal name of the institution. When available, the Institution's name links to useful information for the customers and vendors of these institutions. This information includes press releases, information about the acquiring institution, (if applicable), how your accounts and loans are affected, and how vendors can file claims against the receivership."
},
'CERT': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Cert',
'description': 'The certificate number assigned by the FDIC used to identify institutions and for the issuance of insurance certificates. By clicking on this number, you will link to the Institution Directory (ID) system which will provide the last demographic and financial data filed by the selected institution.'
},
'FIN': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'FIN',
'description': 'Financial Institution Number (FIN) is a unique number assigned to the institution as an Assistance Agreement, Conservatorship, Bridge Bank or Receivership.'
},
'CITYST': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Location',
'description': 'The city and state (or territory) of the headquarters of the institution.'
},
'FAILDATE': {
'type': 'string',
'format': 'date-time',
'title': 'Effective Date',
'description': 'The date that the failed / assisted institution ceased to exist as a privately held going concern. For institutions that entered into government ownership, such as FDIC Bridge Banks and RTC conservatorships, this is the date that they entered into such ownership.'
},
'FAILYR': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Year',
'description': 'The 4-digit year that the failed / assisted institution ceased to exist as a privately held going concern. For institutions that entered into government ownership, such as FDIC Bridge Banks and RTC conservatorships, this is the date that they entered into such ownership.'
},
'SAVR': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Insurance Fund',
'description': 'Before 1989, there were two federal deposit insurance funds, one administered by the FDIC, which insured deposits in commercial banks and state-chartered savings banks, and another administered by the Federal Savings and Loan Insurance Corporation (FSLIC), which insured deposits in state- and federally-chartered savings associations. In 1989, the Financial Institutions Reform, Recovery and Enforcement Act (FIRREA) specified that thereafter the FDIC would be the federal deposit insurer of all banks and savings associations and would administer both the FDIC fund, which was renamed the Bank Insurance Fund (BIF) and the replacement for the insolvent FSLIC fund, which was called the Savings Association Insurance Fund (SAIF). Although it was created in 1989, the SAIF was not responsible for savings association failures until 1996. From 1989 through 1995, savings association failures were the responsibility of the Resolution Trust Corporation (RTC). In February 2006, The Federal Deposit Insurance Reform Act of 2005 provided for the merger of the BIF and the SAIF into a single Deposit Insurance Fund (DIF). Necessary technical and conforming changes to the law were made under The Federal Deposit Insurance Reform Conforming Amendments Act of 2005. The merger of the funds was effective on March 31, 2006. For additional information about deposit insurance fund and legislation, go to http://www.fdic.gov/deposit/insurance/index.html.',
'options': ['BIF', 'RTC', 'FSLIC', 'SAIF', 'DIF', 'FDIC']
},
'RESTYPE1': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Transaction Type',
'description': "Institutions have been resolved through several different types of transactions. The transaction types outlined below can be grouped into three general categories, based upon the method employed to protect insured depositors and how each transaction affects a failed / assisted institution's charter. In most assistance transactions, insured and uninsured depositors are protected, the failed / assisted institution remains open and its charter survives the resolution process. In purchase and assumption transactions, the failed / assisted institution's insured deposits are transferred to a successor institution, and its charter is closed. In most of these transactions, additional liabilities and assets are also transferred to the successor institution. In payoff transactions, the deposit insurer - the FDIC or the former Federal Savings and Loan Insurance Corporation - pays insured depositors, the failed / assisted institution's charter is closed, and there is no successor institution. For a more complete description of resolution transactions and the FDIC's receivership activities, see Managing the Crisis: The FDIC and RTC Experience, a study prepared by the FDIC's Division of Resolutions and Receiverships. Copies are available from the FDIC's Public Information Center.\nCategory 1 - Institution's charter survives\nA/A\t- Assistance Transactions. These include: 1) transactions where assistance was provided to the acquirer, who purchased the entire institution. For a few FSLIC transactions, the acquirer purchased the entire bridge bank - type entity, but certain other assets were moved into a liquidating receivership prior to the sale, and 2) open bank assistance transactions, including those where assistance was provided under a systemic risk determination (in such cases any costs that exceed the amounts estimated under the least cost resolution requirement would be recovered through a special assessment on all FDIC-insured institutions).\nREP -\tReprivatization, management takeover with or without assistance at takeover, followed by a sale with or without additional assistance.\nCategory 2 - Institution's charter is terminated, insured deposits plus some assets and other liabilities are transferred to a successor charter\nP&A - Purchase and Assumption, where some or all of the deposits, certain other liabilities and a portion of the assets (sometimes all of the assets) were sold to an acquirer. It was not determined if all of the deposits (PA) or only the insured deposits (PI) were assumed.\nPA - Purchase and Assumption, where the insured and uninsured deposits, certain other liabilities and a portion of the assets were sold to an acquirer.\nPI - Purchase and Assumption of the insured deposits only, where the traditional P&A was modified so that only the insured deposits were assumed by the acquiring institution.\nIDT - Insured Deposit Transfer, where the acquiring institution served as a paying agent for the insurer, established accounts on their books for depositors, and often acquired some assets as well. Includes ABT (asset-backed transfer, a FSLIC transaction that is very similar to an IDT).\nMGR - An institution where FSLIC took over management and generally provided financial assistance. FSLIC closed down before the institution was sold.\nCategory 3\nPO - Payout, where the insurer paid the depositors directly and placed the assets in a liquidating receivership. Note: Includes transactions where the FDIC established a Deposit Insurance National Bank to facilitate the payout process.",
'options': ['A/A', 'REP', 'P&A', 'PA', 'PI', 'IDT', 'MGR', 'PO']
},
'CHCLASS1': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Charter Class',
'description': "The FDIC assigns classification codes indicating an institution's charter type (commercial bank, savings bank, or savings association), its chartering agent (state or federal government), its Federal Reserve membership status (member or nonmember), and its primary federal regulator (state-chartered institutions are subject to both federal and state supervision). These codes are:\nN - National chartered commercial bank supervised by the Office of the Comptroller of the Currency;\nSM - State charter Fed member commercial bank supervised by the Federal Reserve;\nNM - State charter Fed nonmember commercial bank supervised by the FDIC;\nSA - State or federal charter savings association supervised by the Office of Thrift Supervision or Office of the Comptroller of the Currency;\nSB - State charter savings bank supervised by the FDIC.",
'options': ['N', 'SM', 'NM', 'SA', 'SB']
},
'RESTYPE': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Resolution',
'description': 'The given institution has failure stature or it can be assistance has been provided by FDIC in merging with other institution.',
'options': ['Failure', 'Assistance']
},
'QBFDEP': {
'type': 'number',
'x-elastic-type': 'double',
'x-number-unit': 'Thousands of US Dollars',
'title': 'Total Deposits',
'description': 'Total including demand deposits, money market deposits, other savings deposits, time deposits and deposits in foreign offices as of the last Call Report or Thrift Financial Report filed by the institution prior to the effective date. Note this does not necessarily reflect total deposits on the last report filed because in some cases reports were filed after the effective date.'
},
'QBFASSET': {
'type': 'number',
'x-elastic-type': 'double',
'x-number-unit': 'Thousands of US Dollars',
'title': 'Total Assets',
'description': 'The Total assets owned by the institution including cash, loans, securities, bank premises and other assets as of the last Call Report or Thrift Financial Report filed by the institution prior to the effective date. Note this does not necessarily reflect total assets on the last report filed because in some cases reports were filed after the effective date. This total does not include off-balance-sheet accounts.'
},
'COST': {
'type': 'number',
'x-elastic-type': 'double',
'x-number-unit': 'Thousands of US Dollars',
'title': 'Estimated Loss',
'description': 'The estimated loss is the difference between the amount disbursed from the Deposit Insurance Fund (DIF) to cover obligations to insured depositors and the amount estimated to be ultimately recovered from the liquidation of the receivership estate. Estimated losses reflect unpaid principal amounts deemed unrecoverable and do not reflect interest that may be due on the DIF\'s administrative or subrogated claims should its principal be repaid in full.\nNotes:\nComprehensive data on estimated losses are not available for FDIC-insured failures prior to 1986, or for FSLIC-insured failures from 1934-88. Estimated loss is presented as "N/A" in years for which comprehensive information is not available.\nEstimated Loss data was previously referred to as \'Estimated Cost\' in past releases of the Historical Statistic on Banking. For RTC receiverships, the \'Estimated Cost\' included an allocation of FDIC corporate revenue and expense items such as interest expense on Federal Financing Bank debt, interest expense on escrowed funds and interest revenue on advances to receiverships. Other FDIC receiverships did not include such an allocation. To maintain consistency with FDIC receiverships, the RTC allocation is no longer reflected in the estimated loss amounts for failed / assisted institutions that were resolved through RTC receiverships.\nBeginning with the release of 2007 information, the \'Estimated Loss\' in the Historical Statistics on Banking is presented and defined consistently with the aggregate Estimated Receivership Loss for FRF-RTC institutions and Estimated Losses for FDIC receiverships that are reported in the FDIC\'s Annual Report. The estimated loss is obtained from the FDIC\'s Failed Bank Cost Analysis (FBCA) report and the RTC Loss report. The FBCA provides data for receiverships back to 1986. The RTC Loss Report provides similar data back to 1989. \nQuestions regarding Estimated Loss should be sent to DOFBusinessCenter@fdic.gov. \nAlso, for more detail regarding resolution transactions and the FDIC\'s receivership activities, see Managing the Crisis: The FDIC and RTC Experience, a historical study prepared by the FDIC\'s Division of Resolutions and Receiverships. Copies are available from the FDIC\'s Public Information Center.'
},
'PSTALP': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'State',
'description': 'Two-character alphanumeric code for US state or Territory'
}
}

File diff suppressed because it is too large Load Diff

2108
bankfind/metadata/history.py Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,348 @@
location_dict = {
'ADDRESS': {
'type': 'string',
'title': 'Branch Address',
'description': 'Street address at which the branch is physically located.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'LOCN_PHY_LNE1_TXT'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'LOCN_ADDR_LNE1_TXT'
}]
},
'BKCLASS': {
'type': 'string',
'title': 'Institution Class',
'description': "A classification code assigned by the FDIC based on the institution''s charter type (commercial bank or savings institution), charter agent (state or federal), Federal Reserve membership status (Fed member, Fed nonmember) and its primary federal regulator (state chartered institutions are subject to both federal and state supervision). N - Commercial bank, national (federal) charter and Fed member, supervised by the Office of the Comptroller of the Currency (OCC); NM - Commercial bank, state charter and Fed nonmember, supervised by the FDIC; OI - Insured U.S. branch of a foreign chartered institution (IBA); SA - Savings associations, state or federal charter, supervised by the Office of Thrift Supervision (OTS); SB - Savings banks, state charter, supervised by the FDIC; SM - Commercial bank, state charter and Fed member, supervised by the Federal Reserve (FRB)",
'options': ['N', 'NM', 'OI', 'SA', 'SB', 'SM'],
'x-source-mapping': [{
'formula': {
'type': 'raw',
'parameters': {
'script': 'if(ctx.INST_CLASS_CDE?.toLowerCase() == "sb" || ctx.INST_CLASS_CDE?.toLowerCase() == "sl") { \n ctx.BKCLASS = \'SA\'; \n} else if (ctx.INST_CLASS_CDE?.toLowerCase() == "mi" || ctx.INST_CLASS_CDE?.toLowerCase() == "si") { \n ctx.BKCLASS = \'SB\';\n} else {\n ctx.BKCLASS = ctx.INST_CLASS_CDE;\n}\n'
}
}
}]
},
'CBSA': {
'type': 'string',
'title': 'Core Based Statistical Area Name (Branch)',
'description': 'Name of the Core Based Statistical Area (CBSA) as defined by the US Census Bureau Office of Management and Budget.',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CBSANAME'
}]
},
'CBSA_DIV': {
'type': 'string',
'title': 'Metropolitan Divisions Name (Branch)',
'description': 'Name of the Core Based Statistical Division as defined by the US Census Bureau Office of Management and Budget.',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CBSA_DIV_NAME'
}]
},
'CBSA_DIV_FLG': {
'type': 'string',
'title': 'Metropolitan Divisions Flag (Branch)',
'description': 'A flag (1=Yes) indicating member of a Core Based Statistical Division as defined by the US Census Bureau Office of Management and Budget.',
'options': [0, 1],
'x-source-mapping': [{
'file': 'RELATION',
'field': 'DIVISION_FLAG'
}]
},
'CBSA_DIV_NO': {
'type': 'string',
'title': 'Metropolitan Divisions Number (Branch)',
'description': 'Numeric code of the Core Based Statistical Division as defined by the US Census Bureau Office of Management and Budget.',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CBSA_DIVISION'
}]
},
'CBSA_METRO': {
'type': 'string',
'title': 'Metropolitan Division Number (Branch)',
'description': 'Numeric code of the Metropolitan Statistical Area as defined by the US Census Bureau Office of Management and Budget',
'x-source-mapping': [{
'formula': {
'type': 'raw',
'parameters': {
'script': 'if(ctx.CBSA_METRO_FLG == "1") {\n ctx.CBSA_METRO = ctx.CBSA_NO;\n} else {\n ctx.CBSA_METRO = 0;\n} \n'
}
}
}]
},
'CBSA_METRO_FLG': {
'type': 'string',
'title': 'Metropolitan Division Flag (Branch)',
'description': 'A flag (1=Yes) used to indicate whether an branch is in a Metropolitan Statistical Area as defined by the US Census Bureau Office of Management and Budget',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'METRO_FLAG'
}]
},
'CBSA_METRO_NAME': {
'type': 'string',
'title': 'Metropolitan Division Name (Branch)',
'description': 'Name of the Metropolitan Statistical Area as defined by the US Census Bureau Office of Management and Budget',
'x-source-mapping': [{
'formula': {
'type': 'raw',
'parameters': {
'script': 'if(ctx.CBSA_METRO_FLG == "1") {\n ctx.CBSA_METRO_NAME = ctx.CBSA;\n} else {\n ctx.CBSA_METRO_NAME = 0;\n}\n'
}
}
}]
},
'CBSA_MICRO_FLG': {
'type': 'string',
'title': 'Micropolitan Division Flag (Branch)',
'description': 'A flag (1=Yes) used to indicate whether an branch is in a Micropolitan Statistical Area as defined by the US Census Bureau Office of Management and Budget',
'options': [0, 1],
'x-source-mapping': [{
'file': 'RELATION',
'field': 'MICRO_FLAG'
}]
},
'CBSA_NO': {
'type': 'string',
'title': 'Core Based Statistical Areas (Branch)',
'description': 'Numeric code of the Core Based Statistical Area (CBSA) as defined by the US Census Bureau Office of Management and Budget.',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CBSA'
}]
},
'CERT': {
'type': 'string',
'title': 'Institution FDIC Certificate #',
'description': 'A unique number assigned by the FDIC used to identify institutions and for the issuance of insurance certificates.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'ORG_CERT_NUM'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'ORG_CERT_NUM'
}]
},
'CITY': {
'type': 'string',
'title': 'Branch City',
'description': 'City in which branch is physically located.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'LOCN_PHY_CTY_NME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'LOCN_CTY_NME'
}]
},
'COUNTY': {
'type': 'string',
'title': 'Branch County',
'description': 'County where the branch is physically located.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'LOCN_PHY_CNTY_NME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'LOCN_CNTY_NME'
}]
},
'CSA': {
'type': 'string',
'title': 'Combined Statistical Area Name (Branch)',
'description': 'Name of the Combined Statistical Area (CSA) as defined by the US Census Bureau Office of Management and Budget',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CSANAME'
}]
},
'CSA_FLG': {
'type': 'string',
'title': 'Combined Statistical Area Flag (Branch)',
'description': 'Flag (1=Yes) indicating member of a Combined Statistical Area (CSA) as defined by the US Census Bureau Office of Management and Budget',
'options': [0, 1],
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CSA_FLAG'
}]
},
'CSA_NO': {
'type': 'string',
'title': 'Combined Statistical Area Number (Branch)',
'description': 'Numeric code of the Combined Statistical Area (CSA) as defined by the US Census Bureau Office of Management and Budget',
'x-source-mapping': [{
'file': 'RELATION',
'field': 'CSA'
}]
},
'ESTYMD': {
'type': 'string',
'format': 'date-time',
'title': 'Branch Established Date',
'description': 'The date on which the branch began operations.',
'x-source-mapping': [{
'formula': {
'type': 'date',
'parameters': {
'inputFormat': "yyyy-MM-dd'T'HH:mm:ss",
'outputFormat': 'MM/dd/yyyy',
'inputField': 'ESTYMD_RAW',
'outputField': 'ESTYMD'
}
}
}]
},
'FI_UNINUM': {
'type': 'string',
'title': 'FDIC UNINUM of the Owner Institution',
'description': 'This is the FDIC UNINUM of the institution that owns the branch. A UNINUM is a unique sequentially number added to the FDIC database for both banks and branches. There is no pattern imbedded within the number. The FI_UNINUM is updated with every merger or purchase of branches to reflect the most current owner.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'ORG_UNIQ_NUM'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'FI_ORG_UNIQ_NUM'
}]
},
'MAINOFF': {
'type': 'number',
'title': 'Main Office',
'description': 'Flag (1=Yes) indicating this location is the main office for the institution.',
'options': [0, 1],
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'MAINOFF'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'MAINOFF'
}]
},
'NAME': {
'type': 'string',
'x-elastic-type': 'keyword',
'title': 'Institution Name',
'description': 'Legal name of the FDIC Insured Institution',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'INST_FIN_LGL_NME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'INST_FIN_LGL_NME'
}]
},
'OFFNAME': {
'type': 'string',
'title': 'Office Name',
'description': 'Name of the branch.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'INST_FIN_LGL_NME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'INST_BR_NME'
}]
},
'OFFNUM': {
'type': 'string',
'title': 'Branch Number',
'description': "The branch's corresponding office number.",
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'OFFNUM'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'INST_BR_OFC_NUM'
}]
},
'RUNDATE': {
'type': 'string',
'format': 'date-time',
'title': 'Run Date',
'description': 'The day the institution information was updated.',
'x-source-mapping': [{
'formula': {
'type': 'simpleSetScript',
'parameters': {
'setField': 'RUNDATE',
'script': 'new SimpleDateFormat("MM/dd/yyyy").format(new Date())'
}
}
}]
},
'SERVTYPE': {
'type': 'number',
'title': 'Service Type Code',
'description': 'Define the various types of offices of FDIC-insured institutions. 11 - Full Service Brick and Mortar Office; 12 - Full Service Retail Office; 13 - Full Service Cyber Office; 14 - Full Service Mobile Office; 15 - Full Service Home/Phone Banking; 16 - Full Service Seasonal Office; 21 - Limited Service Administrative Office; 22 - Limited Service Military Facility; 23 - Limited Service Facility Office; 24 - Limited Service Loan Production Office; 25 - Limited Service Consumer Credit Office; 26 - Limited Service Contractual Office; 27 - Limited Service Messenger Office; 28 - Limited Service Retail Office; 29 - Limited Service Mobile Office; 30 - Limited Service Trust Office;',
'options': [11, 12, 13, 14, 15, 16, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'SERVTYPE'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'INST_BR_SVC_NUM'
}]
},
'STALP': {
'type': 'string',
'title': 'Branch State Abbreviation',
'description': 'State abbreviation in which the branch is physically located. The FDIC Act defines state as any State of the United States, the District of Columbia, and any territory of the United States, Puerto Rico, Guam, American Samoa, the Trust Territory of the Pacific Islands, the Virgin Island, and the Northern Mariana Islands.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'LOCN_PHY_ST_ABNME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'LOCN_ST_ABBV_NME'
}]
},
'STCNTY': {
'type': 'string',
'title': 'State and County Number',
'description': 'A five digit number representing the state and county in which the institution is physically located. The first two digits represent the FIPS state numeric code and the last three digits represent the FIPS county numeric code.',
'x-source-mapping': [{
'file': 'CALCULATED_IN_PIPELINE',
'field': 'N/A'
}]
},
'STNAME': {
'type': 'string',
'title': 'Branch State',
'description': 'State in which the branch is physically located. The FDIC Act defines state as any State of the United States, the District of Columbia, and any territory of the United States, Puerto Rico, Guam, American Samoa, the Trust Territory of the Pacific Islands, the Virgin Island, and the Northern Mariana Islands.',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'LOCN_PHY_ST_NME'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'LOCN_ST_NME'
}]
},
'UNINUM': {
'type': 'string',
'title': 'Unique Identification Number for a Branch Office',
'description': 'Unique Identification Number for a Branch Office as assigned by the FDIC',
'x-source-mapping': [{
'file': 'VINST_FIN_CUR_SDC',
'field': 'ORG_UNIQ_NUM'
}, {
'file': 'VINST_BR_CUR_SDC',
'field': 'ORG_UNIQ_NUM'
}]
},
'ZIP': {
'type': 'string',
'title': 'Branch Zip Code',
'description': 'The first five digits of the full postal zip code representing physical location of the branch.',
'x-source-mapping': [{
'formula': {
'type': 'raw',
'parameters': {
'script': "if (ctx.ZIP_RAW != null && ctx.ZIP_RAW?.length() < 5){\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < 5; i++) {\n sb.append('0');\n }\n ctx.ZIP = sb.substring(ctx.ZIP_RAW.length()) + ctx.ZIP_RAW;\n} else {\n ctx.ZIP = ctx.ZIP_RAW;\n}"
}
}
}]
}
}

1178
bankfind/metadata/summary.py Normal file

File diff suppressed because it is too large Load Diff

0
CNAME → docs/docs/CNAME Executable file → Normal file
View File

0
css/termynal.css → docs/docs/css/termynal.css Executable file → Normal file
View File

156
docs/docs/filtering.md Normal file
View File

@ -0,0 +1,156 @@
The API uses the Elastic Search [query string syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax) for filtering.
## Overview
First, get an idea of what fields you can use to filter from the `meta_dict`.
```python
>>> import bankfind as bf
>>> fields = bf.meta_dict.keys()
dict_keys(['failures', 'history', 'institutions', 'locations', 'summary'])
```
Each of the keys above represent an endpoint. The values corresponding to each of the keys above are dictionaries. The dictionaries contain the fields available as well as the data type, description, and, sometimes, options to filter with.
```python
>>> bf.meta_dict['failures'].keys()
dict_keys(['NAME', 'CERT', 'FIN', 'CITYST', 'FAILDATE', 'FAILYR', 'SAVR', 'RESTYPE1', 'CHCLASS1', 'RESTYPE', 'QBFDEP', 'QBFASSET', 'COST', 'PSTALP'])
>>> bf.meta_dict['failures']['NAME']
{'type': 'string', 'x-elastic-type': 'keyword', 'title': 'Institution Name', 'description': "This is the legal name of the institution. When available, the Institution's name links to useful information for the customers and vendors of these institutions. This information includes press releases, information about the acquiring institution, (if applicable), how your accounts and loans are affected, and how vendors can file claims against the receivership."}
```
## Filters
The syntax for filtering will change based on the data-type.
### strings
**Syntax**: `<FIELD>:<VALUE>`
First, let's filter based on cert, which as you can see from the `meta_dict` is a string field.
```python
>>> bf.meta_dict['failures']['CERT']['type']
'string'
>>> data = bf.get_institutions(filters="CERT:57295")
>>> len(data['data'])
1
```
Chain filters together with "AND":
```python
>>> data = bf.get_institutions(filters="STNAME:Colorado AND CITY:Denver")
>>> len(data['data'])
108
```
Filtering with "OR" is easy also:
```python
>>> data = bf.get_institutions(filters='STNAME:("Colorado","Wyoming")')
>>> len(data['data'])
844
```
### dates
Dates must be entered in the following format:
**Syntax**: `<FIELD>:yyyy-mm-dd`
```python
>>> data = bf.get_institutions(filters='DATEUPDT:2019-12-31')
>>> len(data['data'])
3919
```
They can also be used as ranges:
#### exclusive
Use curly braces `{}` and the range will exclude the beginning and end dates used in the range:
**Syntax**: `<FIELD>:{yyyy-mm-dd TO yyyy-mm-dd}`
```python
>>> data = bf.get_institutions(filters='DATEUPDT:{2015-01-01 TO 2018-12-31}')
>>> len(data['data'])
1921
```
#### inclusive
Use brackets `[]` and the range will the include the beginning and end dates used in the range
**Syntax**: `<FIELD>:[yyyy-mm-dd TO yyyy-mm-dd]`
```python
>>> data = bf.get_institutions(filters='DATEUPDT:[2010-01-01 TO 2018-12-31]')
>>> len(data['data'])
4556
```
### numbers
Numbers can also be used in ranges with the same syntax as dates
#### exclusive
Use curly braces `{}` and the range will exclude the beginning and end values in the range. Most of the values are represented in thousands.
**Syntax**: `<FIELD>:{Number TO Number}`
```python
>>> data = bf.get_institutions(filters='ASSET:{25000 TO 75000}')
>>> len(data['data'])
5530
```
#### inclusive
Use brackets `[]` and the range will the include the beginning and end dates used in the range
**Syntax**: `<FIELD>:[Number TO Number]`
*The filter below will retrieve institutions with assets greater than or equal to 2 billion or less than or equal to 5 billion.*
```python
>>> data = bf.get_institutions(filters='ASSET:[2000000 TO 5000000]')
>>> len(data['data'])
685
```
#### wildcard
**Syntax**: `<FIELD>:[Number to *]`
*The filter below will retrieve institutions with assets greater than or equal to 5 billion.*
```python
>>> data = bf.get_institutions(filters='ASSET:[5000000 TO *]')
>>> len(data['data'])
602
```
## Search
Flexible text search is also available. Search supports text search and fuzzy matching, as opposed to filters that are exact matches. Currently, only two endpoints support the search functionality: `get_institutions` and `get_history`.
The only field that currently supports the search functionality is `NAME`. It's a similar syntax to the [string filter](#strings).
```python
>>> data = bf.get_institutions(search='NAME:AMG')
>>> len(data['data'])
5
```
Take it a little further:
```python
>>> data = bf.get_institutions(search='NAME:AMG National')
>>> len(data['data'])
1
```

588
docs/docs/functions.md Normal file
View File

@ -0,0 +1,588 @@
## **get_failures**
=== "Details"
- *Description*: Detail on failed financial institutions
- *Return*: `dict`
- *Arguments*
| Argument | Description | Type | Default | Required | Options |
|:-----------|:-----------------------------------------|:-----------------------------|:----------|:-----------|:--------------------------------------------------------------------------------------|
| filters | Filter(s) for the bank search | `str` | `None` | optional | |
| fields | Comma delimited list of fields to retrieve | `str` | All fields included by default | optional | | |
| sort_by | Field name by which to sort returned data | `str`| `FAILDATE` | optional | See meta_dict
| sort_order | Indicator if ascending or descending | `str` | `DESC` | optional | `ASC`<br>`DESC`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| offset | Offset of page to return | `int` | `0` | optional |
| output | Format of data to return | `str` | `json` | optional | `json`<br>`pandas`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| friendly_fields | Replace keys / column names with friendlier title | `bool` | `False` | optional | `True`<br>`False`
=== "Example"
```python hl_lines="3"
import bankfind as bf
data = bf.get_failures()
data['data'][0]
```
=== "Data"
```python
{
'data': {
'QBFDEP': 139526,
'PSTALP': 'WV',
'FIN': '10536',
'FAILDATE': '04/03/2020',
'RESTYPE': 'FAILURE',
'CITYST': 'BARBOURSVILLE, WV',
'SAVR': 'DIF',
'RESTYPE1': 'PA',
'CHCLASS1': 'NM',
'NAME': 'THE FIRST STATE BANK',
'COST': None,
'QBFASSET': 152400,
'CERT': 14361,
'FAILYR': '2020',
'ID': '4102'
},
'score': 1
}
```
## **get_history**
=== "Details"
- *Description*: Detail on structure change events
- *Return*: `dict`
- *Arguments*
| Argument | Description | Type | Default | Required | Options |
|:-----------|:-----------------------------------------|:-----------------------------|:----------|:-----------|:--------------------------------------------------------------------------------------|
| filters | Filter(s) for the bank search | `str` | `None` | optional | |
| search | Flexible text search against institution records (fuzzy name matching) | `str` | `None` | optional | |
| fields | Comma delimited list of fields to retrieve | `str` | All fields included by default | optional | | |
| sort_by | Field name by which to sort returned data | `str`| `FAILDATE` | optional | See meta_dict
| sort_order | Indicator if ascending or descending | `str` | `DESC` | optional | `ASC`<br>`DESC`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| offset | Offset of page to return | `int` | `0` | optional |
| output | Format of data to return | `str` | `json` | optional | `json`<br>`pandas`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| friendly_fields | Replace keys / column names with friendlier title | `bool` | `False` | optional | `True`<br>`False`
=== "Example"
```python hl_lines="3"
import bankfind as bf
data = bf.get_history()
data['data'][0]
```
=== "Data"
```python
{
'data': {
'REPORT_TYPE': 711,
'INSAGENT1': 'DIF',
'INSAGENT2': '',
'OFF_PCITY': 'Colorado Springs',
'EFFDATE': '2020-07-27T00:00:00',
'CHARTAGENT': 'STATE',
'PSTALP': 'NE',
'CLASS': 'NM',
'FRM_OFF_SERVTYPE': 0,
'OFF_LONGITUDE': -104.87635200138965,
'OFF_PSTATE': 'COLORADO',
'BANK_INSURED': 'Y',
'CNTYNUM': 157,
'INSTNAME': 'First State Bank',
'OFF_PADDR': '3216 W Colorado AVE',
'FRM_CLCODE': 0,
'OFF_SERVTYPE_DESC': 'FULL SERVICE - BRICK AND MORTAR',
'TRANSNUM': 202012234,
'MZIPREST': '0000',
'FDICREGION_DESC': 'KANSAS CITY',
'FRM_OFF_CLCODE': 0,
'PZIP5': '69361',
'OFF_PZIPREST': '1906',
'OFF_NAME': 'First State Bank Colorado Springs West Branch',
'CERT': 15586,
'OFF_PSTALP': 'CO',
'PCITY': 'SCOTTSBLUFF',
'LATITUDE': 0,
'PROCDATE': '2020-08-05T00:00:00',
'ACQDATE': '9999-12-31T00:00:00',
'CHANGECODE': 711,
'PADDR': '2002 BROADWAY',
'MZIP5': '69361',
'FI_UNINUM': 9873,
'LONGITUDE': 0,
'FRM_LATITUDE': 0,
'STATE': 'NEBRASKA',
'MSTALP': 'NE',
'CNTYNAME': 'SCOTTS BLUFF',
'ACQ_UNINUM': 0,
'OFF_CNTYNUM': 41,
'FI_EFFDATE': '2019-06-10T00:00:00',
'FDICREGION': 11,
'MSTATE': 'NEBRASKA',
'FRM_LONGITUDE': 0,
'OFF_CNTYNAME': 'EL PASO',
'CHANGECODE_DESC': 'BRANCH OPENING',
'MCITY': 'SCOTTSBLUFF',
'MADDR': 'P.O. BOX 1267',
'OFF_PZIP5': '80904',
'OUT_UNINUM': 0,
'PZIPREST': '0000',
'ORG_STAT_FLG': 'Y',
'FRM_OFF_LONGITUDE': 0,
'ENDDATE': '9999-12-31T00:00:00',
'UNINUM': 625952,
'OFF_NUM': 6,
'CLCODE': 21,
'OFF_SERVTYPE': 11,
'FRM_OFF_CNTYNUM': 0,
'ORG_ROLE_CDE': 'BR',
'REGAGENT': 'FDIC',
'OFF_LATITUDE': 38.85583298227556,
'ESTDATE': '2020-07-27T00:00:00',
'FRM_OFF_LATITUDE': 0,
'TRUST': 'Full',
'ID': '20eb98a36c7c77cf6bc019ce391ba7c9'
},
'score': 1
}
```
## **get_institutions**
=== "Details"
- *Description*: List of financial institutions
- *Return*: `dict`
- *Arguments*
| Argument | Description | Type | Default | Required | Options |
|:-----------|:-----------------------------------------|:-----------------------------|:----------|:-----------|:--------------------------------------------------------------------------------------|
| filters | Filter(s) for the bank search | `str` | `None` | optional | |
| search | Flexible text search against institution records (fuzzy name matching) | `str` | `None` | optional | |
| fields | Comma delimited list of fields to retrieve | `str` | All fields included by default | optional | | |
| sort_by | Field name by which to sort returned data | `str`| `FAILDATE` | optional | See meta_dict
| sort_order | Indicator if ascending or descending | `str` | `DESC` | optional | `ASC`<br>`DESC`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| offset | Offset of page to return | `int` | `0` | optional |
| output | Format of data to return | `str` | `json` | optional | `json`<br>`pandas`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| friendly_fields | Replace keys / column names with friendlier title | `bool` | `False` | optional | `True`<br>`False`
=== "Example"
```python hl_lines="3"
import bankfind as bf
data = bf.get_institutions()
data['data'][0]
```
=== "Data"
```python
{
'data': {
'ZIP': '31087',
'SASSER': 0,
'CHRTAGNT': 'STATE',
'CONSERVE': 'N',
'REGAGENT2': '',
'STNAME': 'Georgia',
'ROAQ': 0.65,
'INSDATE': '01/01/1934',
'TE06N528': '',
'TE06N529': '',
'OFFOA': 0,
'FDICDBS': '05',
'NAMEHCR': '',
'OCCDIST': '5',
'CMSA': '',
'DEPDOM': 59267,
'CBSA_METRO_FLG': '0',
'TE10N528': '',
'NETINC': 124,
'CBSA_DIV_NO': '',
'MUTUAL': '0',
'MSA_NO': '0',
'OFFFOR': 0,
'INSSAVE': 0,
'CHARTER': '0',
'RSSDHCR': '',
'TE04N528': '',
'TE04N529': '',
'CERT': '10057',
'STALP': 'GA',
'SPECGRP': 7,
'CFPBENDDTE': '31-Dec-9999',
'TE09N528': '',
'IBA': 0,
'INSBIF': 0,
'INSFDIC': 1,
'ENDEFYMD': '12/31/9999',
'MSA': '',
'TE02N528': '',
'CB': '1',
'TE02N529': '',
'TE07N528': '',
'FDICSUPV': 'Atlanta',
'FED': '6',
'REGAGNT': 'FDIC',
'NEWCERT': 0,
'ASSET': 76416,
'CBSA_MICRO_FLG': '1',
'OFFICES': 1,
'STCNTY': '13141',
'CSA_FLG': '0',
'CITY': 'Sparta',
'CLCODE': '21',
'INACTIVE': 0,
'CMSA_NO': '0',
'STALPHCR': '',
'INSAGNT1': 'DIF',
'BKCLASS': 'NM',
'EFFDATE': '08/31/2009',
'SUPRV_FD': '05',
'DATEUPDT': '09/02/2009',
'INSAGNT2': '',
'TE05N528': '',
'TE05N529': '',
'ROEQ': 2.96,
'FDICREGN': 'Atlanta',
'FLDOFF': 'Savannah',
'WEBADDR': 'http://www.bankofhancock.com',
'QBPRCOML': '2',
'COUNTY': 'Hancock',
'DOCKET': '0',
'ULTCERT': '10057',
'OTSDIST': '2',
'LAW_SASSER_FLG': 'N',
'PARCERT': '0',
'ROA': 0.65,
'CFPBFLAG': 0,
'RISDATE': '12/31/2019',
'ROE': 2.96,
'INSCOML': 1,
'OTSREGNM': 'Southeast',
'EQ': '17026',
'RUNDATE': '08/08/2020',
'TE03N528': '',
'TE03N529': '',
'NAME': 'Bank of Hancock County',
'HCTMULT': '',
'CBSA_DIV': '',
'ADDRESS': '12855 Broad Street',
'OFFDOM': 1,
'SUBCHAPS': '0',
'PROCDATE': '09/02/2009',
'INSSAIF': 0,
'DENOVO': '0',
'CBSA_NO': '33300',
'ACTIVE': 1,
'CFPBEFFDTE': '31-Dec-9999',
'STCHRTR': 1,
'REPDTE': '03/31/2020',
'FORM31': '0',
'CSA': '',
'INSDIF': 1,
'TE01N529': '',
'ROAPTX': 0.65,
'STNUM': '13',
'OAKAR': 0,
'SPECGRPN': 'Other Specialized Under 1 Billion',
'ROAPTXQ': 0.65,
'FED_RSSD': '37',
'CSA_NO': '',
'CBSA_METRO': 0,
'INSTCRCD': 0,
'DEP': 59267,
'UNINUM': '6429',
'INSTAG': '0',
'TE01N528': '',
'CITYHCR': '',
'TRACT': '0',
'CBSA': 'Milledgeville, GA',
'CBSA_DIV_FLG': '0',
'TE08N528': '',
'NETINCQ': 124,
'CHANGEC1': 520,
'CERTCONS': '0',
'ESTYMD': '09/01/1904',
'FEDCHRTR': 0,
'TRUST': '0',
'ID': '10057'
},
'score': 1
}
```
## **get_locations**
=== "Details"
- *Description*: Detail on failed financial institutions
- *Return*: `dict`
- *Arguments*
| Argument | Description | Type | Default | Required | Options |
|:-----------|:-----------------------------------------|:-----------------------------|:----------|:-----------|:--------------------------------------------------------------------------------------|
| filters | Filter(s) for the bank search | `str` | `None` | optional | |
| fields | Comma delimited list of fields to retrieve | `str` | All fields included by default | optional | | |
| sort_by | Field name by which to sort returned data | `str`| `FAILDATE` | optional | See meta_dict
| sort_order | Indicator if ascending or descending | `str` | `DESC` | optional | `ASC`<br>`DESC`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| offset | Offset of page to return | `int` | `0` | optional |
| output | Format of data to return | `str` | `json` | optional | `json`<br>`pandas`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| friendly_fields | Replace keys / column names with friendlier title | `bool` | `False` | optional | `True`<br>`False`
=== "Example"
```python hl_lines="3"
import bankfind as bf
data = bf.get_locations()
data['data'][0]
```
=== "Data"
```python
{
'data': {
'ZIP': '21613',
'CBSA_NO': '15700',
'BKCLASS': 'SM',
'FI_UNINUM': 3221,
'STNAME': 'Maryland',
'CSA': 'Salisbury-Cambridge, MD-DE',
'COUNTY': 'Dorchester',
'MAINOFF': 0,
'OFFNAME': 'WOODS ROAD BRANCH',
'CBSA_METRO_FLG': '0',
'CBSA_MICRO_FLG': '1',
'CSA_NO': '480',
'CBSA_METRO': 0,
'CBSA_DIV_NO': '',
'RUNDATE': '08/07/2020',
'NAME': '1880 Bank',
'UNINUM': 204568,
'SERVTYPE': 11,
'CSA_FLG': '1',
'STCNTY': '24019',
'CBSA': 'Cambridge, MD',
'CBSA_DIV': '',
'CBSA_DIV_FLG': '0',
'CITY': 'Cambridge',
'ADDRESS': '803 Woods Road',
'CERT': '4829',
'STALP': 'MD',
'OFFNUM': 1,
'ESTYMD': '12/23/1968',
'ID': '204568'
},
'score': 1
}
```
## **get_summary**
=== "Details"
- *Description*: Detail on failed financial institutions
- *Return*: `dict`
- *Arguments*
| Argument | Description | Type | Default | Required | Options |
|:-----------|:-----------------------------------------|:-----------------------------|:----------|:-----------|:--------------------------------------------------------------------------------------|
| filters | Filter(s) for the bank search | `str` | `None` | optional | |
| fields | Comma delimited list of fields to retrieve | `str` | All fields included by default | optional | | |
| sort_by | Field name by which to sort returned data | `str`| `FAILDATE` | optional | See meta_dict
| sort_order | Indicator if ascending or descending | `str` | `DESC` | optional | `ASC`<br>`DESC`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| offset | Offset of page to return | `int` | `0` | optional |
| output | Format of data to return | `str` | `json` | optional | `json`<br>`pandas`
| limit | Number of records to return | `int` | `10000` | optional | 0 to 10,000
| friendly_fields | Replace keys / column names with friendlier title | `bool` | `False` | optional | `True`<br>`False`
=== "Example"
```python hl_lines="3"
import bankfind as bf
data = bf.get_failures()
data['data'][0]
```
=== "Data"
```python
{
'data': {
'INTINC2': 51722726,
'EXTRA': 1316,
'LNATRES': 9769341,
'chrtrest': 0,
'STNAME': 'United States and Other Areas',
'ILNS': 39718788,
'LNAG': 3306388,
'EINTEXP2': 10348941,
'EPREMAGG': 2063405,
'YEAR': '2019',
'BKPREM': 8315925,
'INTAN': 12025281,
'LNRE': 444072342,
'chartoth': 1,
'IGLSEC': 482482,
'OT_BIF': 0,
'EAMINTAN': 456598,
'newcount': 0,
'DEPI': 840535976,
'EFHLBADV': None,
'tofail': 1,
'SCMTGBK': 292023664,
'NTRTMLG': 118177154,
'OEA': 1483578,
'EFREPP': 90846,
'LNLSGR': 655127513,
'NETINC': 15194171,
'TOT_OTS': 334,
'CONS': 0,
'OTHNBORR': 91479748,
'LNREMULT': 68529412,
'P9LNLS': 7463014,
'COUNT': 659,
'LNRERES': 253541537,
'EQCS': 790384,
'SCAGE': 304050945,
'LNRECONS': 23453492,
'TOT_FDIC': 325,
'EINTEXP': 10348941,
'TPD': 13656751,
'LNCI': 43378018,
'EQNM': 125002942,
'INTBLIB': 1007906756,
'liqasstd': 0,
'SC': 385021771,
'INTBAST': 1096557030,
'EDEPDOM': 8287049,
'ILNDOM': 39718603,
'NCLNLS': 11414221,
'UNINC': 133264,
'ISC': 10339424,
'LIABEQ': 1153906385,
'tochrt': 7,
'IFEE': 865589,
'TOT_SAVE': 659,
'LNRESRE': None,
'alsonew': 0,
'NUMEMP': 121746,
'ASSET': 1153906405,
'TINTINC': 11723463,
'NALNLS': 3951207,
'EOTHNINT': 14513593,
'TRADES': 0,
'ESAL': 12889946,
'ILNLS': 39999263,
'LIAB': 1028873691,
'LNDEP': 417597,
'OTHBFHLB': 75972627,
'ITAX': 4361954,
'EQCDIVP': 12402,
'SCRES': None,
'TRADE': 356945,
'MISSADJ': -1,
'FD_BIF': 0,
'CRLNLS': 1422110,
'LS': 5575099,
'tomerg': 11,
'ELNATR': 5247975,
'LNCRCD': 99551689,
'INTINC': 51722726,
'EQUPTOT': 70024149,
'CHBALI': 64693509,
'EQPP': 282890,
'PTXNOINC': 19078526,
'OINTINC': 11723463,
'tortc': 0,
'ILS': 280475,
'FD_SAIF': 0,
'EQNWCERT': None,
'OINTBOR': 85304294,
'SCUST': 12170713,
'combos': 12,
'P3LNLS': 6193737,
'OTLNCNTA': None,
'OTHLIAB': 16342193,
'IFREPO': 18439,
'LNLSNET': 645358172,
'LNCONOT1': None,
'EQCDIVC': 13089203,
'SCUSA': 316221658,
'DRLNLS': 7211296,
'OTHBORR': 1685904,
'EQCDIV': 13101605,
'EDEP': 8287065,
'BRWDMONY': 1685904,
'comboass': 0,
'FREPO': 1126633,
'CHBAL': 73009001,
'ALLOTHER': 14950385,
'FREPP': 6067807,
'IRAKEOGH': 123424709,
'OT_SAIF': 0,
'ORE': 302690,
'SCMUNI': 10308292,
'ESUBND': 278,
'SCUS': 316221658,
'ITRADE': 0,
'OINTEXP': 1777028,
'liqunass': 1,
'DDT': 58550380,
'EDEPFOR': 16,
'LNALLOTH': 42378773,
'SCEQ': 258574,
'ITAXR': 19078526,
'ILNFOR': 185,
'ICHBAL': 1365600,
'LNRELOC': 21179492,
'STNUM': '0',
'SUBLLPF': 26052,
'OONONII': 11554071,
'CORPBNDS': 55721897,
'NONIX': 29466944,
'NCHGREC': 5789186,
'OTHASST': 28389467,
'DEP': 921025698,
'NIM': 41373785,
'LNCON': 141930462,
'EQSUR': 53905519,
'SAVINGS': 659,
'ORET': 302690,
'CB_SI': 'SI',
'TOINTEXP': 2061876,
'LNMUNI': 1630491,
'LNRENRES': 98547901,
'NONII': 12419660,
'BRO': 104643398,
'ID': 'SI_2019_0'
},
'score': 1
}
```

0
img/favicon.png → docs/docs/img/favicon.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
img/logo.png → docs/docs/img/logo.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
img/small_logo.png → docs/docs/img/small_logo.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

75
docs/docs/index.md Normal file
View File

@ -0,0 +1,75 @@
<p align="center">
<a href="#"><img src="img/logo.png"></a>
</p>
<p align="center">
<em>Python interface to the FDIC's API for publically available bank data</em>
</p>
<p align="center">
<a href="https://travis-ci.com/dpguthrie/bankfind" target="_blank">
<img src="https://travis-ci.com/dpguthrie/bankfind.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/dpguthrie/bankfind" target="_blank">
<img src="https://img.shields.io/codecov/c/github/dpguthrie/bankfind" alt="Coverage">
</a>
<a href="https://pypi.org/project/bankfind" target="_blank">
<img src="https://badge.fury.io/py/bankfind.svg" alt="Package version">
</a>
</p>
---
**Documentation**: <a target="_blank" href="https://bankfind.dpguthrie.com">https://bankfind.dpguthrie.com</a>
<!-- **Interactive Demo**: <a target="_blank" href="https://bankfind-streamlit.dpguthrie.com">https://bankfind-streamlit.herokuapp.com</a> -->
**Source Code**: <a target="_blank" href="https://github.com/dpguthrie/bankfind">https://github.com/dpguthrie/bankfind</a>
**FDIC Documentation**: <a target="_blank" href="https://banks.data.fdic.gov/docs/">https://banks.data.fdic.gov/docs/</a>
---
## Overview
**bankfind** is a python interface to publically available bank data from the FDIC.
There are currently, as of 8/11/20, five endpoints that the FDIC has exposed to the public:
- **failures** - returns detail on failed financial institutions
- **institutions** - returns a list of financial institutions
- **history** - returns detail on structure change events
- **locations** - returns locations / branches of financial institutions
- **summary** - returns aggregate financial and structure data, subtotaled by year, regarding financial institutions
## Requirements
Python 2.7, 3.5+
- [Requests](https://requests.readthedocs.io/en/master/) - The elegant and simple HTTP library for Python, built for human beings.
## Installation
<div class="termynal" data-termynal data-ty-typeDelay="40" data-ty-lineDelay="700">
<span data-ty="input">pip install bankfind</span>
<span data-ty="progress"></span>
<span data-ty>Successfully installed bankfind</span>
<a href="#" data-terminal-control="">restart ↻</a>
</div>
## Example
```python
import bankfind as bf
# Get Institutions
data = bf.get_institutions()
# Get Institutions from Colorado with high ROE
data = bf.get_institutions(filters="STNAME:Colorado AND ROE:[25 TO *]")
# Get Commercial Banks from Colorado that aren't S-Corps
data = bf.get_institutions(filters="STNAME:Colorado AND SUBCHAPS:0 AND CB:1")
```
## License
This project is licensed under the terms of the MIT license.

0
js/custom.js → docs/docs/js/custom.js Executable file → Normal file
View File

0
js/termynal.js → docs/docs/js/termynal.js Executable file → Normal file
View File

63
docs/mkdocs.yml Normal file
View File

@ -0,0 +1,63 @@
# Project Information
site_name: bankfind
site_description: Python wrapper allowing developers access to the FDICs publically available bank data
site_author: Doug Guthrie
# Repository
repo_name: bankfind
repo_url: https://github.com/dpguthrie/bankfind
# Configuration
theme:
name: material
palette:
primary: black
icon:
repo: fontawesome/brands/github-alt
logo: img/small_logo.png
favicon: img/favicon.png
language: en
# Extras
extra:
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/dpguthrie
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/douglas-guthrie-07994a48/
- icon: fontawesome/brands/medium
link: https://medium.com/@douglas.p.guthrie
- icon: fontawesome/solid/globe
link: https://dpguthrie.com
extra_css:
- css/termynal.css
extra_javascript:
- js/termynal.js
- js/custom.js
# Extensions
markdown_extensions:
- admonition
- codehilite:
guess_lang: false
- toc:
permalink: true
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
# Google Analytics
google_analytics:
- UA-175202147-1
- auto
nav:
- index.md
- functions.md
- filtering.md
- release_notes.md

View File

@ -1,737 +0,0 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Python wrapper allowing developers access to the FDICs publically available bank data">
<meta name="author" content="Doug Guthrie">
<link rel="shortcut icon" href="../img/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.5.5">
<title>Filtering - bankfind</title>
<link rel="stylesheet" href="../assets/stylesheets/main.63b94e9e.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.7f672a1f.min.css">
<meta name="theme-color" content="">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
<link rel="stylesheet" href="../css/termynal.css">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-175202147-1","auto"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview",document.location.pathname)})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="black" data-md-color-accent="">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#overview" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href=".." title="bankfind" class="md-header-nav__button md-logo" aria-label="bankfind">
<img src="../img/small_logo.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
bankfind
</span>
<span class="md-header-nav__topic md-ellipsis">
Filtering
</span>
</div>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="bankfind" class="md-nav__button md-logo" aria-label="bankfind">
<img src="../img/small_logo.png" alt="logo">
</a>
bankfind
</label>
<div class="md-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="../functions/" title="Functions" class="md-nav__link">
Functions
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Filtering
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>
</span>
</label>
<a href="./" title="Filtering" class="md-nav__link md-nav__link--active">
Filtering
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#filters" class="md-nav__link">
Filters
</a>
<nav class="md-nav" aria-label="Filters">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#strings" class="md-nav__link">
strings
</a>
</li>
<li class="md-nav__item">
<a href="#dates" class="md-nav__link">
dates
</a>
<nav class="md-nav" aria-label="dates">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#exclusive" class="md-nav__link">
exclusive
</a>
</li>
<li class="md-nav__item">
<a href="#inclusive" class="md-nav__link">
inclusive
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#numbers" class="md-nav__link">
numbers
</a>
<nav class="md-nav" aria-label="numbers">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#exclusive_1" class="md-nav__link">
exclusive
</a>
</li>
<li class="md-nav__item">
<a href="#inclusive_1" class="md-nav__link">
inclusive
</a>
</li>
<li class="md-nav__item">
<a href="#wildcard" class="md-nav__link">
wildcard
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#search" class="md-nav__link">
Search
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../release_notes/" title="Release notes" class="md-nav__link">
Release notes
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#filters" class="md-nav__link">
Filters
</a>
<nav class="md-nav" aria-label="Filters">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#strings" class="md-nav__link">
strings
</a>
</li>
<li class="md-nav__item">
<a href="#dates" class="md-nav__link">
dates
</a>
<nav class="md-nav" aria-label="dates">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#exclusive" class="md-nav__link">
exclusive
</a>
</li>
<li class="md-nav__item">
<a href="#inclusive" class="md-nav__link">
inclusive
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#numbers" class="md-nav__link">
numbers
</a>
<nav class="md-nav" aria-label="numbers">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#exclusive_1" class="md-nav__link">
exclusive
</a>
</li>
<li class="md-nav__item">
<a href="#inclusive_1" class="md-nav__link">
inclusive
</a>
</li>
<li class="md-nav__item">
<a href="#wildcard" class="md-nav__link">
wildcard
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#search" class="md-nav__link">
Search
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/dpguthrie/bankfind/edit/master/docs/filtering.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1>Filtering</h1>
<p>The API uses the Elastic Search <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax">query string syntax</a> for filtering.</p>
<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">&para;</a></h2>
<p>First, get an idea of what fields you can use to filter from the <code>meta_dict</code>. </p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">bankfind</span> <span class="k">as</span> <span class="nn">bf</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">fields</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">meta_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="n">dict_keys</span><span class="p">([</span><span class="s1">&#39;failures&#39;</span><span class="p">,</span> <span class="s1">&#39;history&#39;</span><span class="p">,</span> <span class="s1">&#39;institutions&#39;</span><span class="p">,</span> <span class="s1">&#39;locations&#39;</span><span class="p">,</span> <span class="s1">&#39;summary&#39;</span><span class="p">])</span>
</code></pre></div>
<p>Each of the keys above represent an endpoint. The values corresponding to each of the keys above are dictionaries. The dictionaries contain the fields available as well as the data type, description, and, sometimes, options to filter with.</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">bf</span><span class="o">.</span><span class="n">meta_dict</span><span class="p">[</span><span class="s1">&#39;failures&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="n">dict_keys</span><span class="p">([</span><span class="s1">&#39;NAME&#39;</span><span class="p">,</span> <span class="s1">&#39;CERT&#39;</span><span class="p">,</span> <span class="s1">&#39;FIN&#39;</span><span class="p">,</span> <span class="s1">&#39;CITYST&#39;</span><span class="p">,</span> <span class="s1">&#39;FAILDATE&#39;</span><span class="p">,</span> <span class="s1">&#39;FAILYR&#39;</span><span class="p">,</span> <span class="s1">&#39;SAVR&#39;</span><span class="p">,</span> <span class="s1">&#39;RESTYPE1&#39;</span><span class="p">,</span> <span class="s1">&#39;CHCLASS1&#39;</span><span class="p">,</span> <span class="s1">&#39;RESTYPE&#39;</span><span class="p">,</span> <span class="s1">&#39;QBFDEP&#39;</span><span class="p">,</span> <span class="s1">&#39;QBFASSET&#39;</span><span class="p">,</span> <span class="s1">&#39;COST&#39;</span><span class="p">,</span> <span class="s1">&#39;PSTALP&#39;</span><span class="p">])</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">bf</span><span class="o">.</span><span class="n">meta_dict</span><span class="p">[</span><span class="s1">&#39;failures&#39;</span><span class="p">][</span><span class="s1">&#39;NAME&#39;</span><span class="p">]</span>
<span class="p">{</span><span class="s1">&#39;type&#39;</span><span class="p">:</span> <span class="s1">&#39;string&#39;</span><span class="p">,</span> <span class="s1">&#39;x-elastic-type&#39;</span><span class="p">:</span> <span class="s1">&#39;keyword&#39;</span><span class="p">,</span> <span class="s1">&#39;title&#39;</span><span class="p">:</span> <span class="s1">&#39;Institution Name&#39;</span><span class="p">,</span> <span class="s1">&#39;description&#39;</span><span class="p">:</span> <span class="s2">&quot;This is the legal name of the institution. When available, the Institution&#39;s name links to useful information for the customers and vendors of these institutions. This information includes press releases, information about the acquiring institution, (if applicable), how your accounts and loans are affected, and how vendors can file claims against the receivership.&quot;</span><span class="p">}</span>
</code></pre></div>
<h2 id="filters">Filters<a class="headerlink" href="#filters" title="Permanent link">&para;</a></h2>
<p>The syntax for filtering will change based on the data-type.</p>
<h3 id="strings">strings<a class="headerlink" href="#strings" title="Permanent link">&para;</a></h3>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:&lt;VALUE&gt;</code></p>
<p>First, let's filter based on cert, which as you can see from the <code>meta_dict</code> is a string field.</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">bf</span><span class="o">.</span><span class="n">meta_dict</span><span class="p">[</span><span class="s1">&#39;institutions&#39;</span><span class="p">][</span><span class="s1">&#39;CERT&#39;</span><span class="p">][</span><span class="s1">&#39;type&#39;</span><span class="p">]</span>
<span class="s1">&#39;string&#39;</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s2">&quot;CERT:57295&quot;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">1</span>
</code></pre></div>
<p>Chain filters together with "AND":</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s2">&quot;STNAME:Colorado AND CITY:Denver&quot;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">108</span>
</code></pre></div>
<p>Filtering with "OR" is easy also:</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;STNAME:(&quot;Colorado&quot;,&quot;Wyoming&quot;)&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">844</span>
</code></pre></div>
<h3 id="dates">dates<a class="headerlink" href="#dates" title="Permanent link">&para;</a></h3>
<p>Dates must be entered in the following format:</p>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:yyyy-mm-dd</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;DATEUPDT:2019-12-31&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">3919</span>
</code></pre></div>
<p>They can also be used as ranges:</p>
<h4 id="exclusive">exclusive<a class="headerlink" href="#exclusive" title="Permanent link">&para;</a></h4>
<p>Use curly braces <code>{}</code> and the range will exclude the beginning and end dates used in the range:</p>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:{yyyy-mm-dd TO yyyy-mm-dd}</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;DATEUPDT:{2015-01-01 TO 2018-12-31}&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">1921</span>
</code></pre></div>
<h4 id="inclusive">inclusive<a class="headerlink" href="#inclusive" title="Permanent link">&para;</a></h4>
<p>Use brackets <code>[]</code> and the range will include the beginning and end dates used in the range</p>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:[yyyy-mm-dd TO yyyy-mm-dd]</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;DATEUPDT:[2010-01-01 TO 2018-12-31]&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">4556</span>
</code></pre></div>
<h3 id="numbers">numbers<a class="headerlink" href="#numbers" title="Permanent link">&para;</a></h3>
<p>Numbers can also be used in ranges with the same syntax as dates</p>
<h4 id="exclusive_1">exclusive<a class="headerlink" href="#exclusive_1" title="Permanent link">&para;</a></h4>
<p>Use curly braces <code>{}</code> and the range will exclude the beginning and end values in the range. Most of the values are represented in thousands.</p>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:{Number TO Number}</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;ASSET:{25000 TO 75000}&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">5530</span>
</code></pre></div>
<p><em>The filter above will retrieve institutions with assets greater than 25 million and less than 75 million</em></p>
<h4 id="inclusive_1">inclusive<a class="headerlink" href="#inclusive_1" title="Permanent link">&para;</a></h4>
<p>Use brackets <code>[]</code> and the range will the include the beginning and end dates used in the range</p>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:[Number TO Number]</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;ASSET:[2000000 TO 5000000]&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">685</span>
</code></pre></div>
<p><em>The filter above will retrieve institutions with assets greater than or equal to 2 billion or less than or equal to 5 billion.</em></p>
<h4 id="wildcard">wildcard<a class="headerlink" href="#wildcard" title="Permanent link">&para;</a></h4>
<p><strong>Syntax</strong>: <code>&lt;FIELD&gt;:[Number to *]</code></p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s1">&#39;ASSET:{5000000 TO *]&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">602</span>
</code></pre></div>
<p><em>The filter above will retrieve institutions with assets greater than 5 billion.</em></p>
<h2 id="search">Search<a class="headerlink" href="#search" title="Permanent link">&para;</a></h2>
<p>Flexible text search is also available. Search supports text search and fuzzy matching, as opposed to filters that are exact matches. Currently, only two endpoints support the search functionality: <code>get_institutions</code> and <code>get_history</code>.</p>
<p>The only field that currently supports the search functionality is <code>NAME</code>. It's a similar syntax to the <a href="#strings">string filter</a>.</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">search</span><span class="o">=</span><span class="s1">&#39;NAME:AMG&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">5</span>
</code></pre></div>
<p>Taking it a little further:</p>
<div class="highlight"><pre><span></span><code><span class="o">&gt;&gt;&gt;</span> <span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">search</span><span class="o">=</span><span class="s1">&#39;NAME:AMG National&#39;</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s1">&#39;data&#39;</span><span class="p">])</span>
<span class="mi">1</span>
</code></pre></div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../functions/" title="Functions" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
Functions
</div>
</div>
</a>
<a href="../release_notes/" title="Release notes" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Release notes
</div>
</div>
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-footer-social">
<a href="https://github.com/dpguthrie" target="_blank" rel="noopener" title="github.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</a>
<a href="https://www.linkedin.com/in/douglas-guthrie-07994a48/" target="_blank" rel="noopener" title="www.linkedin.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg>
</a>
<a href="https://medium.com/@douglas.p.guthrie" target="_blank" rel="noopener" title="medium.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 32v448h448V32H0zm372.2 106.1l-24 23c-2.1 1.6-3.1 4.2-2.7 6.7v169.3c-.4 2.6.6 5.2 2.7 6.7l23.5 23v5.1h-118V367l24.3-23.6c2.4-2.4 2.4-3.1 2.4-6.7V199.8l-67.6 171.6h-9.1L125 199.8v115c-.7 4.8 1 9.7 4.4 13.2l31.6 38.3v5.1H71.2v-5.1l31.6-38.3c3.4-3.5 4.9-8.4 4.1-13.2v-133c.4-3.7-1-7.3-3.8-9.8L75 138.1V133h87.3l67.4 148L289 133.1h83.2v5z"/></svg>
</a>
<a href="https://dpguthrie.com" target="_blank" rel="noopener" title="dpguthrie.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="../assets/javascripts/vendor.d1f5a259.min.js"></script>
<script src="../assets/javascripts/bundle.f9edbbd5.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
<script>
app = initialize({
base: "..",
features: [],
search: Object.assign({
worker: "../assets/javascripts/worker/search.fae956e7.min.js"
}, typeof search !== "undefined" && search)
})
</script>
<script src="../js/termynal.js"></script>
<script src="../js/custom.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,561 +0,0 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Python wrapper allowing developers access to the FDICs publically available bank data">
<meta name="author" content="Doug Guthrie">
<link rel="shortcut icon" href="img/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.5.5">
<title>bankfind</title>
<link rel="stylesheet" href="assets/stylesheets/main.63b94e9e.min.css">
<link rel="stylesheet" href="assets/stylesheets/palette.7f672a1f.min.css">
<meta name="theme-color" content="">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
<link rel="stylesheet" href="css/termynal.css">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-175202147-1","auto"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview",document.location.pathname)})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="black" data-md-color-accent="">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#overview" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href="." title="bankfind" class="md-header-nav__button md-logo" aria-label="bankfind">
<img src="img/small_logo.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
bankfind
</span>
<span class="md-header-nav__topic md-ellipsis">
Home
</span>
</div>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="." title="bankfind" class="md-nav__button md-logo" aria-label="bankfind">
<img src="img/small_logo.png" alt="logo">
</a>
bankfind
</label>
<div class="md-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Home
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>
</span>
</label>
<a href="." title="Home" class="md-nav__link md-nav__link--active">
Home
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#requirements" class="md-nav__link">
Requirements
</a>
</li>
<li class="md-nav__item">
<a href="#installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="#example" class="md-nav__link">
Example
</a>
</li>
<li class="md-nav__item">
<a href="#license" class="md-nav__link">
License
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="functions/" title="Functions" class="md-nav__link">
Functions
</a>
</li>
<li class="md-nav__item">
<a href="filtering/" title="Filtering" class="md-nav__link">
Filtering
</a>
</li>
<li class="md-nav__item">
<a href="release_notes/" title="Release notes" class="md-nav__link">
Release notes
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#requirements" class="md-nav__link">
Requirements
</a>
</li>
<li class="md-nav__item">
<a href="#installation" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item">
<a href="#example" class="md-nav__link">
Example
</a>
</li>
<li class="md-nav__item">
<a href="#license" class="md-nav__link">
License
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/dpguthrie/bankfind/edit/master/docs/index.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1>Home</h1>
<p align="center">
<a href="#"><img src="img/logo.png"></a>
</p>
<p align="center">
<em>Python interface to the FDIC's API for publically available bank data</em>
</p>
<p align="center">
<a href="https://travis-ci.com/dpguthrie/bankfind" target="_blank">
<img src="https://travis-ci.com/dpguthrie/bankfind.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/dpguthrie/bankfind" target="_blank">
<img src="https://img.shields.io/codecov/c/github/dpguthrie/bankfind" alt="Coverage">
</a>
<a href="https://pypi.org/project/bankfind" target="_blank">
<img src="https://badge.fury.io/py/bankfind.svg" alt="Package version">
</a>
</p>
<hr />
<p><strong>Documentation</strong>: <a target="_blank" href="https://bankfind.dpguthrie.com">https://bankfind.dpguthrie.com</a></p>
<!-- **Interactive Demo**: <a target="_blank" href="https://bankfind-streamlit.dpguthrie.com">https://bankfind-streamlit.herokuapp.com</a> -->
<p><strong>Source Code</strong>: <a target="_blank" href="https://github.com/dpguthrie/bankfind">https://github.com/dpguthrie/bankfind</a></p>
<p><strong>FDIC Documentation</strong>: <a target="_blank" href="https://banks.data.fdic.gov/docs/">https://banks.data.fdic.gov/docs/</a></p>
<hr />
<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">&para;</a></h2>
<p><strong>bankfind</strong> is a python interface to publically available bank data from the FDIC.</p>
<p>There are currently, as of 8/11/20, five endpoints that the FDIC has exposed to the public:</p>
<ul>
<li><strong>failures</strong> - returns detail on failed financial institutions</li>
<li><strong>institutions</strong> - returns a list of financial institutions</li>
<li><strong>history</strong> - returns detail on structure change events</li>
<li><strong>locations</strong> - returns locations / branches of financial institutions</li>
<li><strong>summary</strong> - returns aggregate financial and structure data, subtotaled by year, regarding financial institutions</li>
</ul>
<h2 id="requirements">Requirements<a class="headerlink" href="#requirements" title="Permanent link">&para;</a></h2>
<p>Python 2.7, 3.5+</p>
<ul>
<li><a href="https://requests.readthedocs.io/en/master/">Requests</a> - The elegant and simple HTTP library for Python, built for human beings.</li>
</ul>
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
<div class="termynal" data-termynal data-ty-typeDelay="40" data-ty-lineDelay="700">
<span data-ty="input">pip install bankfind</span>
<span data-ty="progress"></span>
<span data-ty>Successfully installed bankfind</span>
<a href="#" data-terminal-control="">restart ↻</a>
</div>
<h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h2>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">bankfind</span> <span class="k">as</span> <span class="nn">bf</span>
<span class="c1"># Get Institutions</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">()</span>
<span class="c1"># Get Institutions from Colorado with high ROE</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s2">&quot;STNAME:Colorado AND ROE:[25 TO *]&quot;</span><span class="p">)</span>
<span class="c1"># Get Commercial Banks from Colorado that aren&#39;t S-Corps</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">bf</span><span class="o">.</span><span class="n">get_institutions</span><span class="p">(</span><span class="n">filters</span><span class="o">=</span><span class="s2">&quot;STNAME:Colorado AND SUBCHAPS:0 AND CB:1&quot;</span><span class="p">)</span>
</code></pre></div>
<h2 id="license">License<a class="headerlink" href="#license" title="Permanent link">&para;</a></h2>
<p>This project is licensed under the terms of the MIT license.</p>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="functions/" title="Functions" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Functions
</div>
</div>
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-footer-social">
<a href="https://github.com/dpguthrie" target="_blank" rel="noopener" title="github.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</a>
<a href="https://www.linkedin.com/in/douglas-guthrie-07994a48/" target="_blank" rel="noopener" title="www.linkedin.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg>
</a>
<a href="https://medium.com/@douglas.p.guthrie" target="_blank" rel="noopener" title="medium.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 32v448h448V32H0zm372.2 106.1l-24 23c-2.1 1.6-3.1 4.2-2.7 6.7v169.3c-.4 2.6.6 5.2 2.7 6.7l23.5 23v5.1h-118V367l24.3-23.6c2.4-2.4 2.4-3.1 2.4-6.7V199.8l-67.6 171.6h-9.1L125 199.8v115c-.7 4.8 1 9.7 4.4 13.2l31.6 38.3v5.1H71.2v-5.1l31.6-38.3c3.4-3.5 4.9-8.4 4.1-13.2v-133c.4-3.7-1-7.3-3.8-9.8L75 138.1V133h87.3l67.4 148L289 133.1h83.2v5z"/></svg>
</a>
<a href="https://dpguthrie.com" target="_blank" rel="noopener" title="dpguthrie.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="assets/javascripts/vendor.d1f5a259.min.js"></script>
<script src="assets/javascripts/bundle.f9edbbd5.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
<script>
app = initialize({
base: ".",
features: [],
search: Object.assign({
worker: "assets/javascripts/worker/search.fae956e7.min.js"
}, typeof search !== "undefined" && search)
})
</script>
<script src="js/termynal.js"></script>
<script src="js/custom.js"></script>
</body>
</html>

42
pyproject.toml Normal file
View File

@ -0,0 +1,42 @@
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"
[tool.flit.metadata]
module = "bankfind"
author = "Doug Guthrie"
author-email = "douglas.p.guthrie@gmail.com"
home-page = "https://github.com/dpguthrie/bankfind"
keywords = "banking, finance, fdic, api, requests"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
]
requires = [
"requests==2.24.0",
"pandas>=0.24"
]
description-file = "README.md"
[tool.flit.metadata.requires-extra]
test = [
'pytest',
'coverage',
'pytest-cov'
]
doc = [
'mkdocs-material',
'pymdown-extensions'
]
[tool.flit.metadata.urls]
Documentation = "https://bankfind.dpguthrie.com"

10
pytest.ini Normal file
View File

@ -0,0 +1,10 @@
[pytest]
testpaths =
tests
bankfind
norecursedirs=dist build .venv .vscode demo
addopts =
--doctest-modules
--cov=bankfind
-r a
-v

View File

@ -1,375 +0,0 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Python wrapper allowing developers access to the FDICs publically available bank data">
<meta name="author" content="Doug Guthrie">
<link rel="shortcut icon" href="../img/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.5.5">
<title>Release notes - bankfind</title>
<link rel="stylesheet" href="../assets/stylesheets/main.63b94e9e.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.7f672a1f.min.css">
<meta name="theme-color" content="">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
<link rel="stylesheet" href="../css/termynal.css">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-175202147-1","auto"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview",document.location.pathname)})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="black" data-md-color-accent="">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href=".." title="bankfind" class="md-header-nav__button md-logo" aria-label="bankfind">
<img src="../img/small_logo.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
bankfind
</span>
<span class="md-header-nav__topic md-ellipsis">
Release notes
</span>
</div>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="bankfind" class="md-nav__button md-logo" aria-label="bankfind">
<img src="../img/small_logo.png" alt="logo">
</a>
bankfind
</label>
<div class="md-nav__source">
<a href="https://github.com/dpguthrie/bankfind/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</div>
<div class="md-source__repository">
bankfind
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="../functions/" title="Functions" class="md-nav__link">
Functions
</a>
</li>
<li class="md-nav__item">
<a href="../filtering/" title="Filtering" class="md-nav__link">
Filtering
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Release notes" class="md-nav__link md-nav__link--active">
Release notes
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/dpguthrie/bankfind/edit/master/docs/release_notes.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1>Release notes</h1>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../filtering/" title="Filtering" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
Filtering
</div>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-footer-social">
<a href="https://github.com/dpguthrie" target="_blank" rel="noopener" title="github.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/></svg>
</a>
<a href="https://www.linkedin.com/in/douglas-guthrie-07994a48/" target="_blank" rel="noopener" title="www.linkedin.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg>
</a>
<a href="https://medium.com/@douglas.p.guthrie" target="_blank" rel="noopener" title="medium.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 32v448h448V32H0zm372.2 106.1l-24 23c-2.1 1.6-3.1 4.2-2.7 6.7v169.3c-.4 2.6.6 5.2 2.7 6.7l23.5 23v5.1h-118V367l24.3-23.6c2.4-2.4 2.4-3.1 2.4-6.7V199.8l-67.6 171.6h-9.1L125 199.8v115c-.7 4.8 1 9.7 4.4 13.2l31.6 38.3v5.1H71.2v-5.1l31.6-38.3c3.4-3.5 4.9-8.4 4.1-13.2v-133c.4-3.7-1-7.3-3.8-9.8L75 138.1V133h87.3l67.4 148L289 133.1h83.2v5z"/></svg>
</a>
<a href="https://dpguthrie.com" target="_blank" rel="noopener" title="dpguthrie.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="../assets/javascripts/vendor.d1f5a259.min.js"></script>
<script src="../assets/javascripts/bundle.f9edbbd5.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
<script>
app = initialize({
base: "..",
features: [],
search: Object.assign({
worker: "../assets/javascripts/worker/search.fae956e7.min.js"
}, typeof search !== "undefined" && search)
})
</script>
<script src="../js/termynal.js"></script>
<script src="../js/custom.js"></script>
</body>
</html>

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
pandas>=0.24
requests==2.24.0

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>None</loc>
<lastmod>2020-08-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>None</loc>
<lastmod>2020-08-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>None</loc>
<lastmod>2020-08-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>None</loc>
<lastmod>2020-08-23</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

0
tests/__init__.py Normal file
View File

46
tests/test_functions.py Normal file
View File

@ -0,0 +1,46 @@
import bankfind as bf
def test_institutions():
data = bf.get_institutions(
filters="STALP:CO AND ACTIVE:1",
search="NAME: AMG",
)
assert len(data['data']) == 1
def test_locations():
data = bf.get_locations(
filters="CERT:57295"
)
assert len(data['data']) >= 7
def test_history():
data = bf.get_history(
filters="CERT:57295",
output='pandas',
friendly_fields=True
)
assert len(data) >= 18
def test_summary():
df = bf.get_summary(
filters='CB_SI:CB AND ASSET:[10000000000 TO *] AND YEAR:["2018" TO "2019"]',
output='pandas')
assert len(df) >= 4
def test_failures():
data = bf.get_failures(
filters='PSTALP:CO AND FAILYR:["2008" TO "2011"]',
sort_by='COST',
sort_order='DESC',
friendly_fields=True)
assert len(data['data']) == 9
def test_bad_request():
response = bf.get_institutions(sort_by="BAD_SORT_BY_FIELD")
assert response.status_code == 400