Generate realistic fake credit scores (FICO 8, VantageScore, etc.) for testing fintech, lending, and insurance applications. A Faker provider with tier-based generation and 10 scoring models.
Project description
Stop hardcoding 720 in your tests.
A Faker provider that generates realistic credit scores across 10 industry scoring models – FICO 8, VantageScore, Equifax Beacon, and more. Constrain by tier, get real bureau names, and test the paths that actually matter.
Why this exists
Hardcoding credit_score = 720 in your fixtures doesn’t test anything. You don’t know if that’s “good” for FICO 8 or “fair” for Equifax Beacon 5.0 and random.randint(300, 850) gives you numbers that don’t map to any real model.
If you’re building a lending flow, an insurance quote engine, or anything that branches on creditworthiness you need scores that come from the right ranges, tied to real bureau names, with accurate tiering.
Before:
# What does 720 even test? Which model? Which tier?
user["credit_score"] = 720
After:
fake.credit_score(tier="poor") # 542 -- test the denial path
fake.credit_score(tier="exceptional") # 831 -- test the approval path
result = fake.credit_score_full("fico5")
# CreditScoreResult(name='Equifax Beacon 5.0', provider='Equifax', score=687)
Features
10 of the most commonly-used scoring models (FICO 8/9/10, VantageScore 3.0/4.0, and more)
Tier-based generation: poor, fair, good, very_good, exceptional
Score classification
Structured results via CreditScoreResult namedtuple
Works with the Faker CLI
100% test coverage
Installation
pip install faker-credit-score
Two lines to add it to your existing Faker setup:
from faker import Faker
from faker_credit_score import CreditScore
fake = Faker()
fake.add_provider(CreditScore)
Usage
Generate Scores
fake.credit_score()
# 791
fake.credit_score("fico5")
# 687
fake.credit_score_name()
# 'TransUnion FICO Risk Score, Classic 04'
fake.credit_score_provider()
# 'TransUnion'
Full Credit Score Result
Returns a CreditScoreResult namedtuple with name, provider, and score fields:
fake.credit_score_full()
# CreditScoreResult(name='FICO Score 8', provider='Equifax', score=791)
name, provider, score = fake.credit_score_full("fico5")
Also works from the command line:
$ faker credit_score -i faker_credit_score
756
$ faker credit_score_full -i faker_credit_score
Equifax Beacon 5.0
Equifax
687
Credit Score Tiers
Generate scores constrained to a tier, or classify existing scores:
fake.credit_score(tier="poor")
# 542
fake.credit_score(tier="exceptional")
# 831
fake.credit_score_tier()
# 'good'
fake.credit_score_tier(score=720)
# 'good'
Tier |
Range |
|---|---|
poor |
300 - 579 |
fair |
580 - 669 |
good |
670 - 739 |
very_good |
740 - 799 |
exceptional |
800 - 850 |
Supported Models
FICO Score 8, 9, 10, 10 T
VantageScore 3.0, 4.0
UltraFICO
Equifax Beacon 5.0
Experian/Fair Isaac Risk Model V2SM
TransUnion FICO Risk Score, Classic 04
Contributing
Contributions are welcome, including from first-time open source contributors. See CONTRIBUTING.md for setup instructions and ideas.
License
BSD 3-Clause. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file faker_credit_score-1.0.0.tar.gz.
File metadata
- Download URL: faker_credit_score-1.0.0.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaed5f91ffa06ae8f6652abf634aa19f46a1726d8cb97670c3872a3c28699d58
|
|
| MD5 |
8808fb0bad2b8efc2c9e0aa2705bf33a
|
|
| BLAKE2b-256 |
e305caa2cd1973f9025d3875d34a24a9eb2b7d4513932d9d557a4dd58c2d4484
|
File details
Details for the file faker_credit_score-1.0.0-py3-none-any.whl.
File metadata
- Download URL: faker_credit_score-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74bed7d415cc822d94ca2dd4ff82ad920b3e1f427900984c0160a623e9c51736
|
|
| MD5 |
198e4f1ba787228bc9a6b45a4570ec35
|
|
| BLAKE2b-256 |
10e794cfe3f8f52476cba24318ffb09afc0a84c84503165e6b3d0d95651b163c
|