isvalid-sdk 0.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.
Files changed (42) hide show
  1. isvalid_sdk-0.2.0/.github/workflows/ci.yml +18 -0
  2. isvalid_sdk-0.2.0/.github/workflows/publish.yml +20 -0
  3. isvalid_sdk-0.2.0/.gitignore +13 -0
  4. isvalid_sdk-0.2.0/LICENSE +21 -0
  5. isvalid_sdk-0.2.0/PKG-INFO +202 -0
  6. isvalid_sdk-0.2.0/README.md +173 -0
  7. isvalid_sdk-0.2.0/isvalid_sdk/__init__.py +220 -0
  8. isvalid_sdk-0.2.0/isvalid_sdk/client.py +107 -0
  9. isvalid_sdk-0.2.0/isvalid_sdk/errors.py +19 -0
  10. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/__init__.py +0 -0
  11. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/au.py +12 -0
  12. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/br.py +15 -0
  13. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/country.py +17 -0
  14. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/currency.py +17 -0
  15. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/es.py +12 -0
  16. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/gb.py +12 -0
  17. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/iata.py +34 -0
  18. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/india.py +12 -0
  19. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/language.py +17 -0
  20. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/lei.py +37 -0
  21. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/net.py +15 -0
  22. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/pl.py +24 -0
  23. isvalid_sdk-0.2.0/isvalid_sdk/namespaces/us.py +12 -0
  24. isvalid_sdk-0.2.0/isvalid_sdk/py.typed +0 -0
  25. isvalid_sdk-0.2.0/isvalid_sdk/types/__init__.py +14 -0
  26. isvalid_sdk-0.2.0/isvalid_sdk/types/au.py +15 -0
  27. isvalid_sdk-0.2.0/isvalid_sdk/types/br.py +24 -0
  28. isvalid_sdk-0.2.0/isvalid_sdk/types/country.py +27 -0
  29. isvalid_sdk-0.2.0/isvalid_sdk/types/currency.py +26 -0
  30. isvalid_sdk-0.2.0/isvalid_sdk/types/es.py +16 -0
  31. isvalid_sdk-0.2.0/isvalid_sdk/types/gb.py +16 -0
  32. isvalid_sdk-0.2.0/isvalid_sdk/types/iata.py +48 -0
  33. isvalid_sdk-0.2.0/isvalid_sdk/types/india.py +19 -0
  34. isvalid_sdk-0.2.0/isvalid_sdk/types/language.py +24 -0
  35. isvalid_sdk-0.2.0/isvalid_sdk/types/lei.py +69 -0
  36. isvalid_sdk-0.2.0/isvalid_sdk/types/net.py +28 -0
  37. isvalid_sdk-0.2.0/isvalid_sdk/types/pl.py +82 -0
  38. isvalid_sdk-0.2.0/isvalid_sdk/types/simple.py +427 -0
  39. isvalid_sdk-0.2.0/isvalid_sdk/types/us.py +15 -0
  40. isvalid_sdk-0.2.0/pyproject.toml +40 -0
  41. isvalid_sdk-0.2.0/tests/__init__.py +0 -0
  42. isvalid_sdk-0.2.0/tests/test_client.py +42 -0
