Skip to content

Commit

Permalink
Merge pull request #21 from crd/develop
Browse files Browse the repository at this point in the history
Merge develop into master in preparation of v0.3.0
  • Loading branch information
crd authored Sep 13, 2020
2 parents d946aa6 + 8927aad commit 53de5ff
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 108 deletions.
5 changes: 1 addition & 4 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ engines:
pylint:
enabled: true
python_version: 3

duplication:
enabled: true

Expand All @@ -13,9 +13,6 @@ engines:
coverage:
enabled: true

languages:
python:

exclude_paths:
- tests/*
- setup.py
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: python
python:
- "3.6"
- "3.7"
- "3.8"
env:
global:
- PIPENV_VENV_IN_PROJECT=1
Expand Down
3 changes: 0 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ name = "pypi"
coverage = "*"
faker = "*"
python-coveralls = "*"

[requires]
python_version = "3.6"
145 changes: 70 additions & 75 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
faker_credit_score
==================

|pypi| |unix_build| |coverage| |license| |black|
|pypi| |unix_build| |coverage| |license| |codacy| |black|

faker_credit_score is a community-created provider for the `Faker`_ test data
generator Python package.

This package provides fake credit score data for testing purposes. The four
most common non-industry specific credit scoring models are supported:
This package provides fake credit score data for testing purposes. The most common non-industry specific credit scoring models are supported:

* FICO Score 8
* VantageScore 3.0
* FICO Score 10
* FICO Score 10 T
* Equifax Beacon 5.0
* Experian/Fair Isaac Risk Model V2SM
* TransUnion FICO Risk Score, Classic 04
Expand Down Expand Up @@ -55,11 +57,11 @@ Add the ``CreditScore`` Provider to your ``Faker`` instance:
fake.add_provider(CreditScore)
fake.credit_score_name()
'TransUnion FICO Risk Score, Classic 04'
# 'TransUnion FICO Risk Score, Classic 04'
fake.credit_score_provider()
'TransUnion'
# 'TransUnion'
fake.credit_score()
791
# 791
Contributing
------------
Expand All @@ -74,16 +76,16 @@ Execute unit tests and calculate code coverage like so:
.. code:: bash
$ coverage run -m unittest tests/*
........
..............
----------------------------------------------------------------------
Ran 8 tests in 0.224s
Ran 14 tests in 0.406s
OK
$ coverage report
Name Stmts Miss Cover
----------------------------------------------------
faker_credit_score/__init__.py 49 0 100%
faker_credit_score/__init__.py 58 0 100%
.. |pypi| image:: https://img.shields.io/pypi/v/faker_credit_score.svg?style=flat-square&label=version
Expand All @@ -102,6 +104,10 @@ Execute unit tests and calculate code coverage like so:
:target: https://github.com/crd/faker_credit_score/blob/master/LICENSE
:alt: BSD 3-Clause License

.. |codacy| image:: https://api.codacy.com/project/badge/Grade/accb555dd0ae4e9598333988d57487e7
:target: https://www.codacy.com/manual/crd/faker_credit_score?utm_source=github.com&utm_medium=referral&utm_content=crd/faker_credit_score&utm_campaign=Badge_Grade
:alt: Codacy code quality grade

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square
:target: https://github.com/ambv/black
:alt: Black code formatter
Expand Down
18 changes: 18 additions & 0 deletions faker_credit_score/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class CreditScoreObject(object):
""" Credit Score Object that uses fico8 as a sensible default. """

def __init__(
self,
name="FICO Score 8",
Expand Down Expand Up @@ -44,12 +45,28 @@ class Provider(BaseProvider):
fico4_providers = ("TransUnion",)
fico4_range = (309, 839)

# VantageScore 3.0, FICO 10, and FICO 10 T are modelled on FICO 8
vantageScore3_name = "VantageScore 3.0"
vantageScore3_providers = fico8_providers
vantageScore3_range = fico8_range

fico10_name = "FICO Score 10"
fico10_providers = fico8_providers
fico10_range = fico8_range

fico10t_name = "FICO Score 10 T"
fico10t_providers = fico8_providers
fico10t_range = fico8_range

credit_score_types = OrderedDict(
(
("fico8", CreditScoreObject(fico8_name, fico8_providers, fico8_range)),
("fico5", CreditScoreObject(fico5_name, fico5_providers, fico5_range)),
("fico2", CreditScoreObject(fico2_name, fico2_providers, fico2_range)),
("fico4", CreditScoreObject(fico4_name, fico4_providers, fico4_range)),
("vantageScore3", CreditScoreObject(vantageScore3_name, vantageScore3_providers, vantageScore3_range)),
("fico10", CreditScoreObject(fico10_name, fico10_providers, fico10_range)),
("fico10t", CreditScoreObject(fico10t_name, fico10t_providers, fico10t_range)),
)
)
credit_score_types["fico"] = credit_score_types["fico8"]
Expand Down Expand Up @@ -96,4 +113,5 @@ def _generate_credit_score(self, credit_score_range):
""" Returns an integer within the range specified by credit_score_range. """
return self.generator.random_int(*credit_score_range)


CreditScore = Provider
4 changes: 2 additions & 2 deletions faker_credit_score/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Package version."""
VERSION = (0, 2, 3)
VERSION = (0, 3, 0)

__version__ = '.'.join(map(str, VERSION))
__version__ = ".".join(map(str, VERSION))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ def run(self):
cmdclass={
'upload': UploadCommand,
},
)
)
Loading

0 comments on commit 53de5ff

Please sign in to comment.