minfraud 3.0.0__tar.gz → 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {minfraud-3.0.0 → minfraud-3.2.0}/HISTORY.rst +34 -0
- {minfraud-3.0.0/minfraud.egg-info → minfraud-3.2.0}/PKG-INFO +21 -20
- {minfraud-3.0.0 → minfraud-3.2.0}/README.rst +4 -2
- minfraud-3.2.0/pyproject.toml +137 -0
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/__init__.py +1 -6
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/errors.py +13 -32
- minfraud-3.2.0/src/minfraud/models.py +1213 -0
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/request.py +20 -15
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/validation.py +39 -18
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/version.py +1 -1
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/webservice.py +110 -85
- {minfraud-3.0.0 → minfraud-3.2.0}/tests/test_models.py +86 -12
- {minfraud-3.0.0 → minfraud-3.2.0}/tests/test_request.py +46 -43
- {minfraud-3.0.0 → minfraud-3.2.0}/tests/test_validation.py +47 -16
- {minfraud-3.0.0 → minfraud-3.2.0}/tests/test_webservice.py +50 -24
- minfraud-3.0.0/MANIFEST.in +0 -10
- minfraud-3.0.0/PKG-INFO +0 -367
- minfraud-3.0.0/README.dev.rst +0 -14
- minfraud-3.0.0/docs/conf.py +0 -250
- minfraud-3.0.0/docs/index.rst +0 -36
- minfraud-3.0.0/minfraud/models.py +0 -1659
- minfraud-3.0.0/minfraud.egg-info/SOURCES.txt +0 -34
- minfraud-3.0.0/minfraud.egg-info/dependency_links.txt +0 -1
- minfraud-3.0.0/minfraud.egg-info/requires.txt +0 -8
- minfraud-3.0.0/minfraud.egg-info/top_level.txt +0 -1
- minfraud-3.0.0/pylintrc +0 -6
- minfraud-3.0.0/pyproject.toml +0 -86
- minfraud-3.0.0/setup.cfg +0 -45
- minfraud-3.0.0/tests/data/factors-response.json +0 -246
- minfraud-3.0.0/tests/data/full-report-request.json +0 -9
- minfraud-3.0.0/tests/data/full-transaction-request.json +0 -91
- minfraud-3.0.0/tests/data/insights-response.json +0 -186
- minfraud-3.0.0/tests/data/report-response.json +0 -0
- minfraud-3.0.0/tests/data/score-response.json +0 -25
- {minfraud-3.0.0 → minfraud-3.2.0}/LICENSE +0 -0
- {minfraud-3.0.0 → minfraud-3.2.0/src}/minfraud/py.typed +0 -0
- {minfraud-3.0.0 → minfraud-3.2.0}/tests/__init__.py +0 -0
|
@@ -3,6 +3,40 @@
|
|
|
3
3
|
History
|
|
4
4
|
-------
|
|
5
5
|
|
|
6
|
+
3.2.0 (2025-11-20)
|
|
7
|
+
++++++++++++++++++
|
|
8
|
+
|
|
9
|
+
* IMPORTANT: Python 3.10 or greater is required. If you are using an older
|
|
10
|
+
version, please use an earlier release.
|
|
11
|
+
* Setuptools has been replaced with the uv build backend for building the
|
|
12
|
+
package.
|
|
13
|
+
* Added ``securepay`` to the ``/payment/processor`` validation.
|
|
14
|
+
* Added ``credit_application``, ``fund_transfer``, and ``sim_swap`` to the
|
|
15
|
+
``/event/type`` validation.
|
|
16
|
+
* Added the input ``/event/party``. This is the party submitting the
|
|
17
|
+
transaction.
|
|
18
|
+
* Added the input ``/payment/method``. This is the payment method associated
|
|
19
|
+
with the transaction.
|
|
20
|
+
* Added new ``EmailDomainVisit`` model class with ``status``,
|
|
21
|
+
``last_visited_on``, and ``has_redirect`` attributes. This class provides
|
|
22
|
+
information from automated visits to email domains.
|
|
23
|
+
* Added new attributes to ``minfraud.models.EmailDomain``:
|
|
24
|
+
* ``classification`` - A classification of the email domain (``business``,
|
|
25
|
+
``education``, ``government``, or ``isp_email``).
|
|
26
|
+
* ``risk`` - The risk associated with the domain (0.01 to 99).
|
|
27
|
+
* ``volume`` - Activity on the email domain across the minFraud network,
|
|
28
|
+
expressed in sightings per million (0.001 to 1,000,000).
|
|
29
|
+
* ``visit`` - An ``EmailDomainVisit`` object containing information from
|
|
30
|
+
an automated visit to the email domain.
|
|
31
|
+
|
|
32
|
+
3.1.0 (2025-05-23)
|
|
33
|
+
++++++++++++++++++
|
|
34
|
+
|
|
35
|
+
* Added support for the ``/billing_phone/matches_postal`` and
|
|
36
|
+
``/shipping_phone/matches_postal`` outputs. These are available as the
|
|
37
|
+
``matches_postal`` attribute on ``minfraud.model.Phone``.
|
|
38
|
+
* Added ``cryptomus`` to the ``/payment/processor`` validation.
|
|
39
|
+
|
|
6
40
|
3.0.0 (2025-02-10)
|
|
7
41
|
++++++++++++++++++
|
|
8
42
|
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: minfraud
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.2.0
|
|
4
4
|
Summary: MaxMind minFraud API
|
|
5
|
+
Author: Gregory Oschwald
|
|
5
6
|
Author-email: Gregory Oschwald <goschwald@maxmind.com>
|
|
6
|
-
License: Apache
|
|
7
|
-
|
|
8
|
-
Project-URL: Documentation, https://minfraud.readthedocs.org/
|
|
9
|
-
Project-URL: Source Code, https://github.com/maxmind/minfraud-api-python
|
|
10
|
-
Project-URL: Issue Tracker, https://github.com/maxmind/minfraud-api-python/issues
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
11
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
10
|
Classifier: Environment :: Web Environment
|
|
13
11
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
12
|
Classifier: Programming Language :: Python
|
|
16
13
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
19
|
Classifier: Topic :: Internet
|
|
23
20
|
Classifier: Topic :: Internet :: Proxy Servers
|
|
24
21
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
|
-
Requires-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist: geoip2<6.0.0,>=5.0.1
|
|
31
|
-
Requires-Dist: requests<3.0.0,>=2.24.0
|
|
22
|
+
Requires-Dist: aiohttp>=3.6.2,<4.0.0
|
|
23
|
+
Requires-Dist: email-validator>=2.0.0,<3.0.0
|
|
24
|
+
Requires-Dist: geoip2>=5.2.0,<6.0.0
|
|
25
|
+
Requires-Dist: requests>=2.24.0,<3.0.0
|
|
26
|
+
Requires-Dist: typing-extensions>=4.13.2
|
|
32
27
|
Requires-Dist: voluptuous
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Project-URL: Documentation, https://minfraud.readthedocs.org/
|
|
30
|
+
Project-URL: Homepage, https://www.maxmind.com/
|
|
31
|
+
Project-URL: Issue Tracker, https://github.com/maxmind/minfraud-api-python/issues
|
|
32
|
+
Project-URL: Source Code, https://github.com/maxmind/minfraud-api-python
|
|
33
|
+
Description-Content-Type: text/x-rst
|
|
35
34
|
|
|
36
35
|
===================
|
|
37
36
|
minFraud Python API
|
|
@@ -54,12 +53,12 @@ To install the ``minfraud`` module, type:
|
|
|
54
53
|
|
|
55
54
|
$ pip install minfraud
|
|
56
55
|
|
|
57
|
-
If you are not able to
|
|
56
|
+
If you are not able to install from PyPI, you may also use ``pip`` from the
|
|
58
57
|
source directory:
|
|
59
58
|
|
|
60
59
|
.. code-block:: bash
|
|
61
60
|
|
|
62
|
-
$
|
|
61
|
+
$ python -m pip install .
|
|
63
62
|
|
|
64
63
|
Documentation
|
|
65
64
|
-------------
|
|
@@ -191,6 +190,7 @@ Score, Insights and Factors Example
|
|
|
191
190
|
>>> 'user_agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36'
|
|
192
191
|
>>> },
|
|
193
192
|
>>> 'event': {
|
|
193
|
+
>>> 'party': 'customer',
|
|
194
194
|
>>> 'shop_id': 's2123',
|
|
195
195
|
>>> 'type': 'purchase',
|
|
196
196
|
>>> 'transaction_id': 'txn3134133',
|
|
@@ -244,6 +244,7 @@ Score, Insights and Factors Example
|
|
|
244
244
|
>>> 'payment': {
|
|
245
245
|
>>> 'decline_code': 'invalid number',
|
|
246
246
|
>>> 'was_authorized': False,
|
|
247
|
+
>>> 'method': 'card',
|
|
247
248
|
>>> 'processor': 'stripe'
|
|
248
249
|
>>> },
|
|
249
250
|
>>> 'shopping_cart': [{
|
|
@@ -19,12 +19,12 @@ To install the ``minfraud`` module, type:
|
|
|
19
19
|
|
|
20
20
|
$ pip install minfraud
|
|
21
21
|
|
|
22
|
-
If you are not able to
|
|
22
|
+
If you are not able to install from PyPI, you may also use ``pip`` from the
|
|
23
23
|
source directory:
|
|
24
24
|
|
|
25
25
|
.. code-block:: bash
|
|
26
26
|
|
|
27
|
-
$
|
|
27
|
+
$ python -m pip install .
|
|
28
28
|
|
|
29
29
|
Documentation
|
|
30
30
|
-------------
|
|
@@ -156,6 +156,7 @@ Score, Insights and Factors Example
|
|
|
156
156
|
>>> 'user_agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36'
|
|
157
157
|
>>> },
|
|
158
158
|
>>> 'event': {
|
|
159
|
+
>>> 'party': 'customer',
|
|
159
160
|
>>> 'shop_id': 's2123',
|
|
160
161
|
>>> 'type': 'purchase',
|
|
161
162
|
>>> 'transaction_id': 'txn3134133',
|
|
@@ -209,6 +210,7 @@ Score, Insights and Factors Example
|
|
|
209
210
|
>>> 'payment': {
|
|
210
211
|
>>> 'decline_code': 'invalid number',
|
|
211
212
|
>>> 'was_authorized': False,
|
|
213
|
+
>>> 'method': 'card',
|
|
212
214
|
>>> 'processor': 'stripe'
|
|
213
215
|
>>> },
|
|
214
216
|
>>> 'shopping_cart': [{
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "minfraud"
|
|
3
|
+
version = "3.2.0"
|
|
4
|
+
description = "MaxMind minFraud API"
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Gregory Oschwald", email = "goschwald@maxmind.com"},
|
|
7
|
+
]
|
|
8
|
+
dependencies = [
|
|
9
|
+
"aiohttp>=3.6.2,<4.0.0",
|
|
10
|
+
"email_validator>=2.0.0,<3.0.0",
|
|
11
|
+
"geoip2>=5.2.0,<6.0.0",
|
|
12
|
+
"requests>=2.24.0,<3.0.0",
|
|
13
|
+
"typing-extensions>=4.13.2",
|
|
14
|
+
"voluptuous",
|
|
15
|
+
]
|
|
16
|
+
requires-python = ">=3.10"
|
|
17
|
+
readme = "README.rst"
|
|
18
|
+
license = "Apache-2.0"
|
|
19
|
+
license-files = ["LICENSE"]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 5 - Production/Stable",
|
|
22
|
+
"Environment :: Web Environment",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Programming Language :: Python",
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Topic :: Internet",
|
|
32
|
+
"Topic :: Internet :: Proxy Servers",
|
|
33
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=8.3.5",
|
|
39
|
+
"pytest-httpserver>=1.0.10",
|
|
40
|
+
"tox-uv>=1.29.0",
|
|
41
|
+
]
|
|
42
|
+
lint = [
|
|
43
|
+
"mypy>=1.15.0",
|
|
44
|
+
"ruff>=0.11.6",
|
|
45
|
+
"types-requests>=2.32.0.20250328",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Homepage = "https://www.maxmind.com/"
|
|
50
|
+
Documentation = "https://minfraud.readthedocs.org/"
|
|
51
|
+
"Source Code" = "https://github.com/maxmind/minfraud-api-python"
|
|
52
|
+
"Issue Tracker" = "https://github.com/maxmind/minfraud-api-python/issues"
|
|
53
|
+
|
|
54
|
+
[build-system]
|
|
55
|
+
requires = ["uv_build>=0.7.19,<0.8.0"]
|
|
56
|
+
build-backend = "uv_build"
|
|
57
|
+
|
|
58
|
+
[tool.uv.build-backend]
|
|
59
|
+
source-include = [
|
|
60
|
+
"HISTORY.rst",
|
|
61
|
+
"README.rst",
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"docs/html",
|
|
64
|
+
"examples/*.py",
|
|
65
|
+
"tests/*.py",
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[tool.ruff.lint]
|
|
69
|
+
select = ["ALL"]
|
|
70
|
+
ignore = [
|
|
71
|
+
# Redundant as the formatter handles missing trailing commas.
|
|
72
|
+
"COM812",
|
|
73
|
+
|
|
74
|
+
# documenting magic methods
|
|
75
|
+
"D105",
|
|
76
|
+
|
|
77
|
+
# Conflicts with D211
|
|
78
|
+
"D203",
|
|
79
|
+
|
|
80
|
+
# Conflicts with D212
|
|
81
|
+
"D213",
|
|
82
|
+
|
|
83
|
+
# Magic numbers for HTTP status codes seem ok most of the time.
|
|
84
|
+
"PLR2004",
|
|
85
|
+
|
|
86
|
+
# pytest rules
|
|
87
|
+
"PT009",
|
|
88
|
+
"PT027",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[tool.ruff.lint.flake8-builtins]
|
|
92
|
+
ignorelist = ["id"]
|
|
93
|
+
|
|
94
|
+
[tool.ruff.lint.per-file-ignores]
|
|
95
|
+
"docs/*" = ["ALL"]
|
|
96
|
+
"src/minfraud/models.py" = ["ANN401", "PLR0913"]
|
|
97
|
+
"src/minfraud/webservice.py" = ["ANN401"]
|
|
98
|
+
"tests/*" = ["ANN201", "D"]
|
|
99
|
+
|
|
100
|
+
[tool.tox]
|
|
101
|
+
env_list = [
|
|
102
|
+
"3.10",
|
|
103
|
+
"3.11",
|
|
104
|
+
"3.12",
|
|
105
|
+
"3.13",
|
|
106
|
+
"3.14",
|
|
107
|
+
"lint",
|
|
108
|
+
]
|
|
109
|
+
skip_missing_interpreters = false
|
|
110
|
+
|
|
111
|
+
[tool.tox.env_run_base]
|
|
112
|
+
dependency_groups = [
|
|
113
|
+
"dev",
|
|
114
|
+
]
|
|
115
|
+
commands = [
|
|
116
|
+
["pytest", "tests"],
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
[tool.tox.env.lint]
|
|
120
|
+
description = "Code linting"
|
|
121
|
+
python = "3.14"
|
|
122
|
+
dependency_groups = [
|
|
123
|
+
"dev",
|
|
124
|
+
"lint",
|
|
125
|
+
]
|
|
126
|
+
commands = [
|
|
127
|
+
["mypy", "src", "tests"],
|
|
128
|
+
["ruff", "check"],
|
|
129
|
+
["ruff", "format", "--check", "--diff", "."],
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
[tool.tox.gh.python]
|
|
133
|
+
"3.14" = ["3.14", "lint"]
|
|
134
|
+
"3.13" = ["3.13"]
|
|
135
|
+
"3.12" = ["3.12"]
|
|
136
|
+
"3.11" = ["3.11"]
|
|
137
|
+
"3.10" = ["3.10"]
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
"""
|
|
2
|
-
minfraud.errors
|
|
3
|
-
~~~~~~~~~~~~~~~
|
|
1
|
+
"""Typed errors thrown by this library."""
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from typing import Optional
|
|
3
|
+
from __future__ import annotations
|
|
10
4
|
|
|
11
5
|
|
|
12
6
|
class MinFraudError(RuntimeError):
|
|
@@ -26,38 +20,25 @@ class HTTPError(MinFraudError):
|
|
|
26
20
|
|
|
27
21
|
This class represents an HTTP transport error. It extends
|
|
28
22
|
:py:exc:`MinFraudError` and adds attributes of its own.
|
|
23
|
+
"""
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
The HTTP status code returned
|
|
33
|
-
|
|
34
|
-
:type: int
|
|
35
|
-
|
|
36
|
-
.. attribute:: uri:
|
|
37
|
-
|
|
38
|
-
The URI queried
|
|
39
|
-
|
|
40
|
-
:type: str
|
|
41
|
-
|
|
42
|
-
.. attribute:: decoded_content:
|
|
43
|
-
|
|
44
|
-
The decoded response content
|
|
45
|
-
|
|
46
|
-
:type: str
|
|
25
|
+
http_status: int | None
|
|
26
|
+
"""The HTTP status code returned"""
|
|
47
27
|
|
|
48
|
-
|
|
28
|
+
uri: str | None
|
|
29
|
+
"""The URI queried"""
|
|
49
30
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
decoded_content: Optional[str]
|
|
31
|
+
decoded_content: str | None
|
|
32
|
+
"""The decoded response content"""
|
|
53
33
|
|
|
54
34
|
def __init__(
|
|
55
35
|
self,
|
|
56
36
|
message: str,
|
|
57
|
-
http_status:
|
|
58
|
-
uri:
|
|
59
|
-
decoded_content:
|
|
37
|
+
http_status: int | None = None,
|
|
38
|
+
uri: str | None = None,
|
|
39
|
+
decoded_content: str | None = None,
|
|
60
40
|
) -> None:
|
|
41
|
+
"""Initialize an HTTPError instance."""
|
|
61
42
|
super().__init__(message)
|
|
62
43
|
self.http_status = http_status
|
|
63
44
|
self.uri = uri
|