@@ -0,0 +1,18 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: ${{ matrix.python }}
16
+ - run: pip install -e ".[dev]"
17
+ - run: python -m mypy isvalid_sdk
18
+ - run: python -m pytest
@@ -0,0 +1,20 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - run: pip install build
19
+ - run: python -m build
20
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .venv/
10
+ venv/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .pytest_cache/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 isvalid.dev
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,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: isvalid-sdk
3
+ Version: 0.2.0
4
+ Summary: Python SDK for the isvalid.dev validation API
5
+ Project-URL: Homepage, https://isvalid.dev
6
+ Project-URL: Documentation, https://isvalid.dev/docs
7
+ Project-URL: Repository, https://github.com/isvalid-dev/isvalid-sdk-python
8
+ Author: isvalid.dev
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,email,iban,isin,isvalid,lei,sdk,validation,vat
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.9
23
+ Requires-Dist: httpx>=0.24.0
24
+ Requires-Dist: typing-extensions>=4.0.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: mypy>=1.0; extra == 'dev'
27
+ Requires-Dist: pytest>=7.0; extra == 'dev'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # isvalid-sdk
31
+
32
+ Python SDK for the [isvalid.dev](https://isvalid.dev) validation API.
33
+
34
+ ## Features
35
+
36
+ - **Single dependency** — only `httpx`
37
+ - **Full type hints** with `TypedDict` for every endpoint response
38
+ - **Context manager** support for proper resource cleanup
39
+ - **Automatic retry** with exponential backoff for 429/5xx
40
+ - **Custom exception classes** for auth and rate limit errors
41
+ - **Python 3.9+**
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install isvalid-sdk
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ Get your free API key at [isvalid.dev/getting-started](https://isvalid.dev/getting-started).
52
+
53
+ ```python
54
+ from isvalid_sdk import IsValidConfig, create_client
55
+
56
+ iv = create_client(IsValidConfig(api_key="your-api-key"))
57
+
58
+ # Simple validation
59
+ email = iv.email("user@example.com", check_mx=True)
60
+ # => {"valid": True, "local": "user", "domain": "example.com", "mxValid": True}
61
+
62
+ iban = iv.iban("DE89370400440532013000")
63
+ # => {"valid": True, "countryCode": "DE", "bankName": "Commerzbank", ...}
64
+
65
+ vat = iv.vat("DE123456789", check_vies=True)
66
+ # => {"valid": True, "countryCode": "DE", "isEU": True, "vies": {"checked": True, ...}}
67
+ ```
68
+
69
+ ## Context Manager
70
+
71
+ ```python
72
+ with create_client(IsValidConfig(api_key="your-api-key")) as iv:
73
+ result = iv.email("user@example.com")
74
+ ```
75
+
76
+ ## Namespaced Methods
77
+
78
+ ```python
79
+ # LEI
80
+ lei = iv.lei("5493001KJTIIGC8Y1R12")
81
+ search = iv.lei.search("Apple", country="US", limit=5)
82
+ lous = iv.lei.lous()
83
+
84
+ # Country / Currency / Language
85
+ country = iv.country("PL")
86
+ countries = iv.country.list()
87
+
88
+ currency = iv.currency("USD")
89
+ currencies = iv.currency.list()
90
+
91
+ language = iv.language("en")
92
+ languages = iv.language.list()
93
+
94
+ # IATA
95
+ flight = iv.iata.flight("LH1234")
96
+ airline = iv.iata.airline("LH")
97
+ airlines = iv.iata.airline.list()
98
+ airport = iv.iata.airport("WAW")
99
+ ```
100
+
101
+ ## Country-Specific Endpoints
102
+
103
+ ```python
104
+ # Poland
105
+ iv.pl.pesel("44051401358")
106
+ iv.pl.regon("012345678", lookup=True)
107
+ iv.pl.krs("0000123456", lookup=True)
108
+
109
+ # Brazil
110
+ iv.br.cnpj("11.222.333/0001-81")
111
+ iv.br.cpf("123.456.789-09")
112
+
113
+ # Other
114
+ iv.au.abn("51824753556")
115
+ iv.es.nif("12345678Z")
116
+ iv.in_.gstin("27AAPFU0939F1ZV") # note: in_ (reserved word)
117
+ iv.us.npi("1234567893")
118
+ iv.gb.sort_code("12-34-56")
119
+ ```
120
+
121
+ ## Network & Financial
122
+
123
+ ```python
124
+ # Network
125
+ iv.net.ip("192.168.1.1")
126
+ iv.net.mac("00:1B:44:11:3A:B7")
127
+
128
+ # Financial
129
+ iv.isin("US0378331005")
130
+ iv.dti("B1234567Z")
131
+ iv.bic("DEUTDEFF")
132
+ iv.cusip("037833100")
133
+ iv.credit_card("4111111111111111") # POST endpoint
134
+ ```
135
+
136
+ ## All Simple Endpoints
137
+
138
+ ```python
139
+ iv.email(value, check_mx=) iv.iban(value, country_code=)
140
+ iv.isin(value) iv.dti(value)
141
+ iv.vat(value, country_code=, check_vies=)
142
+ iv.gps(value) iv.phone(value, country_code=)
143
+ iv.url(value) iv.ean(value)
144
+ iv.isbn(value) iv.issn(value)
145
+ iv.bic(value) iv.cusip(value)
146
+ iv.cfi(value) iv.mic(value)
147
+ iv.nuts(value) iv.uuid(value, version=)
148
+ iv.jwt(value) iv.vin(value)
149
+ iv.imei(value) iv.semver(value)
150
+ iv.color(value) iv.boolean(value)
151
+ iv.date(value, format=) iv.btc_address(value)
152
+ iv.postal_code(value, country_code=)
153
+ iv.aba(value) iv.container_code(value)
154
+ iv.sscc(value) iv.gln(value)
155
+ iv.qr(value) iv.credit_card(number)
156
+ ```
157
+
158
+ ## Configuration
159
+
160
+ ```python
161
+ from isvalid_sdk import IsValidConfig, RetryConfig, create_client
162
+
163
+ iv = create_client(IsValidConfig(
164
+ api_key="your-api-key",
165
+ base_url="https://api.isvalid.dev", # default
166
+ timeout=15.0, # default: 10.0 (seconds)
167
+ retry=RetryConfig(
168
+ max_retries=5, # default: 3
169
+ initial_delay=1.0, # default: 0.5
170
+ max_delay=30.0, # default: 10.0
171
+ retry_on=(429, 500, 502, 503), # default
172
+ ),
173
+ ))
174
+
175
+ # Disable retry
176
+ iv = create_client(IsValidConfig(api_key="...", retry=None))
177
+ ```
178
+
179
+ ## Error Handling
180
+
181
+ ```python
182
+ from isvalid_sdk import (
183
+ IsValidError, IsValidAuthError, IsValidRateLimitError, create_client
184
+ )
185
+
186
+ try:
187
+ iv.email("test@example.com")
188
+ except IsValidRateLimitError as e:
189
+ print("Rate limited, retry after:", e.retry_after, "seconds")
190
+ except IsValidAuthError as e:
191
+ print("Invalid API key")
192
+ except IsValidError as e:
193
+ print("API error:", e.status, e.body["error"])
194
+ ```
195
+
196
+ ## API Reference
197
+
198
+ Full endpoint documentation: [isvalid.dev/docs](https://isvalid.dev/docs)
199
+
200
+ ## License
201
+
202
+ MIT
@@ -0,0 +1,173 @@
1
+ # isvalid-sdk
2
+
3
+ Python SDK for the [isvalid.dev](https://isvalid.dev) validation API.
4
+
5
+ ## Features
6
+
7
+ - **Single dependency** — only `httpx`
8
+ - **Full type hints** with `TypedDict` for every endpoint response
9
+ - **Context manager** support for proper resource cleanup
10
+ - **Automatic retry** with exponential backoff for 429/5xx
11
+ - **Custom exception classes** for auth and rate limit errors
12
+ - **Python 3.9+**
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install isvalid-sdk
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ Get your free API key at [isvalid.dev/getting-started](https://isvalid.dev/getting-started).
23
+
24
+ ```python
25
+ from isvalid_sdk import IsValidConfig, create_client
26
+
27
+ iv = create_client(IsValidConfig(api_key="your-api-key"))
28
+
29
+ # Simple validation
30
+ email = iv.email("user@example.com", check_mx=True)
31
+ # => {"valid": True, "local": "user", "domain": "example.com", "mxValid": True}
32
+
33
+ iban = iv.iban("DE89370400440532013000")
34
+ # => {"valid": True, "countryCode": "DE", "bankName": "Commerzbank", ...}
35
+
36
+ vat = iv.vat("DE123456789", check_vies=True)
37
+ # => {"valid": True, "countryCode": "DE", "isEU": True, "vies": {"checked": True, ...}}
38
+ ```
39
+
40
+ ## Context Manager
41
+
42
+ ```python
43
+ with create_client(IsValidConfig(api_key="your-api-key")) as iv:
44
+ result = iv.email("user@example.com")
45
+ ```
46
+
47
+ ## Namespaced Methods
48
+
49
+ ```python
50
+ # LEI
51
+ lei = iv.lei("5493001KJTIIGC8Y1R12")
52
+ search = iv.lei.search("Apple", country="US", limit=5)
53
+ lous = iv.lei.lous()
54
+
55
+ # Country / Currency / Language
56
+ country = iv.country("PL")
57
+ countries = iv.country.list()
58
+
59
+ currency = iv.currency("USD")
60
+ currencies = iv.currency.list()
61
+
62
+ language = iv.language("en")
63
+ languages = iv.language.list()
64
+
65
+ # IATA
66
+ flight = iv.iata.flight("LH1234")
67
+ airline = iv.iata.airline("LH")
68
+ airlines = iv.iata.airline.list()
69
+ airport = iv.iata.airport("WAW")
70
+ ```
71
+
72
+ ## Country-Specific Endpoints
73
+
74
+ ```python
75
+ # Poland
76
+ iv.pl.pesel("44051401358")
77
+ iv.pl.regon("012345678", lookup=True)
78
+ iv.pl.krs("0000123456", lookup=True)
79
+
80
+ # Brazil
81
+ iv.br.cnpj("11.222.333/0001-81")
82
+ iv.br.cpf("123.456.789-09")
83
+
84
+ # Other
85
+ iv.au.abn("51824753556")
86
+ iv.es.nif("12345678Z")
87
+ iv.in_.gstin("27AAPFU0939F1ZV") # note: in_ (reserved word)
88
+ iv.us.npi("1234567893")
89
+ iv.gb.sort_code("12-34-56")
90
+ ```
91
+
92
+ ## Network & Financial
93
+
94
+ ```python
95
+ # Network
96
+ iv.net.ip("192.168.1.1")
97
+ iv.net.mac("00:1B:44:11:3A:B7")
98
+
99
+ # Financial
100
+ iv.isin("US0378331005")
101
+ iv.dti("B1234567Z")
102
+ iv.bic("DEUTDEFF")
103
+ iv.cusip("037833100")
104
+ iv.credit_card("4111111111111111") # POST endpoint
105
+ ```
106
+
107
+ ## All Simple Endpoints
108
+
109
+ ```python
110
+ iv.email(value, check_mx=) iv.iban(value, country_code=)
111
+ iv.isin(value) iv.dti(value)
112
+ iv.vat(value, country_code=, check_vies=)
113
+ iv.gps(value) iv.phone(value, country_code=)
114
+ iv.url(value) iv.ean(value)
115
+ iv.isbn(value) iv.issn(value)
116
+ iv.bic(value) iv.cusip(value)
117
+ iv.cfi(value) iv.mic(value)
118
+ iv.nuts(value) iv.uuid(value, version=)
119
+ iv.jwt(value) iv.vin(value)
120
+ iv.imei(value) iv.semver(value)
121
+ iv.color(value) iv.boolean(value)
122
+ iv.date(value, format=) iv.btc_address(value)
123
+ iv.postal_code(value, country_code=)
124
+ iv.aba(value) iv.container_code(value)
125
+ iv.sscc(value) iv.gln(value)
126
+ iv.qr(value) iv.credit_card(number)
127
+ ```
128
+
129
+ ## Configuration
130
+
131
+ ```python
132
+ from isvalid_sdk import IsValidConfig, RetryConfig, create_client
133
+
134
+ iv = create_client(IsValidConfig(
135
+ api_key="your-api-key",
136
+ base_url="https://api.isvalid.dev", # default
137
+ timeout=15.0, # default: 10.0 (seconds)
138
+ retry=RetryConfig(
139
+ max_retries=5, # default: 3
140
+ initial_delay=1.0, # default: 0.5
141
+ max_delay=30.0, # default: 10.0
142
+ retry_on=(429, 500, 502, 503), # default
143
+ ),
144
+ ))
145
+
146
+ # Disable retry
147
+ iv = create_client(IsValidConfig(api_key="...", retry=None))
148
+ ```
149
+
150
+ ## Error Handling
151
+
152
+ ```python
153
+ from isvalid_sdk import (
154
+ IsValidError, IsValidAuthError, IsValidRateLimitError, create_client
155
+ )
156
+
157
+ try:
158
+ iv.email("test@example.com")
159
+ except IsValidRateLimitError as e:
160
+ print("Rate limited, retry after:", e.retry_after, "seconds")
161
+ except IsValidAuthError as e:
162
+ print("Invalid API key")
163
+ except IsValidError as e:
164
+ print("API error:", e.status, e.body["error"])
165
+ ```
166
+
167
+ ## API Reference
168
+
169
+ Full endpoint documentation: [isvalid.dev/docs](https://isvalid.dev/docs)
170
+
171
+ ## License
172
+
173
+ MIT
@@ -0,0 +1,220 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Optional
4
+
5
+ from isvalid_sdk.client import HttpClient, IsValidConfig, RetryConfig
6
+ from isvalid_sdk.errors import IsValidAuthError, IsValidError, IsValidRateLimitError
7
+ from isvalid_sdk.namespaces.au import AuNamespace
8
+ from isvalid_sdk.namespaces.br import BrNamespace
9
+ from isvalid_sdk.namespaces.country import CountryNamespace
10
+ from isvalid_sdk.namespaces.currency import CurrencyNamespace
11
+ from isvalid_sdk.namespaces.es import EsNamespace
12
+ from isvalid_sdk.namespaces.gb import GbNamespace
13
+ from isvalid_sdk.namespaces.iata import IataNamespace
14
+ from isvalid_sdk.namespaces.india import InNamespace
15
+ from isvalid_sdk.namespaces.language import LanguageNamespace
16
+ from isvalid_sdk.namespaces.lei import LeiNamespace
17
+ from isvalid_sdk.namespaces.net import NetNamespace
18
+ from isvalid_sdk.namespaces.pl import PlNamespace
19
+ from isvalid_sdk.namespaces.us import UsNamespace
20
+ from isvalid_sdk.types.simple import (
21
+ AbaResponse,
22
+ BicResponse,
23
+ BooleanResponse,
24
+ BtcAddressResponse,
25
+ CfiResponse,
26
+ ColorResponse,
27
+ ContainerCodeResponse,
28
+ CreditCardResponse,
29
+ CusipResponse,
30
+ DateResponse,
31
+ DtiResponse,
32
+ EanResponse,
33
+ EmailResponse,
34
+ GlnResponse,
35
+ GpsResponse,
36
+ IbanResponse,
37
+ ImeiResponse,
38
+ IsbnResponse,
39
+ IsinResponse,
40
+ IssnResponse,
41
+ JwtResponse,
42
+ MicResponse,
43
+ NutsResponse,
44
+ PhoneResponse,
45
+ PostalCodeResponse,
46
+ QrResponse,
47
+ SemverResponse,
48
+ SsccResponse,
49
+ UrlResponse,
50
+ UuidResponse,
51
+ VatResponse,
52
+ VinResponse,
53
+ )
54
+
55
+ __all__ = [
56
+ "IsValid",
57
+ "create_client",
58
+ "IsValidConfig",
59
+ "RetryConfig",
60
+ "IsValidError",
61
+ "IsValidAuthError",
62
+ "IsValidRateLimitError",
63
+ ]
64
+
65
+
66
+ class IsValid:
67
+ def __init__(self, config: IsValidConfig) -> None:
68
+ self._client = HttpClient(config)
69
+
70
+ self.lei = LeiNamespace(self._client)
71
+ self.country = CountryNamespace(self._client)
72
+ self.currency = CurrencyNamespace(self._client)
73
+ self.language = LanguageNamespace(self._client)
74
+ self.iata = IataNamespace(self._client)
75
+ self.net = NetNamespace(self._client)
76
+ self.pl = PlNamespace(self._client)
77
+ self.br = BrNamespace(self._client)
78
+ self.au = AuNamespace(self._client)
79
+ self.es = EsNamespace(self._client)
80
+ self.in_ = InNamespace(self._client)
81
+ self.us = UsNamespace(self._client)
82
+ self.gb = GbNamespace(self._client)
83
+
84
+ def close(self) -> None:
85
+ self._client.close()
86
+
87
+ def __enter__(self) -> "IsValid":
88
+ return self
89
+
90
+ def __exit__(self, *args: object) -> None:
91
+ self.close()
92
+
93
+ # --- Simple endpoints ---
94
+
95
+ def email(self, value: str, *, check_mx: bool = False) -> EmailResponse:
96
+ return self._client.get(
97
+ "/v0/email",
98
+ {"value": value, "checkMx": str(check_mx).lower() if check_mx else None},
99
+ )
100
+
101
+ def iban(self, value: str, *, country_code: Optional[str] = None) -> IbanResponse:
102
+ return self._client.get(
103
+ "/v0/iban", {"value": value, "countryCode": country_code}
104
+ )
105
+
106
+ def isin(self, value: str) -> IsinResponse:
107
+ return self._client.get("/v0/isin", {"value": value})
108
+
109
+ def dti(self, value: str) -> DtiResponse:
110
+ return self._client.get("/v0/dti", {"value": value})
111
+
112
+ def vat(
113
+ self,
114
+ value: str,
115
+ *,
116
+ country_code: Optional[str] = None,
117
+ check_vies: bool = False,
118
+ ) -> VatResponse:
119
+ return self._client.get(
120
+ "/v0/vat",
121
+ {
122
+ "value": value,
123
+ "countryCode": country_code,
124
+ "checkVies": str(check_vies).lower() if check_vies else None,
125
+ },
126
+ )
127
+
128
+ def gps(self, value: str) -> GpsResponse:
129
+ return self._client.get("/v0/gps", {"value": value})
130
+
131
+ def phone(self, value: str, *, country_code: Optional[str] = None) -> PhoneResponse:
132
+ return self._client.get(
133
+ "/v0/phone", {"value": value, "countryCode": country_code}
134
+ )
135
+
136
+ def url(self, value: str) -> UrlResponse:
137
+ return self._client.get("/v0/url", {"value": value})
138
+
139
+ def ean(self, value: str) -> EanResponse:
140
+ return self._client.get("/v0/ean", {"value": value})
141
+
142
+ def isbn(self, value: str) -> IsbnResponse:
143
+ return self._client.get("/v0/isbn", {"value": value})
144
+
145
+ def issn(self, value: str) -> IssnResponse:
146
+ return self._client.get("/v0/issn", {"value": value})
147
+
148
+ def bic(self, value: str) -> BicResponse:
149
+ return self._client.get("/v0/bic", {"value": value})
150
+
151
+ def cusip(self, value: str) -> CusipResponse:
152
+ return self._client.get("/v0/cusip", {"value": value})
153
+
154
+ def cfi(self, value: str) -> CfiResponse:
155
+ return self._client.get("/v0/cfi", {"value": value})
156
+
157
+ def mic(self, value: str) -> MicResponse:
158
+ return self._client.get("/v0/mic", {"value": value})
159
+
160
+ def nuts(self, value: str) -> NutsResponse:
161
+ return self._client.get("/v0/nuts", {"value": value})
162
+
163
+ def uuid(self, value: str, *, version: Optional[int] = None) -> UuidResponse:
164
+ return self._client.get(
165
+ "/v0/uuid",
166
+ {"value": value, "version": str(version) if version is not None else None},
167
+ )
168
+
169
+ def jwt(self, value: str) -> JwtResponse:
170
+ return self._client.get("/v0/jwt", {"value": value})
171
+
172
+ def vin(self, value: str) -> VinResponse:
173
+ return self._client.get("/v0/vin", {"value": value})
174
+
175
+ def imei(self, value: str) -> ImeiResponse:
176
+ return self._client.get("/v0/imei", {"value": value})
177
+
178
+ def semver(self, value: str) -> SemverResponse:
179
+ return self._client.get("/v0/semver", {"value": value})
180
+
181
+ def color(self, value: str) -> ColorResponse:
182
+ return self._client.get("/v0/color", {"value": value})
183
+
184
+ def boolean(self, value: str) -> BooleanResponse:
185
+ return self._client.get("/v0/boolean", {"value": value})
186
+
187
+ def date(self, value: str, *, format: Optional[str] = None) -> DateResponse:
188
+ return self._client.get("/v0/date", {"value": value, "format": format})
189
+
190
+ def btc_address(self, value: str) -> BtcAddressResponse:
191
+ return self._client.get("/v0/btc-address", {"value": value})
192
+
193
+ def postal_code(
194
+ self, value: str, *, country_code: Optional[str] = None
195
+ ) -> PostalCodeResponse:
196
+ return self._client.get(
197
+ "/v0/postal-code", {"value": value, "countryCode": country_code}
198
+ )
199
+
200
+ def aba(self, value: str) -> AbaResponse:
201
+ return self._client.get("/v0/aba", {"value": value})
202
+
203
+ def container_code(self, value: str) -> ContainerCodeResponse:
204
+ return self._client.get("/v0/container-code", {"value": value})
205
+
206
+ def sscc(self, value: str) -> SsccResponse:
207
+ return self._client.get("/v0/sscc", {"value": value})
208
+
209
+ def gln(self, value: str) -> GlnResponse:
210
+ return self._client.get("/v0/gln", {"value": value})
211
+
212
+ def qr(self, value: str) -> QrResponse:
213
+ return self._client.get("/v0/qr", {"value": value})
214
+
215
+ def credit_card(self, number: str) -> CreditCardResponse:
216
+ return self._client.post("/v0/credit-card", {"number": number})
217
+
218
+
219
+ def create_client(config: IsValidConfig) -> IsValid:
220
+ return IsValid(config)