factline 0.1.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.
- factline-0.1.0/LICENSE +9 -0
- factline-0.1.0/PKG-INFO +39 -0
- factline-0.1.0/README.md +25 -0
- factline-0.1.0/factline/__init__.py +122 -0
- factline-0.1.0/factline.egg-info/PKG-INFO +39 -0
- factline-0.1.0/factline.egg-info/SOURCES.txt +8 -0
- factline-0.1.0/factline.egg-info/dependency_links.txt +1 -0
- factline-0.1.0/factline.egg-info/top_level.txt +1 -0
- factline-0.1.0/pyproject.toml +20 -0
- factline-0.1.0/setup.cfg +4 -0
factline-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Factline
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
factline-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: factline
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Client for Factline: sanctions, PEP, KYC and company checks, plus Dutch address, rent and vehicle data, for apps and AI agents.
|
|
5
|
+
Author-email: Factline <hello@factline.dev>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://factline.dev/agents
|
|
8
|
+
Project-URL: Documentation, https://factline.dev/docs
|
|
9
|
+
Keywords: sanctions,pep,kyc,kyb,aml,netherlands,rdw,mcp,ai-agents,x402
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# factline
|
|
16
|
+
|
|
17
|
+
Official-records checks for apps and AI agents: sanctions and PEP screening, one-call KYC, company registers in 10 countries, Dutch insolvency, EU VAT, EORI, IBAN, email and phone checks, plus Dutch address, neighbourhood, rent, flood, school and vehicle data. Standard library only.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install factline
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from factline import Factline
|
|
25
|
+
|
|
26
|
+
fl = Factline(api_key="fl_live_...") # or set FACTLINE_API_KEY
|
|
27
|
+
|
|
28
|
+
fl.sanctions_screen(name="Acme Trading Ltd")
|
|
29
|
+
fl.kyc_check(name="Jan Jansen", email="jan@example.nl", phone="+31612345678")
|
|
30
|
+
fl.company_lookup(name="Tesco", country="GB")
|
|
31
|
+
fl.rent_check(postcode="2517AS", house_number=100)
|
|
32
|
+
fl.vehicle_basic(licence_plate="GT-722-F") # free, no key needed
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **API key:** free trial, EUR 19 credit pack or monthly plans at https://factline.dev/business. Without a key, paid calls raise `FactlinePaymentRequired` (the API answers with an x402 payment request that agents with a wallet can pay).
|
|
36
|
+
- **Free preview:** `fl.preview("sanctions_screen", name="Acme")`.
|
|
37
|
+
- **Agents (MCP):** `MCP_SERVERS["kyc"]`, `["nl"]`, `["vehicles"]`. With LangChain: `MultiServerMCPClient({"factline": {"url": MCP_SERVERS["kyc"], "transport": "streamable_http"}})`. More setups: https://factline.dev/agents
|
|
38
|
+
|
|
39
|
+
MIT licence. Data comes from official sources; see https://factline.dev/trust.
|
factline-0.1.0/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# factline
|
|
2
|
+
|
|
3
|
+
Official-records checks for apps and AI agents: sanctions and PEP screening, one-call KYC, company registers in 10 countries, Dutch insolvency, EU VAT, EORI, IBAN, email and phone checks, plus Dutch address, neighbourhood, rent, flood, school and vehicle data. Standard library only.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install factline
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from factline import Factline
|
|
11
|
+
|
|
12
|
+
fl = Factline(api_key="fl_live_...") # or set FACTLINE_API_KEY
|
|
13
|
+
|
|
14
|
+
fl.sanctions_screen(name="Acme Trading Ltd")
|
|
15
|
+
fl.kyc_check(name="Jan Jansen", email="jan@example.nl", phone="+31612345678")
|
|
16
|
+
fl.company_lookup(name="Tesco", country="GB")
|
|
17
|
+
fl.rent_check(postcode="2517AS", house_number=100)
|
|
18
|
+
fl.vehicle_basic(licence_plate="GT-722-F") # free, no key needed
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **API key:** free trial, EUR 19 credit pack or monthly plans at https://factline.dev/business. Without a key, paid calls raise `FactlinePaymentRequired` (the API answers with an x402 payment request that agents with a wallet can pay).
|
|
22
|
+
- **Free preview:** `fl.preview("sanctions_screen", name="Acme")`.
|
|
23
|
+
- **Agents (MCP):** `MCP_SERVERS["kyc"]`, `["nl"]`, `["vehicles"]`. With LangChain: `MultiServerMCPClient({"factline": {"url": MCP_SERVERS["kyc"], "transport": "streamable_http"}})`. More setups: https://factline.dev/agents
|
|
24
|
+
|
|
25
|
+
MIT licence. Data comes from official sources; see https://factline.dev/trust.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""Factline client: official-records checks for apps and AI agents (https://factline.dev/agents).
|
|
2
|
+
|
|
3
|
+
Generated from https://factline.dev/openapi.json. Standard library only.
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import urllib.error
|
|
10
|
+
import urllib.parse
|
|
11
|
+
import urllib.request
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
__version__ = "0.1.0"
|
|
15
|
+
|
|
16
|
+
MCP_SERVERS = {
|
|
17
|
+
"kyc": "https://factline.dev/mcp/kyc",
|
|
18
|
+
"nl": "https://factline.dev/mcp/nl",
|
|
19
|
+
"vehicles": "https://factline.dev/mcp/vehicles",
|
|
20
|
+
"all": "https://factline.dev/mcp",
|
|
21
|
+
"chat": "https://factline.dev/mcp/chat",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
METHODS: dict[str, tuple[str, tuple[str, ...]]] = {
|
|
25
|
+
"home_basic": ("/v1/home/basic", ()),
|
|
26
|
+
"vehicle_basic": ("/v1/vehicle/basic", ("licence_plate",)),
|
|
27
|
+
"schools": ("/v1/schools", ("postcode",)),
|
|
28
|
+
"vehicle_model": ("/v1/vehicle/model", ("make", "model",)),
|
|
29
|
+
"home_report": ("/v1/home/report", ()),
|
|
30
|
+
"home_compare": ("/v1/home/compare", ("addresses",)),
|
|
31
|
+
"neighbourhood": ("/v1/neighbourhood", ()),
|
|
32
|
+
"address_lookup": ("/v1/address/lookup", ()),
|
|
33
|
+
"address_reverse": ("/v1/address/reverse", ("lat", "lon",)),
|
|
34
|
+
"energy_label": ("/v1/energy-label", ()),
|
|
35
|
+
"crime": ("/v1/crime", ()),
|
|
36
|
+
"house_prices": ("/v1/house-prices", ()),
|
|
37
|
+
"email_verify": ("/v1/email/verify", ("email",)),
|
|
38
|
+
"phone_verify": ("/v1/phone/verify", ("phone",)),
|
|
39
|
+
"kyc_check": ("/v1/kyc/check", ()),
|
|
40
|
+
"eu_vat": ("/v1/eu/vat", ("vat",)),
|
|
41
|
+
"sanctions_screen": ("/v1/sanctions/screen", ("name",)),
|
|
42
|
+
"company_lookup": ("/v1/company/lookup", ()),
|
|
43
|
+
"vehicle_compare": ("/v1/vehicle/compare", ("plates",)),
|
|
44
|
+
"vehicle_apk": ("/v1/vehicle/apk", ("licence_plate",)),
|
|
45
|
+
"postcode_addresses": ("/v1/postcode/addresses", ("postcode",)),
|
|
46
|
+
"sanctions_wallet": ("/v1/sanctions/wallet", ("address",)),
|
|
47
|
+
"sanctions_batch": ("/v1/sanctions/batch", ("names",)),
|
|
48
|
+
"batch_addresses": ("/v1/batch/addresses", ("addresses",)),
|
|
49
|
+
"flood_risk": ("/v1/flood-risk", ()),
|
|
50
|
+
"eu_tenders": ("/v1/eu/tenders", ("country",)),
|
|
51
|
+
"nl_insolvency": ("/v1/nl/insolvency", ()),
|
|
52
|
+
"pep_screen": ("/v1/pep/screen", ("name",)),
|
|
53
|
+
"pep_batch": ("/v1/pep/batch", ("names",)),
|
|
54
|
+
"domain_check": ("/v1/domain/check", ("domain",)),
|
|
55
|
+
"iban_check": ("/v1/iban/check", ("iban",)),
|
|
56
|
+
"eu_eori": ("/v1/eu/eori", ("eori",)),
|
|
57
|
+
"rent_check": ("/v1/rent-check", ()),
|
|
58
|
+
"vehicle_report": ("/v1/vehicle/report", ("licence_plate",)),
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class FactlineError(Exception):
|
|
63
|
+
def __init__(self, status: int, body: Any):
|
|
64
|
+
self.status = status
|
|
65
|
+
self.body = body
|
|
66
|
+
super().__init__((body or {}).get("message") if isinstance(body, dict) else f"Factline returned HTTP {status}")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class FactlinePaymentRequired(FactlineError):
|
|
70
|
+
"""A paid endpoint was called without an API key (HTTP 402, x402 payment request)."""
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def preview(self) -> str | None:
|
|
74
|
+
return self.body.get("preview") if isinstance(self.body, dict) else None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class Factline:
|
|
78
|
+
def __init__(self, api_key: str | None = None, base_url: str = "https://factline.dev", timeout: float = 30):
|
|
79
|
+
self.api_key = api_key or os.environ.get("FACTLINE_API_KEY")
|
|
80
|
+
self.base_url = base_url.rstrip("/")
|
|
81
|
+
self.timeout = timeout
|
|
82
|
+
|
|
83
|
+
def call(self, path: str, **params: Any) -> Any:
|
|
84
|
+
"""Calls any endpoint, e.g. call("/v1/sanctions/screen", name="Acme")."""
|
|
85
|
+
query = urllib.parse.urlencode({k: v for k, v in params.items() if v is not None})
|
|
86
|
+
req = urllib.request.Request(f"{self.base_url}{path}{'?' + query if query else ''}", headers={"accept": "application/json", "user-agent": f"factline-python/{__version__}"})
|
|
87
|
+
if self.api_key:
|
|
88
|
+
req.add_header("x-api-key", self.api_key)
|
|
89
|
+
try:
|
|
90
|
+
with urllib.request.urlopen(req, timeout=self.timeout) as r:
|
|
91
|
+
return json.load(r)
|
|
92
|
+
except urllib.error.HTTPError as e:
|
|
93
|
+
try:
|
|
94
|
+
body = json.load(e)
|
|
95
|
+
except Exception: # noqa: BLE001
|
|
96
|
+
body = None
|
|
97
|
+
if e.code == 402:
|
|
98
|
+
raise FactlinePaymentRequired(402, body) from None
|
|
99
|
+
raise FactlineError(e.code, body) from None
|
|
100
|
+
|
|
101
|
+
def preview(self, method: str, **params: Any) -> Any:
|
|
102
|
+
"""Free preview of a paid check: validates the input and shows what the answer contains."""
|
|
103
|
+
path, _ = METHODS[method]
|
|
104
|
+
return self.call(path + "/preview", **params)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _make(name: str, path: str, required: tuple[str, ...]):
|
|
108
|
+
def method(self: Factline, **params: Any) -> Any:
|
|
109
|
+
missing = [r for r in required if params.get(r) is None]
|
|
110
|
+
if missing:
|
|
111
|
+
raise TypeError(f"{name}: missing {', '.join(missing)}")
|
|
112
|
+
return self.call(path, **params)
|
|
113
|
+
|
|
114
|
+
method.__name__ = name
|
|
115
|
+
method.__doc__ = f"GET {path}"
|
|
116
|
+
return method
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
for _name, (_path, _req) in METHODS.items():
|
|
120
|
+
setattr(Factline, _name, _make(_name, _path, _req))
|
|
121
|
+
|
|
122
|
+
__all__ = ["Factline", "FactlineError", "FactlinePaymentRequired", "MCP_SERVERS", "METHODS"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: factline
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Client for Factline: sanctions, PEP, KYC and company checks, plus Dutch address, rent and vehicle data, for apps and AI agents.
|
|
5
|
+
Author-email: Factline <hello@factline.dev>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://factline.dev/agents
|
|
8
|
+
Project-URL: Documentation, https://factline.dev/docs
|
|
9
|
+
Keywords: sanctions,pep,kyc,kyb,aml,netherlands,rdw,mcp,ai-agents,x402
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# factline
|
|
16
|
+
|
|
17
|
+
Official-records checks for apps and AI agents: sanctions and PEP screening, one-call KYC, company registers in 10 countries, Dutch insolvency, EU VAT, EORI, IBAN, email and phone checks, plus Dutch address, neighbourhood, rent, flood, school and vehicle data. Standard library only.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install factline
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from factline import Factline
|
|
25
|
+
|
|
26
|
+
fl = Factline(api_key="fl_live_...") # or set FACTLINE_API_KEY
|
|
27
|
+
|
|
28
|
+
fl.sanctions_screen(name="Acme Trading Ltd")
|
|
29
|
+
fl.kyc_check(name="Jan Jansen", email="jan@example.nl", phone="+31612345678")
|
|
30
|
+
fl.company_lookup(name="Tesco", country="GB")
|
|
31
|
+
fl.rent_check(postcode="2517AS", house_number=100)
|
|
32
|
+
fl.vehicle_basic(licence_plate="GT-722-F") # free, no key needed
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **API key:** free trial, EUR 19 credit pack or monthly plans at https://factline.dev/business. Without a key, paid calls raise `FactlinePaymentRequired` (the API answers with an x402 payment request that agents with a wallet can pay).
|
|
36
|
+
- **Free preview:** `fl.preview("sanctions_screen", name="Acme")`.
|
|
37
|
+
- **Agents (MCP):** `MCP_SERVERS["kyc"]`, `["nl"]`, `["vehicles"]`. With LangChain: `MultiServerMCPClient({"factline": {"url": MCP_SERVERS["kyc"], "transport": "streamable_http"}})`. More setups: https://factline.dev/agents
|
|
38
|
+
|
|
39
|
+
MIT licence. Data comes from official sources; see https://factline.dev/trust.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
factline
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "factline"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Client for Factline: sanctions, PEP, KYC and company checks, plus Dutch address, rent and vehicle data, for apps and AI agents."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{ name = "Factline", email = "hello@factline.dev" }]
|
|
13
|
+
keywords = ["sanctions", "pep", "kyc", "kyb", "aml", "netherlands", "rdw", "mcp", "ai-agents", "x402"]
|
|
14
|
+
|
|
15
|
+
[project.urls]
|
|
16
|
+
Homepage = "https://factline.dev/agents"
|
|
17
|
+
Documentation = "https://factline.dev/docs"
|
|
18
|
+
|
|
19
|
+
[tool.setuptools]
|
|
20
|
+
packages = ["factline"]
|
factline-0.1.0/setup.cfg
ADDED