biweeklybudget.flaskapp.views.plaid module

Bases: flask.views.MethodView

Handle POST /ajax/plaid/handle_link endpoint.

methods = {'POST'}
post()[source]
class biweeklybudget.flaskapp.views.plaid.PlaidJs[source]

Bases: flask.views.MethodView

Handle GET /plaid.js endpoint, for CI/test or production/real.

get()[source]
methods = {'GET'}
class biweeklybudget.flaskapp.views.plaid.PlaidLinkToken[source]

Bases: flask.views.MethodView

Handle POST /ajax/plaid/create_link_token endpoint.

methods = {'POST'}
post()[source]
class biweeklybudget.flaskapp.views.plaid.PlaidRefreshAccounts[source]

Bases: flask.views.MethodView

Handle POST /ajax/plaid/refresh_item_accounts endpoint.

methods = {'POST'}
post()[source]
class biweeklybudget.flaskapp.views.plaid.PlaidUpdate[source]

Bases: flask.views.MethodView

Handle GET or POST /plaid-update

This single endpoint has multiple functions:

  • If GET with no query parameters, displays a form template to use to interactively update Plaid accounts.
  • If GET or POST with an item_ids query parameter, performs a Plaid update (via _update()) of the specified CSV list of Plaid Item IDs, or all Plaid Items if the value is ALL. The POST method also accepts an optional num_days parameter specifying an integer number of days of transactions to update. The response from this endpoint can be in one of three forms:
    • If the Accept HTTP header is set to application/json, return a JSON list of update results. Each list item is the JSON-ified value of as_dict.
    • If the Accept HTTP header is set to text/plain, return a plain text human-readable summary of the update operation.
    • Otherwise, return a templated view of the update operation results, as would be returned to a browser.
_form()[source]
_update(ids: str, num_days: int = 30)[source]

Handle an update for Plaid accounts by instantiating a PlaidUpdater, calling its update() method with the proper arguments, and then returning the result in a form determined by the Accept header.

Parameters:
  • ids (str) – a comma-separated string listing the PlaidItem IDs to update, or the string ALL to update all Items.
  • num_days (int) – number of days to retrieve transactions for; default 30
get()[source]

Handle GET. If the item_ids query parameter is set, then return _update(), else return _form().

methods = {'GET', 'POST'}
post()[source]

Handle POST. If the item_ids query parameter is set, then return _update(), else return a HTTP 400. If the optional num_days query parameter is set, pass that on to the update method.

class biweeklybudget.flaskapp.views.plaid.PlaidUpdateItemInfo[source]

Bases: flask.views.MethodView

Handle POST /ajax/plaid/update_item_info endpoint.

methods = {'POST'}
post()[source]
biweeklybudget.flaskapp.views.plaid.set_url_rules(a)[source]