byebouncer-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.
@@ -0,0 +1,71 @@
1
+ # Binaries
2
+ /bin/
3
+ /dist/
4
+ /server
5
+ server.exe
6
+ *.exe
7
+ *.dll
8
+ *.so
9
+ *.dylib
10
+
11
+ # Test binaries
12
+ *.test
13
+ *.out
14
+
15
+ # Go
16
+ vendor/
17
+ coverage.out
18
+ coverage.html
19
+
20
+ # Env / secrets
21
+ .env
22
+ .env.local
23
+ .env.*.local
24
+ .env.example
25
+ *.pem
26
+ *.key
27
+
28
+ # IDE
29
+ .claude/
30
+ .vscode/
31
+ .idea/
32
+ *.swp
33
+ *.swo
34
+ .DS_Store
35
+
36
+ # Node / Next.js (web/)
37
+ web/node_modules/
38
+ sdks/node/node_modules/
39
+ sdks/node/dist/
40
+ sdks/node/dist-cjs/
41
+ web/.next/
42
+ web/out/
43
+ web/.turbo/
44
+ web/.vercel/
45
+
46
+ # Logs
47
+ *.log
48
+ logs/
49
+
50
+ # Data files that are downloaded at build/run time
51
+ data/disposable_domains_downloaded.txt
52
+ # IP Validator datasets (IPtoASN, GeoLite2, Tor) — bajados por scripts/update_ipdata.sh.
53
+ # GeoLite2 además NO puede versionarse por licencia MaxMind.
54
+ data/ipdata/
55
+ sdks/python/.venv/
56
+ sdks/python/**/__pycache__/
57
+ sdks/python/**/*.egg-info/
58
+ sdks/python/.pytest_cache/
59
+ sdks/python/dist/
60
+
61
+ # Docs internas locales; contratos públicos versionados
62
+ # La documentación interna sigue siendo local, pero los contratos públicos de
63
+ # la API deben viajar con el repositorio para que SDKs y consumidores puedan
64
+ # validarlos de forma reproducible.
65
+ docs/*
66
+ !docs/api/
67
+ docs/api/*
68
+ !docs/api/openapi.yaml
69
+ !docs/api/postman/
70
+ docs/api/postman/*
71
+ !docs/api/postman/byebouncer.postman_collection.json
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ByeBouncer
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,194 @@
1
+ Metadata-Version: 2.5
2
+ Name: byebouncer-sdk
3
+ Version: 0.2.0
4
+ Summary: Official Python SDK for the ByeBouncer email verification API.
5
+ Project-URL: Homepage, https://byebouncer.com
6
+ Project-URL: Documentation, https://byebouncer.com/docs
7
+ Project-URL: Repository, https://github.com/fidelp27/byebouncer
8
+ Project-URL: Issues, https://github.com/fidelp27/byebouncer/issues
9
+ Author-email: byebouncer-sdk <hello@byebouncer.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 ByeBouncer
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: bounce,email,email-validation,smtp,verification
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Topic :: Communications :: Email
43
+ Requires-Python: >=3.9
44
+ Requires-Dist: httpx>=0.25
45
+ Provides-Extra: dev
46
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
47
+ Requires-Dist: pytest>=7; extra == 'dev'
48
+ Requires-Dist: respx>=0.21; extra == 'dev'
49
+ Requires-Dist: ruff>=0.6; extra == 'dev'
50
+ Description-Content-Type: text/markdown
51
+
52
+ # byebouncer
53
+
54
+ Official Python SDK for the [ByeBouncer](https://byebouncer.com) email verification API.
55
+
56
+ Sync and async clients, real-time single-email verification, bulk CSV verification (up to 50k emails per job), HMAC-signed webhooks.
57
+
58
+ ## Install
59
+
60
+ ```bash
61
+ pip install byebouncer
62
+ ```
63
+
64
+ Requires Python 3.9+.
65
+
66
+ ## Quickstart
67
+
68
+ ```python
69
+ import os
70
+ from byebouncer import ByeBouncer
71
+
72
+ with ByeBouncer(api_key=os.environ["BB_API_KEY"]) as client:
73
+ result = client.verify("user@gmail.com")
74
+ print(result.status) # "deliverable" | "undeliverable" | "risky" | "unknown"
75
+ print(result.action) # "allow" | "review" | "block"
76
+ print(result.signals) # ["valid_syntax", "mx_found", ...]
77
+ print(result.credits_remaining)
78
+ ```
79
+
80
+ Get your `BB_API_KEY` from https://byebouncer.com/dashboard (format `bb_live_...`).
81
+
82
+ ## Async
83
+
84
+ ```python
85
+ import asyncio
86
+ from byebouncer import AsyncByeBouncer
87
+
88
+ async def main():
89
+ async with AsyncByeBouncer(api_key="bb_live_...") as client:
90
+ result = await client.verify("user@gmail.com")
91
+ print(result.status)
92
+
93
+ asyncio.run(main())
94
+ ```
95
+
96
+ ## Bulk verification
97
+
98
+ ```python
99
+ created = client.bulk(
100
+ emails=["a@gmail.com", "b@outlook.com"], # up to 5.000
101
+ filename="my_list.csv",
102
+ webhook_url="https://api.myapp.com/hooks/byebouncer", # optional
103
+ )
104
+ job = created.job
105
+ print(f"Job {job.id}, {job.total_emails} emails")
106
+ print(f"Estimated duration: {created.estimated_seconds}s")
107
+
108
+ # Present when webhook_url is supplied (generated or supplied).
109
+ # Store it now: it is never returned by later job reads.
110
+ webhook_secret = created.webhook_secret
111
+ ```
112
+
113
+ ### Polling for completion
114
+
115
+ ```python
116
+ final = client.bulk_wait_for_completion(
117
+ job.id,
118
+ interval_seconds=3,
119
+ on_progress=lambda j: print(f"{j.processed}/{j.total_emails}"),
120
+ )
121
+
122
+ if final.status == "completed":
123
+ download = client.bulk_download_url(final.id)
124
+ csv = httpx.get(download.url).text
125
+ open("results.csv", "w").write(csv)
126
+ ```
127
+
128
+ ### Webhooks (recommended for large jobs)
129
+
130
+ Prefer webhooks over polling. On completion ByeBouncer POSTs to your URL with:
131
+
132
+ ```
133
+ X-ByeBouncer-Event: bulk.completed
134
+ X-ByeBouncer-Signature: <hex HMAC-SHA256(body, webhook_secret)>
135
+ ```
136
+
137
+ Attach or rotate the webhook after creating the job:
138
+
139
+ ```python
140
+ result = client.bulk_set_webhook(
141
+ job.id,
142
+ webhook_url="https://api.myapp.com/hooks/byebouncer",
143
+ )
144
+ webhook_secret = result.webhook_secret # store it NOW, returned only once
145
+ ```
146
+
147
+ ### Cancel
148
+
149
+ ```python
150
+ cancelled = client.bulk_cancel(job.id)
151
+ print(f"Refunded {cancelled.credits_refunded} credits")
152
+ ```
153
+
154
+ ## Error handling
155
+
156
+ Non-2xx responses raise `ByeBouncerError` or a subclass with `code`, `status`, `detail`.
157
+
158
+ ```python
159
+ from byebouncer import InsufficientCreditsError, RateLimitError, ByeBouncer
160
+
161
+ with ByeBouncer(api_key="bb_live_...") as client:
162
+ try:
163
+ client.verify("user@gmail.com")
164
+ except InsufficientCreditsError as e:
165
+ print(f"Out of credits (remaining: {e.credits_remaining})")
166
+ except RateLimitError as e:
167
+ print(f"Rate limited, retry after {e.retry_after_seconds}s")
168
+ ```
169
+
170
+ ## API reference
171
+
172
+ Every method mirrors the [OpenAPI spec](https://github.com/fidelp27/byebouncer/blob/master/docs/api/openapi.yaml).
173
+
174
+ | Method | Endpoint | Description |
175
+ |--------|----------|-------------|
176
+ | `verify(email)` | `POST /verify` | Verify a single email |
177
+ | `credits()` | `GET /credits` | Get balance |
178
+ | `bulk(emails, ...)` | `POST /bulk` | Enqueue a bulk job |
179
+ | `bulk_status(job_id)` | `GET /bulk/{id}` | Fetch job |
180
+ | `bulk_cancel(job_id)` | `DELETE /bulk/{id}` | Cancel |
181
+ | `bulk_download_url(job_id)` | `GET /bulk/{id}/download` | Signed CSV URL |
182
+ | `bulk_set_webhook(job_id, ...)` | `POST /bulk/{id}/webhook` | Attach/rotate webhook |
183
+ | `bulk_wait_for_completion(job_id, ...)` | polls | Convenience helper |
184
+ | `bulk_and_wait(emails, ...)` | create+poll+download | Available in sync and async clients |
185
+
186
+ ## Support
187
+
188
+ - Docs: https://byebouncer.com/docs
189
+ - Email: hello@byebouncer.com
190
+ - Issues: https://github.com/fidelp27/byebouncer/issues
191
+
192
+ ## License
193
+
194
+ MIT © ByeBouncer
@@ -0,0 +1,143 @@
1
+ # byebouncer
2
+
3
+ Official Python SDK for the [ByeBouncer](https://byebouncer.com) email verification API.
4
+
5
+ Sync and async clients, real-time single-email verification, bulk CSV verification (up to 50k emails per job), HMAC-signed webhooks.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install byebouncer
11
+ ```
12
+
13
+ Requires Python 3.9+.
14
+
15
+ ## Quickstart
16
+
17
+ ```python
18
+ import os
19
+ from byebouncer import ByeBouncer
20
+
21
+ with ByeBouncer(api_key=os.environ["BB_API_KEY"]) as client:
22
+ result = client.verify("user@gmail.com")
23
+ print(result.status) # "deliverable" | "undeliverable" | "risky" | "unknown"
24
+ print(result.action) # "allow" | "review" | "block"
25
+ print(result.signals) # ["valid_syntax", "mx_found", ...]
26
+ print(result.credits_remaining)
27
+ ```
28
+
29
+ Get your `BB_API_KEY` from https://byebouncer.com/dashboard (format `bb_live_...`).
30
+
31
+ ## Async
32
+
33
+ ```python
34
+ import asyncio
35
+ from byebouncer import AsyncByeBouncer
36
+
37
+ async def main():
38
+ async with AsyncByeBouncer(api_key="bb_live_...") as client:
39
+ result = await client.verify("user@gmail.com")
40
+ print(result.status)
41
+
42
+ asyncio.run(main())
43
+ ```
44
+
45
+ ## Bulk verification
46
+
47
+ ```python
48
+ created = client.bulk(
49
+ emails=["a@gmail.com", "b@outlook.com"], # up to 5.000
50
+ filename="my_list.csv",
51
+ webhook_url="https://api.myapp.com/hooks/byebouncer", # optional
52
+ )
53
+ job = created.job
54
+ print(f"Job {job.id}, {job.total_emails} emails")
55
+ print(f"Estimated duration: {created.estimated_seconds}s")
56
+
57
+ # Present when webhook_url is supplied (generated or supplied).
58
+ # Store it now: it is never returned by later job reads.
59
+ webhook_secret = created.webhook_secret
60
+ ```
61
+
62
+ ### Polling for completion
63
+
64
+ ```python
65
+ final = client.bulk_wait_for_completion(
66
+ job.id,
67
+ interval_seconds=3,
68
+ on_progress=lambda j: print(f"{j.processed}/{j.total_emails}"),
69
+ )
70
+
71
+ if final.status == "completed":
72
+ download = client.bulk_download_url(final.id)
73
+ csv = httpx.get(download.url).text
74
+ open("results.csv", "w").write(csv)
75
+ ```
76
+
77
+ ### Webhooks (recommended for large jobs)
78
+
79
+ Prefer webhooks over polling. On completion ByeBouncer POSTs to your URL with:
80
+
81
+ ```
82
+ X-ByeBouncer-Event: bulk.completed
83
+ X-ByeBouncer-Signature: <hex HMAC-SHA256(body, webhook_secret)>
84
+ ```
85
+
86
+ Attach or rotate the webhook after creating the job:
87
+
88
+ ```python
89
+ result = client.bulk_set_webhook(
90
+ job.id,
91
+ webhook_url="https://api.myapp.com/hooks/byebouncer",
92
+ )
93
+ webhook_secret = result.webhook_secret # store it NOW, returned only once
94
+ ```
95
+
96
+ ### Cancel
97
+
98
+ ```python
99
+ cancelled = client.bulk_cancel(job.id)
100
+ print(f"Refunded {cancelled.credits_refunded} credits")
101
+ ```
102
+
103
+ ## Error handling
104
+
105
+ Non-2xx responses raise `ByeBouncerError` or a subclass with `code`, `status`, `detail`.
106
+
107
+ ```python
108
+ from byebouncer import InsufficientCreditsError, RateLimitError, ByeBouncer
109
+
110
+ with ByeBouncer(api_key="bb_live_...") as client:
111
+ try:
112
+ client.verify("user@gmail.com")
113
+ except InsufficientCreditsError as e:
114
+ print(f"Out of credits (remaining: {e.credits_remaining})")
115
+ except RateLimitError as e:
116
+ print(f"Rate limited, retry after {e.retry_after_seconds}s")
117
+ ```
118
+
119
+ ## API reference
120
+
121
+ Every method mirrors the [OpenAPI spec](https://github.com/fidelp27/byebouncer/blob/master/docs/api/openapi.yaml).
122
+
123
+ | Method | Endpoint | Description |
124
+ |--------|----------|-------------|
125
+ | `verify(email)` | `POST /verify` | Verify a single email |
126
+ | `credits()` | `GET /credits` | Get balance |
127
+ | `bulk(emails, ...)` | `POST /bulk` | Enqueue a bulk job |
128
+ | `bulk_status(job_id)` | `GET /bulk/{id}` | Fetch job |
129
+ | `bulk_cancel(job_id)` | `DELETE /bulk/{id}` | Cancel |
130
+ | `bulk_download_url(job_id)` | `GET /bulk/{id}/download` | Signed CSV URL |
131
+ | `bulk_set_webhook(job_id, ...)` | `POST /bulk/{id}/webhook` | Attach/rotate webhook |
132
+ | `bulk_wait_for_completion(job_id, ...)` | polls | Convenience helper |
133
+ | `bulk_and_wait(emails, ...)` | create+poll+download | Available in sync and async clients |
134
+
135
+ ## Support
136
+
137
+ - Docs: https://byebouncer.com/docs
138
+ - Email: hello@byebouncer.com
139
+ - Issues: https://github.com/fidelp27/byebouncer/issues
140
+
141
+ ## License
142
+
143
+ MIT © ByeBouncer
@@ -0,0 +1,44 @@
1
+ """Official Python SDK for the ByeBouncer email verification API."""
2
+
3
+ from .client import AsyncByeBouncer, ByeBouncer
4
+ from .errors import (
5
+ ByeBouncerError,
6
+ InsufficientCreditsError,
7
+ RateLimitError,
8
+ UnauthorizedError,
9
+ )
10
+ from .models import (
11
+ BulkJob,
12
+ BulkJobStatus,
13
+ CreateBulkResponse,
14
+ CreditsInfo,
15
+ DomainInfo,
16
+ DownloadResponse,
17
+ IPSignal,
18
+ IPVerifyResult,
19
+ PhoneVerifyResult,
20
+ SetWebhookResponse,
21
+ VerifyResult,
22
+ )
23
+
24
+ __version__ = "0.1.0"
25
+
26
+ __all__ = [
27
+ "AsyncByeBouncer",
28
+ "BulkJob",
29
+ "BulkJobStatus",
30
+ "ByeBouncer",
31
+ "ByeBouncerError",
32
+ "CreateBulkResponse",
33
+ "CreditsInfo",
34
+ "DomainInfo",
35
+ "DownloadResponse",
36
+ "IPSignal",
37
+ "IPVerifyResult",
38
+ "PhoneVerifyResult",
39
+ "InsufficientCreditsError",
40
+ "RateLimitError",
41
+ "SetWebhookResponse",
42
+ "UnauthorizedError",
43
+ "VerifyResult",
44
+ ]