Skip to main content

Financial Resilience Score Tool Solution

Project description

frstool is a Python toolkit for providing the Financial Resilience Institute’s white-labelled consumer financial resilience scoring, harnessing the Seymour Consulting Index ® and the Institute’s API endpoints.

For more information, please visit:

Installation

Install package using pypi

pip install frstool

Pypi project page https://pypi.org/project/frstool/

Getting Started

from frstool.apiclient import ApiClient
apiclient = ApiClient(api_key="demokey")

API access is currently open to all Canadians and global citizens for free financial resilience scoring. Please contact info@finresilienceinstitute.org for more information around B2B white-labelled solutions for your organization.

Providing Score Tool Questions for Your Users

Collect the Institute’s indicator questions to enable consumer financial resilience scoring:

questions = apiclient.collect_questions()

The result is a list of all questions along with available answer options, with each question formatted as a separate dictionary. For example:

{'id': '1',
  'question': 'Overall, how confident are you that you can get through periods of financial hardship resulting from unplanned events?',
  'answers': [{'text': '1', 'value': 1},
   {'text': '2', 'value': 2},
   {'text': '3', 'value': 3},
   {'text': '4', 'value': 4},
   {'text': '5', 'value': 5},
   {'text': '6', 'value': 6},
   {'text': '7', 'value': 7},
   {'text': '8', 'value': 8},
   {'text': '9', 'value': 9},
   {'text': '10', 'value': 10}],
  'type': 'confidence',
  'extents': ['1 - Not at all confident', '10 - Extremely confident'],
  'title': 'Overall, how confident are you that you can get through periods of financial hardship resulting from unplanned events?',
  'isFirst': True}

Formatting Answers

Format answers as a dictionary using question id as dictionary keys. For example:

{0: {'answer': '10',
  'question': 'Overall, how confident are you that you can get through periods of financial hardship resulting from unplanned events?'}}

For testing purposes, generate a dictionary containing random answers to all of the questions in questionnaire as follows:

answers = apiclient.generate_mock_answers(questions)

Calculating Financial Resilience Scores

Score the answers using calculate_score() method:

scores = apiclient.calculate_score(answers)

Scores will be a dictionary containing financial resilience scores for the questionnaire:

{'index_score': 42,
 'index_score_value_to_compare': 32.87,
 'index_score_result': 28}

Where index_score is the final Resilience Score, index_score_value_to_compare is the mean Resilience Score value for all Canadians whom the Financial Resilience Institute polls and serves as the baseline for comparison, and index_score_result is the percentage difference between final index score and this mean value.

Example

from frstool.apiclient import ApiClient

apiclient = ApiClient(api_key="demokey")
questions = apiclient.collect_questions()
answers = apiclient.generate_mock_answers(questions)
scores = apiclient.calculate_score(answers)

if scores['index_score_result'] > 0:
    print(f"Your score is {scores['index_score']} which is {scores['index_score_result']}% higher than the average score {scores['index_score_value_to_compare']}")
else:
    print(f"Your score is {scores['index_score']} which is {abs(scores['index_score_result'])}% lower than the average score {scores['index_score_value_to_compare']}")

Notes

Seymour Financial Resilience Index ® is a registered trademark used under license by the Financial Resilience Society.
© 2024 Financial Resilience Society DBA Financial Resilience Institute. All rights reserved.

Household categories based on financial resilience scores:

  • Extremely Vulnerable: Score of 0 to 30
  • Financially Vulnerable: Score of 30.01 to 50
  • Approaching Resilience: Score of 50.01 to 70
  • Financially Resilient: Score of 70.01 to 100

For more information about index development and scoring methodology, visit Why We Created the Index.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frstool-1.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

frstool-1.0.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file frstool-1.0.3.tar.gz.

File metadata

  • Download URL: frstool-1.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.13

File hashes

Hashes for frstool-1.0.3.tar.gz
Algorithm Hash digest
SHA256 50a6fef13e5ae71737df706500a6483bb8d01bc88fb0f9e5b2dd32ed69ee4a76
MD5 39029eaf4ffb5bca07abafac7162b489
BLAKE2b-256 f1bcb8cb61bf0425ec9d6c1fa439796b417cd5cbd85b925d5900ea2a411f2bac

See more details on using hashes here.

File details

Details for the file frstool-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: frstool-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.13

File hashes

Hashes for frstool-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e6342ae4050d3b239c241763c3700c561310ae4c7106ad1d3cf38439322f62cb
MD5 28185c0f903f7352dafcc6099494c24b
BLAKE2b-256 8b251b850fa8f23670c1435476248fa34dbd8fd1e8e41567da7dab98dd574145

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page