ofac-sanctions-screening 0.1.0__py3-none-any.whl
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.
- ofac_sanctions_screening/__init__.py +136 -0
- ofac_sanctions_screening-0.1.0.dist-info/METADATA +93 -0
- ofac_sanctions_screening-0.1.0.dist-info/RECORD +6 -0
- ofac_sanctions_screening-0.1.0.dist-info/WHEEL +5 -0
- ofac_sanctions_screening-0.1.0.dist-info/licenses/LICENSE +21 -0
- ofac_sanctions_screening-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""ofac-sanctions-screening — OFAC / sanctions / PEP / KYB screening for Python.
|
|
2
|
+
|
|
3
|
+
Screen any person, company, or crypto wallet against OFAC SDN, EU, UK (OFSI),
|
|
4
|
+
UN + 100+ global watchlists (OpenSanctions) and get a PASS / WARN / BLOCK verdict.
|
|
5
|
+
|
|
6
|
+
Free demo (no key, rate-limited):
|
|
7
|
+
from ofac_sanctions_screening import Client
|
|
8
|
+
c = Client()
|
|
9
|
+
print(c.screen("Vladimir Putin")) # sanctions / PEP screen
|
|
10
|
+
print(c.screen_wallet("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")) # OFAC SDN crypto
|
|
11
|
+
print(c.kyb("Acme Inc")) # KYB screen
|
|
12
|
+
|
|
13
|
+
Paid (real data, full coverage) — get a key at https://api.gocreativeai.com/credits/buy
|
|
14
|
+
(card, instant) or pay-per-call in USDC via x402:
|
|
15
|
+
c = Client(api_key="gck_...")
|
|
16
|
+
print(c.verdict("Some Person")) # one PASS / WARN / BLOCK decision
|
|
17
|
+
"""
|
|
18
|
+
import json
|
|
19
|
+
import urllib.request
|
|
20
|
+
import urllib.error
|
|
21
|
+
import urllib.parse
|
|
22
|
+
|
|
23
|
+
__version__ = "0.1.0"
|
|
24
|
+
__all__ = ["Client", "ComplianceError"]
|
|
25
|
+
|
|
26
|
+
_BASE = "https://api.gocreativeai.com"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ComplianceError(Exception):
|
|
30
|
+
"""Raised on API/transport errors."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Client:
|
|
34
|
+
"""Client for the GoCreative OFAC / Sanctions / KYB screening API.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
api_key: a ``gck_...`` key from https://api.gocreativeai.com/credits/buy.
|
|
38
|
+
If omitted, the client uses the free, rate-limited demo endpoints.
|
|
39
|
+
base_url: override the API base (default https://api.gocreativeai.com).
|
|
40
|
+
timeout: request timeout in seconds (default 30).
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self, api_key=None, base_url=_BASE, timeout=30):
|
|
44
|
+
self.api_key = api_key
|
|
45
|
+
self.base_url = base_url.rstrip("/")
|
|
46
|
+
self.timeout = timeout
|
|
47
|
+
|
|
48
|
+
# -- internals --
|
|
49
|
+
@staticmethod
|
|
50
|
+
def _enc(value):
|
|
51
|
+
return urllib.parse.quote(str(value), safe="")
|
|
52
|
+
|
|
53
|
+
def _get(self, path):
|
|
54
|
+
req = urllib.request.Request(self.base_url + path)
|
|
55
|
+
req.add_header("User-Agent", "ofac-sanctions-screening-py/" + __version__)
|
|
56
|
+
req.add_header("Accept", "application/json")
|
|
57
|
+
if self.api_key:
|
|
58
|
+
req.add_header("Authorization", "Bearer " + self.api_key)
|
|
59
|
+
try:
|
|
60
|
+
with urllib.request.urlopen(req, timeout=self.timeout) as resp:
|
|
61
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
62
|
+
except urllib.error.HTTPError as exc:
|
|
63
|
+
if exc.code == 402:
|
|
64
|
+
raise ComplianceError(
|
|
65
|
+
"Payment required. Pass api_key=... (get one instantly with a card at "
|
|
66
|
+
"https://api.gocreativeai.com/credits/buy) or use the free demo methods."
|
|
67
|
+
) from None
|
|
68
|
+
if exc.code == 429:
|
|
69
|
+
raise ComplianceError(
|
|
70
|
+
"Rate limit / free-demo quota reached. Add an api_key for full access."
|
|
71
|
+
) from None
|
|
72
|
+
body = exc.read().decode("utf-8", "replace")[:300]
|
|
73
|
+
raise ComplianceError("HTTP %s: %s" % (exc.code, body)) from None
|
|
74
|
+
except urllib.error.URLError as exc:
|
|
75
|
+
raise ComplianceError("Network error: %s" % exc.reason) from None
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def _paid(self):
|
|
79
|
+
return bool(self.api_key)
|
|
80
|
+
|
|
81
|
+
# -- public methods --
|
|
82
|
+
def screen(self, name):
|
|
83
|
+
"""Sanctions & PEP screen a person or company (OFAC, EU, UK, UN + 100+ lists)."""
|
|
84
|
+
path = ("/v1/verdict/screen/" if self._paid else "/demo/sanctions/") + self._enc(name)
|
|
85
|
+
return self._get(path)
|
|
86
|
+
|
|
87
|
+
def screen_wallet(self, address):
|
|
88
|
+
"""OFAC-screen a Bitcoin/Ethereum wallet address against the OFAC SDN crypto list."""
|
|
89
|
+
path = ("/v1/verdict/wallet/" if self._paid else "/demo/ofac-wallet/") + self._enc(address)
|
|
90
|
+
return self._get(path)
|
|
91
|
+
|
|
92
|
+
def kyb(self, name):
|
|
93
|
+
"""KYB screen a company (sanctions + entity risk + registry + legal)."""
|
|
94
|
+
path = ("/v1/verdict/kyb/" if self._paid else "/demo/kyb/") + self._enc(name)
|
|
95
|
+
return self._get(path)
|
|
96
|
+
|
|
97
|
+
def verdict(self, name):
|
|
98
|
+
"""One PASS / WARN / BLOCK compliance decision (paid — requires api_key)."""
|
|
99
|
+
if not self._paid:
|
|
100
|
+
raise ComplianceError(
|
|
101
|
+
"verdict() is a paid endpoint. Get a key at "
|
|
102
|
+
"https://api.gocreativeai.com/credits/buy, then Client(api_key=...)."
|
|
103
|
+
)
|
|
104
|
+
return self._get("/v1/verdict/check/" + self._enc(name))
|
|
105
|
+
|
|
106
|
+
def screening_report(self, name):
|
|
107
|
+
"""Audit-ready sanctions/PEP screening REPORT — documented evidence (FCA/EU-AML) that
|
|
108
|
+
screening was performed, with name-variants tested, methodology, PASS/REVIEW/BLOCK + audit id.
|
|
109
|
+
Works free (rate-limited) without a key; full report with an api_key."""
|
|
110
|
+
path = ("/v1/verdict/screening-report/" if self._paid else "/demo/screening-report/") + self._enc(name)
|
|
111
|
+
return self._get(path)
|
|
112
|
+
|
|
113
|
+
def wallet_report(self, address):
|
|
114
|
+
"""Audit-ready crypto-wallet OFAC screening report (VASP Travel-Rule / FinCEN evidence).
|
|
115
|
+
Works free (rate-limited) without a key; full report with an api_key."""
|
|
116
|
+
path = ("/v1/verdict/wallet-report/" if self._paid else "/demo/wallet-report/") + self._enc(address)
|
|
117
|
+
return self._get(path)
|
|
118
|
+
|
|
119
|
+
def batch_screen(self, names):
|
|
120
|
+
"""Bulk sanctions/PEP screen — up to 25 comma-separated names in one call. Free demo without a key."""
|
|
121
|
+
path = ("/v1/verdict/batch-screen/" if self._paid else "/demo/batch-screen/") + self._enc(names)
|
|
122
|
+
return self._get(path)
|
|
123
|
+
|
|
124
|
+
def kyb_report(self, name):
|
|
125
|
+
"""Audit-ready KYB / vendor due-diligence report (procurement / EU CSDDD evidence). Paid (requires api_key)."""
|
|
126
|
+
if not self._paid:
|
|
127
|
+
raise ComplianceError("kyb_report() is a paid endpoint. Get a key at https://api.gocreativeai.com/credits/buy.")
|
|
128
|
+
return self._get("/v1/verdict/kyb-report/" + self._enc(name))
|
|
129
|
+
|
|
130
|
+
def risk(self, name):
|
|
131
|
+
"""Entity risk score 0-100 with an onboarding flag (paid — requires api_key)."""
|
|
132
|
+
if not self._paid:
|
|
133
|
+
raise ComplianceError(
|
|
134
|
+
"risk() is a paid endpoint. Get a key at https://api.gocreativeai.com/credits/buy."
|
|
135
|
+
)
|
|
136
|
+
return self._get("/v1/risk/entity-score/" + self._enc(name))
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ofac-sanctions-screening
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: OFAC, sanctions, PEP & KYB screening for Python — screen names, companies & crypto wallets against OFAC SDN, EU, UK, UN + 100+ watchlists. Free demo, no key.
|
|
5
|
+
Author: GoCreative
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://api.gocreativeai.com/p/compliance-screening
|
|
8
|
+
Project-URL: Documentation, https://api.gocreativeai.com/v1/docs
|
|
9
|
+
Project-URL: Free demo, https://api.gocreativeai.com/demo/sanctions/Vladimir%20Putin
|
|
10
|
+
Keywords: ofac,sanctions,sanctions-screening,aml,kyc,kyb,pep,compliance,watchlist,sdn,ofac-api,crypto-compliance,wallet-screening,opensanctions
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# ofac-sanctions-screening
|
|
24
|
+
|
|
25
|
+
**OFAC / sanctions / PEP / KYB screening for Python.** Screen any **person, company, or crypto wallet** against **OFAC SDN, EU, UK (OFSI), UN + 100+ global watchlists** (powered by OpenSanctions) and get a **PASS / WARN / BLOCK** verdict — in one call, with cited sources.
|
|
26
|
+
|
|
27
|
+
- ✅ **Free demo, no signup** — start screening in 10 seconds, no API key.
|
|
28
|
+
- 🪙 **Crypto-wallet OFAC screening** — screen BTC/ETH addresses against the OFAC SDN crypto list (most APIs only do names & companies).
|
|
29
|
+
- 🏢 **KYB-360** — sanctions + PEP + entity risk + registry in one call.
|
|
30
|
+
- ⚖️ **One PASS / WARN / BLOCK verdict** — no raw-list parsing.
|
|
31
|
+
- 🔌 **Zero dependencies**, Python 3.8+. Pay-per-call (card or USDC via x402) — no seat license, no enterprise contract.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install ofac-sanctions-screening
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quickstart (free, no key)
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from ofac_sanctions_screening import Client
|
|
43
|
+
|
|
44
|
+
c = Client() # free demo mode, rate-limited
|
|
45
|
+
|
|
46
|
+
# Sanctions / PEP screen a person or company
|
|
47
|
+
print(c.screen("Vladimir Putin"))
|
|
48
|
+
# {'result': {'flagged': True, 'match_count': 2, 'risk_topics': ['sanction', 'role.pep', ...], 'matches': [...]}}
|
|
49
|
+
|
|
50
|
+
# OFAC-screen a crypto wallet against the SDN crypto list
|
|
51
|
+
print(c.screen_wallet("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"))
|
|
52
|
+
|
|
53
|
+
# KYB screen a company
|
|
54
|
+
print(c.kyb("Acme Inc"))
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Full access (paid)
|
|
58
|
+
|
|
59
|
+
Get an API key instantly with a card at **https://api.gocreativeai.com/credits/buy** (or pay-per-call in USDC via [x402](https://api.gocreativeai.com/no-api-key) — no key at all):
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
c = Client(api_key="gck_...")
|
|
63
|
+
|
|
64
|
+
c.screen("Some Person") # full sanctions & PEP coverage
|
|
65
|
+
c.screen_wallet("0xabc...") # full OFAC wallet screen
|
|
66
|
+
c.kyb("Some Company Ltd") # full KYB-360 dossier
|
|
67
|
+
c.verdict("Some Person") # one PASS / WARN / BLOCK decision
|
|
68
|
+
c.risk("Some Company") # entity risk score 0-100 + onboarding flag
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Methods
|
|
72
|
+
|
|
73
|
+
| Method | Free demo | Paid endpoint | Returns |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| `screen(name)` | ✅ | `/v1/verdict/screen` | sanctions & PEP matches across OFAC/EU/UK/UN + 100+ lists |
|
|
76
|
+
| `screen_wallet(address)` | ✅ | `/v1/verdict/wallet` | OFAC SDN crypto-wallet match |
|
|
77
|
+
| `kyb(name)` | ✅ | `/v1/verdict/kyb` | KYB-360 dossier |
|
|
78
|
+
| `verdict(name)` | — | `/v1/verdict/check` | PASS / WARN / BLOCK |
|
|
79
|
+
| `risk(name)` | — | `/v1/risk/entity-score` | risk score 0-100 |
|
|
80
|
+
|
|
81
|
+
All methods return parsed JSON (`dict`). Errors raise `ComplianceError` with a clear message (402 → how to get a key, 429 → demo quota reached).
|
|
82
|
+
|
|
83
|
+
## Why this vs the incumbents
|
|
84
|
+
|
|
85
|
+
Same OpenSanctions data the serious vendors use, but **keyless and pay-per-call** — a fraction of the cost of Dataspike, ComplyAdvantage, or enterprise contracts, and it adds **crypto-wallet OFAC screening** most don't. See the comparisons: [vs Dataspike](https://api.gocreativeai.com/vs/dataspike) · [vs sanctions.io](https://api.gocreativeai.com/vs/sanctions-io) · [vs ComplyAdvantage](https://api.gocreativeai.com/vs/complyadvantage).
|
|
86
|
+
|
|
87
|
+
## Disclaimer
|
|
88
|
+
|
|
89
|
+
Screening results draw on public watchlist + sanctions data and are provided for compliance-screening support. Verify matches before acting; absence of a match is not a guarantee of clearance. Not legal advice.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT © GoCreative · [Product page](https://api.gocreativeai.com/p/compliance-screening) · [Docs](https://api.gocreativeai.com/v1/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ofac_sanctions_screening/__init__.py,sha256=tjpgrvh7FxGxMQ2lFx_WD2BFtxrmst4vFQRc3Nv6aeg,6112
|
|
2
|
+
ofac_sanctions_screening-0.1.0.dist-info/licenses/LICENSE,sha256=m_9mvjZ-xYt_pH4zl1h9jsDl9FCjU9CtfliJFLsQ4vw,1067
|
|
3
|
+
ofac_sanctions_screening-0.1.0.dist-info/METADATA,sha256=reUl7wttv9Gf8zw_l7PkX8bqy7rOoWr6D01ZJLXAVZ8,4476
|
|
4
|
+
ofac_sanctions_screening-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
ofac_sanctions_screening-0.1.0.dist-info/top_level.txt,sha256=NjgKux8OaLrjEgmTAZbQ2lxju4TKfzYBzpBmTvkMhto,25
|
|
6
|
+
ofac_sanctions_screening-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GoCreative
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ofac_sanctions_screening
|