cipawebfiltering 1.0.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alpha Quantum
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,2 @@
1
+ include README.md
2
+ include LICENSE
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.1
2
+ Name: cipawebfiltering
3
+ Version: 1.0.0
4
+ Summary: Python client for the CIPA Web Filtering API — 120M+ classified domains for K-12 schools, districts, and libraries.
5
+ Home-page: https://www.cipawebfiltering.com
6
+ Author: Alpha Quantum
7
+ Author-email: info@alpha-quantum.com
8
+ License: MIT
9
+ Project-URL: Homepage, https://www.cipawebfiltering.com
10
+ Project-URL: API Documentation, https://www.cipawebfiltering.com/docs/integration-guide.php
11
+ Project-URL: Source, https://www.cipawebfiltering.com
12
+ Description: # cipawebfiltering
13
+
14
+ A production-ready Python client for the [CIPA web filtering](https://www.cipawebfiltering.com) domain classification database — 120 million domains classified across 57+ content categories, purpose-built for K-12 school districts, public libraries, and any organization that must comply with the Children's Internet Protection Act. The package wraps the REST API in a small, typed, dependency-light interface so IT administrators, network engineers, and compliance teams can look up, filter, and synchronize domain intelligence directly from Python.
15
+
16
+ ---
17
+
18
+ ## What is CIPA and why does it matter?
19
+
20
+ The Children's Internet Protection Act (CIPA) is a United States federal law enacted in 2000 that requires schools and libraries receiving E-Rate funding or LSTA grants to implement internet safety policies and technology protection measures. In practice, this means deploying a web filtering solution that blocks access to content that is obscene, contains child sexual abuse material (CSAM), or is harmful to minors. Districts must also adopt and enforce an acceptable-use policy that covers student activity on and off campus, including 1:1 device programs.
21
+
22
+ Compliance is not optional: failure to meet CIPA requirements puts E-Rate funding at risk, which for many districts represents hundreds of thousands of dollars annually. Beyond the legal obligation, schools and libraries have a duty of care to protect minors from harmful material while preserving access to educational resources. Over-blocking legitimate content is almost as damaging as under-blocking, because it frustrates teachers, disrupts lesson plans, and erodes trust in the filtering system.
23
+
24
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database addresses both sides of this challenge. Every domain receives multi-label classification rather than a single verdict, so a domain that hosts both educational and social-media content is tagged with both categories. Policy engines can then make precise blocking decisions per category instead of relying on a blunt allow-or-deny list, dramatically reducing false positives while maintaining full coverage of CIPA-mandated content types.
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pip install cipawebfiltering
32
+ ```
33
+
34
+ The only runtime dependency is [`requests`](https://requests.readthedocs.io/). Python 3.7 and newer are supported.
35
+
36
+ ---
37
+
38
+ ## Quick start
39
+
40
+ ```python
41
+ from cipawebfiltering import CIPAWebFilteringClient
42
+
43
+ client = CIPAWebFilteringClient("your_api_key_here")
44
+
45
+ # Check a single domain
46
+ result = client.lookup("example-games-site.com")
47
+ print(result["categories"]) # ["Gaming", "Gambling"]
48
+ print(result["should_block"]) # True
49
+ print(result["confidence"]) # 0.97
50
+
51
+ # Convenience boolean for inline policy decisions
52
+ if client.is_blocked("unknown-domain.net"):
53
+ enforce_block("unknown-domain.net")
54
+ ```
55
+
56
+ An API key is required and can be obtained from the account dashboard at [cipawebfiltering.com](https://www.cipawebfiltering.com) after subscribing to a plan. Keys are passed automatically as a Bearer token on every request.
57
+
58
+ ---
59
+
60
+ ## Configuration
61
+
62
+ ```python
63
+ client = CIPAWebFilteringClient(
64
+ api_key="your_api_key_here",
65
+ base_url="https://cipawebfiltering.com/api/v1", # override for testing
66
+ timeout=30, # per-request timeout in seconds
67
+ max_retries=3, # automatic backoff on 429 and 5xx
68
+ )
69
+ ```
70
+
71
+ Transient failures — HTTP 429 rate limits and 5xx server errors — are retried automatically with exponential backoff, honoring the `Retry-After` header when present. Authentication errors raise immediately.
72
+
73
+ ---
74
+
75
+ ## API methods
76
+
77
+ ### Single domain lookup
78
+
79
+ ```python
80
+ result = client.lookup("social-media-site.com")
81
+ ```
82
+
83
+ **Response:**
84
+
85
+ ```json
86
+ {
87
+ "domain": "social-media-site.com",
88
+ "categories": ["Social Media", "User-Generated Content"],
89
+ "should_block": true,
90
+ "confidence": 0.95,
91
+ "last_seen": "2026-07-22T08:00:00Z",
92
+ "dns_active": true
93
+ }
94
+ ```
95
+
96
+ Pass a bare domain — `example.com`, not `https://example.com/page`. Subdomains resolve to their registrable domain automatically. The response includes multi-label categories, a block recommendation based on your policy tier, and a confidence score. Both found and not-found domains return HTTP 200; check the `should_block` boolean or the `categories` array.
97
+
98
+ ### Bulk lookup
99
+
100
+ Classify up to 1,000 domains in a single request:
101
+
102
+ ```python
103
+ report = client.bulk_lookup(["tiktok.com", "khanacademy.org", "steam-community.ru"])
104
+ for row in report["results"]:
105
+ print(row["domain"], row["categories"], row["should_block"])
106
+ ```
107
+
108
+ For arbitrarily large inputs, chunking is handled automatically:
109
+
110
+ ```python
111
+ all_results = client.bulk_lookup_all(my_50000_domains)
112
+ blocked = [r for r in all_results if r["should_block"]]
113
+ ```
114
+
115
+ ### List categories
116
+
117
+ Retrieve the full taxonomy of 57+ content categories with descriptions:
118
+
119
+ ```python
120
+ cats = client.categories()
121
+ for cat in cats["categories"]:
122
+ print(cat["name"], "-", cat["description"])
123
+ ```
124
+
125
+ Categories include CIPA-mandated types such as Adult Content, Violence, Weapons, Drugs, Gambling, and Malware, as well as productivity-relevant categories like Social Media, Streaming, Gaming, and Shopping.
126
+
127
+ ### Sync the full database
128
+
129
+ For DNS-level filtering, firewall External Dynamic Lists (EDLs), or local proxy caches, stream the entire classified domain list:
130
+
131
+ ```python
132
+ with open("blocked_domains.txt", "w") as fh:
133
+ for record in client.iter_domains(category="Adult Content"):
134
+ fh.write(record["domain"] + "\n")
135
+ ```
136
+
137
+ Then keep it current with daily delta syncs instead of re-downloading everything:
138
+
139
+ ```python
140
+ changes = client.delta(since="2026-07-21T00:00:00Z")
141
+ for added in changes["added"]:
142
+ local_blocklist.add(added["domain"])
143
+ for removed in changes["removed"]:
144
+ local_blocklist.discard(removed["domain"])
145
+ ```
146
+
147
+ This "full load once, delta forever" pattern lets a modest API quota support millions of local lookups, because the actual matching happens in your own DNS resolver, Redis, SQLite, or flat file.
148
+
149
+ ### Database statistics
150
+
151
+ ```python
152
+ stats = client.stats()
153
+ print(stats["total_domains"]) # 120000000+
154
+ print(stats["last_updated"]) # "2026-07-22T06:00:00Z"
155
+ print(stats["new_today"]) # ~300000
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Error handling
161
+
162
+ The client raises a small, specific exception hierarchy:
163
+
164
+ ```python
165
+ from cipawebfiltering import (
166
+ CIPAWebFilteringError,
167
+ AuthenticationError,
168
+ RateLimitError,
169
+ NotFoundError,
170
+ )
171
+
172
+ try:
173
+ result = client.lookup("example.com")
174
+ except AuthenticationError:
175
+ # 401/403 — renew or rotate the key
176
+ ...
177
+ except RateLimitError:
178
+ # 429 after retries — back off or upgrade the plan
179
+ ...
180
+ except CIPAWebFilteringError:
181
+ # any other API or network failure
182
+ ...
183
+ ```
184
+
185
+ The client is also a context manager, so the underlying HTTP session is cleaned up automatically:
186
+
187
+ ```python
188
+ with CIPAWebFilteringClient("your_api_key_here") as client:
189
+ print(client.stats())
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Use cases
195
+
196
+ **District-wide filtering:** Apply consistent content policies across every building in a district. Import the database into your DNS resolver or secure web gateway and enforce category-based rules that distinguish between a blocked gaming site and a permitted educational game.
197
+
198
+ **1:1 Chromebook and laptop programs:** Students take devices home, outside the school firewall. Feed the domain list into a DNS-over-HTTPS resolver or endpoint agent to maintain CIPA compliance on and off campus.
199
+
200
+ **Public library internet access:** Libraries must filter content on public terminals while respecting patron privacy and intellectual freedom. Multi-label classification lets librarians allow research resources that a single-category system would wrongly block.
201
+
202
+ **DNS and RPZ filtering:** Export the database as a Response Policy Zone (RPZ) file and load it into BIND, Unbound, or any RPZ-capable resolver. Blocking happens at the DNS layer with zero latency overhead on permitted traffic.
203
+
204
+ **Firewall EDL integration:** Generate External Dynamic Lists for Palo Alto, Fortinet, or Cisco firewalls. The delta sync endpoint keeps the list current without manual intervention.
205
+
206
+ **AI tool governance in schools:** The database includes a dedicated AI Tools subcategory covering 16,000+ domains — chatbots, essay writers, homework solvers, deepfake tools, and voice cloning services. Districts can permit approved AI tutoring tools while blocking services that undermine academic integrity.
207
+
208
+ ---
209
+
210
+ ## How the database is built
211
+
212
+ The classification pipeline processes approximately 300,000 newly discovered domains every day. Each domain is fetched, its content extracted and analyzed through a multi-stage machine learning pipeline that assigns one or more of 57+ content categories. Unlike single-label classifiers that force every domain into exactly one bucket, the multi-label approach recognizes that real-world websites often span multiple topics. A domain hosting both educational math content and an unmoderated chat forum receives both the Education and the Chat/Messaging labels, allowing the policy engine to make a nuanced decision rather than defaulting to a blanket block or allow.
213
+
214
+ Every classification is verified against a confidence threshold before entering the production database. Domains whose content changes significantly between crawls are re-evaluated and re-labeled automatically. The result is a living dataset that reflects the current state of the web rather than a static snapshot that grows stale within weeks.
215
+
216
+ All content categories required by CIPA — obscene material, CSAM, and content harmful to minors — are maintained as top-level categories with the highest screening priority. Additional categories cover productivity concerns (Social Media, Streaming, Gaming, Shopping), security threats (Malware, Phishing, Command and Control), and emerging risks (AI Tools, Deepfakes, Cryptocurrency).
217
+
218
+ ## Delivery formats
219
+
220
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database is available in multiple formats beyond this Python client:
221
+
222
+ - **REST API** — real-time lookups with millisecond response times
223
+ - **CSV downloads** — daily-refreshed flat files for offline use
224
+ - **DNS / RPZ blocklists** — ready-to-load zone files
225
+ - **PAC files** — browser-level proxy auto-config
226
+ - **Hosts files** — simple domain-to-localhost mapping
227
+ - **Firewall EDLs** — external dynamic lists for next-gen firewalls
228
+
229
+ ---
230
+
231
+ ## Related services
232
+
233
+ For organizations that need broader domain intelligence beyond CIPA compliance, the following services complement this package:
234
+
235
+ * **[Website Categorization API](https://www.websitecategorizationapi.com):** Real-time URL classification using the IAB taxonomy across 700+ categories, supporting ad-tech, brand safety, and content analytics.
236
+
237
+ * **[AI Tools Blocklist](https://www.aitoolsblocklist.com):** A daily-refreshed database of classified AI-tool domains — chatbots, code assistants, image generators, voice cloners — organized into functional categories for granular acceptable-use policies.
238
+
239
+ * **[Web Filtering Database](https://www.webfilteringdatabase.com):** Enterprise-grade downloadable database of 100 million domains across 59 content categories, designed for DNS-level blocking in firewalls, proxies, and secure web gateways.
240
+
241
+ * **[URL Categorization Database](https://www.urlcategorizationdatabase.com):** Categorized domains at enterprise scale for contextual targeting, brand safety, and large-scale analytics.
242
+
243
+ * **[Phishing Detection API](https://www.phishingdetectionapi.com):** Real-time phishing domain detection powered by a daily-updated database of 390,000+ DNS-verified active phishing domains, built for cybersecurity teams, email providers, and safe browsing implementations.
244
+
245
+ ---
246
+
247
+ ## Links
248
+
249
+ - Product and documentation: [https://www.cipawebfiltering.com](https://www.cipawebfiltering.com)
250
+ - FCC — Children's Internet Protection Act: [https://www.fcc.gov/consumers/guides/childrens-internet-protection-act](https://www.fcc.gov/consumers/guides/childrens-internet-protection-act)
251
+ - E-Rate program: [https://www.fcc.gov/general/e-rate-program](https://www.fcc.gov/general/e-rate-program)
252
+
253
+ ## License
254
+
255
+ MIT
256
+
257
+ Keywords: cipa,web filtering,content filtering,dns filtering,k-12,school web filter,domain classification,url categorization,children's internet protection act,safe browsing,firewall edl,acceptable use policy,domain database
258
+ Platform: UNKNOWN
259
+ Classifier: Development Status :: 5 - Production/Stable
260
+ Classifier: Intended Audience :: Developers
261
+ Classifier: Intended Audience :: Education
262
+ Classifier: Intended Audience :: Information Technology
263
+ Classifier: License :: OSI Approved :: MIT License
264
+ Classifier: Programming Language :: Python :: 3
265
+ Classifier: Programming Language :: Python :: 3.7
266
+ Classifier: Programming Language :: Python :: 3.8
267
+ Classifier: Programming Language :: Python :: 3.9
268
+ Classifier: Programming Language :: Python :: 3.10
269
+ Classifier: Programming Language :: Python :: 3.11
270
+ Classifier: Programming Language :: Python :: 3.12
271
+ Classifier: Topic :: Internet :: Proxy Servers
272
+ Classifier: Topic :: Security
273
+ Classifier: Topic :: System :: Networking :: Firewalls
274
+ Requires-Python: >=3.7
275
+ Description-Content-Type: text/markdown
@@ -0,0 +1,244 @@
1
+ # cipawebfiltering
2
+
3
+ A production-ready Python client for the [CIPA web filtering](https://www.cipawebfiltering.com) domain classification database — 120 million domains classified across 57+ content categories, purpose-built for K-12 school districts, public libraries, and any organization that must comply with the Children's Internet Protection Act. The package wraps the REST API in a small, typed, dependency-light interface so IT administrators, network engineers, and compliance teams can look up, filter, and synchronize domain intelligence directly from Python.
4
+
5
+ ---
6
+
7
+ ## What is CIPA and why does it matter?
8
+
9
+ The Children's Internet Protection Act (CIPA) is a United States federal law enacted in 2000 that requires schools and libraries receiving E-Rate funding or LSTA grants to implement internet safety policies and technology protection measures. In practice, this means deploying a web filtering solution that blocks access to content that is obscene, contains child sexual abuse material (CSAM), or is harmful to minors. Districts must also adopt and enforce an acceptable-use policy that covers student activity on and off campus, including 1:1 device programs.
10
+
11
+ Compliance is not optional: failure to meet CIPA requirements puts E-Rate funding at risk, which for many districts represents hundreds of thousands of dollars annually. Beyond the legal obligation, schools and libraries have a duty of care to protect minors from harmful material while preserving access to educational resources. Over-blocking legitimate content is almost as damaging as under-blocking, because it frustrates teachers, disrupts lesson plans, and erodes trust in the filtering system.
12
+
13
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database addresses both sides of this challenge. Every domain receives multi-label classification rather than a single verdict, so a domain that hosts both educational and social-media content is tagged with both categories. Policy engines can then make precise blocking decisions per category instead of relying on a blunt allow-or-deny list, dramatically reducing false positives while maintaining full coverage of CIPA-mandated content types.
14
+
15
+ ---
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install cipawebfiltering
21
+ ```
22
+
23
+ The only runtime dependency is [`requests`](https://requests.readthedocs.io/). Python 3.7 and newer are supported.
24
+
25
+ ---
26
+
27
+ ## Quick start
28
+
29
+ ```python
30
+ from cipawebfiltering import CIPAWebFilteringClient
31
+
32
+ client = CIPAWebFilteringClient("your_api_key_here")
33
+
34
+ # Check a single domain
35
+ result = client.lookup("example-games-site.com")
36
+ print(result["categories"]) # ["Gaming", "Gambling"]
37
+ print(result["should_block"]) # True
38
+ print(result["confidence"]) # 0.97
39
+
40
+ # Convenience boolean for inline policy decisions
41
+ if client.is_blocked("unknown-domain.net"):
42
+ enforce_block("unknown-domain.net")
43
+ ```
44
+
45
+ An API key is required and can be obtained from the account dashboard at [cipawebfiltering.com](https://www.cipawebfiltering.com) after subscribing to a plan. Keys are passed automatically as a Bearer token on every request.
46
+
47
+ ---
48
+
49
+ ## Configuration
50
+
51
+ ```python
52
+ client = CIPAWebFilteringClient(
53
+ api_key="your_api_key_here",
54
+ base_url="https://cipawebfiltering.com/api/v1", # override for testing
55
+ timeout=30, # per-request timeout in seconds
56
+ max_retries=3, # automatic backoff on 429 and 5xx
57
+ )
58
+ ```
59
+
60
+ Transient failures — HTTP 429 rate limits and 5xx server errors — are retried automatically with exponential backoff, honoring the `Retry-After` header when present. Authentication errors raise immediately.
61
+
62
+ ---
63
+
64
+ ## API methods
65
+
66
+ ### Single domain lookup
67
+
68
+ ```python
69
+ result = client.lookup("social-media-site.com")
70
+ ```
71
+
72
+ **Response:**
73
+
74
+ ```json
75
+ {
76
+ "domain": "social-media-site.com",
77
+ "categories": ["Social Media", "User-Generated Content"],
78
+ "should_block": true,
79
+ "confidence": 0.95,
80
+ "last_seen": "2026-07-22T08:00:00Z",
81
+ "dns_active": true
82
+ }
83
+ ```
84
+
85
+ Pass a bare domain — `example.com`, not `https://example.com/page`. Subdomains resolve to their registrable domain automatically. The response includes multi-label categories, a block recommendation based on your policy tier, and a confidence score. Both found and not-found domains return HTTP 200; check the `should_block` boolean or the `categories` array.
86
+
87
+ ### Bulk lookup
88
+
89
+ Classify up to 1,000 domains in a single request:
90
+
91
+ ```python
92
+ report = client.bulk_lookup(["tiktok.com", "khanacademy.org", "steam-community.ru"])
93
+ for row in report["results"]:
94
+ print(row["domain"], row["categories"], row["should_block"])
95
+ ```
96
+
97
+ For arbitrarily large inputs, chunking is handled automatically:
98
+
99
+ ```python
100
+ all_results = client.bulk_lookup_all(my_50000_domains)
101
+ blocked = [r for r in all_results if r["should_block"]]
102
+ ```
103
+
104
+ ### List categories
105
+
106
+ Retrieve the full taxonomy of 57+ content categories with descriptions:
107
+
108
+ ```python
109
+ cats = client.categories()
110
+ for cat in cats["categories"]:
111
+ print(cat["name"], "-", cat["description"])
112
+ ```
113
+
114
+ Categories include CIPA-mandated types such as Adult Content, Violence, Weapons, Drugs, Gambling, and Malware, as well as productivity-relevant categories like Social Media, Streaming, Gaming, and Shopping.
115
+
116
+ ### Sync the full database
117
+
118
+ For DNS-level filtering, firewall External Dynamic Lists (EDLs), or local proxy caches, stream the entire classified domain list:
119
+
120
+ ```python
121
+ with open("blocked_domains.txt", "w") as fh:
122
+ for record in client.iter_domains(category="Adult Content"):
123
+ fh.write(record["domain"] + "\n")
124
+ ```
125
+
126
+ Then keep it current with daily delta syncs instead of re-downloading everything:
127
+
128
+ ```python
129
+ changes = client.delta(since="2026-07-21T00:00:00Z")
130
+ for added in changes["added"]:
131
+ local_blocklist.add(added["domain"])
132
+ for removed in changes["removed"]:
133
+ local_blocklist.discard(removed["domain"])
134
+ ```
135
+
136
+ This "full load once, delta forever" pattern lets a modest API quota support millions of local lookups, because the actual matching happens in your own DNS resolver, Redis, SQLite, or flat file.
137
+
138
+ ### Database statistics
139
+
140
+ ```python
141
+ stats = client.stats()
142
+ print(stats["total_domains"]) # 120000000+
143
+ print(stats["last_updated"]) # "2026-07-22T06:00:00Z"
144
+ print(stats["new_today"]) # ~300000
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Error handling
150
+
151
+ The client raises a small, specific exception hierarchy:
152
+
153
+ ```python
154
+ from cipawebfiltering import (
155
+ CIPAWebFilteringError,
156
+ AuthenticationError,
157
+ RateLimitError,
158
+ NotFoundError,
159
+ )
160
+
161
+ try:
162
+ result = client.lookup("example.com")
163
+ except AuthenticationError:
164
+ # 401/403 — renew or rotate the key
165
+ ...
166
+ except RateLimitError:
167
+ # 429 after retries — back off or upgrade the plan
168
+ ...
169
+ except CIPAWebFilteringError:
170
+ # any other API or network failure
171
+ ...
172
+ ```
173
+
174
+ The client is also a context manager, so the underlying HTTP session is cleaned up automatically:
175
+
176
+ ```python
177
+ with CIPAWebFilteringClient("your_api_key_here") as client:
178
+ print(client.stats())
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Use cases
184
+
185
+ **District-wide filtering:** Apply consistent content policies across every building in a district. Import the database into your DNS resolver or secure web gateway and enforce category-based rules that distinguish between a blocked gaming site and a permitted educational game.
186
+
187
+ **1:1 Chromebook and laptop programs:** Students take devices home, outside the school firewall. Feed the domain list into a DNS-over-HTTPS resolver or endpoint agent to maintain CIPA compliance on and off campus.
188
+
189
+ **Public library internet access:** Libraries must filter content on public terminals while respecting patron privacy and intellectual freedom. Multi-label classification lets librarians allow research resources that a single-category system would wrongly block.
190
+
191
+ **DNS and RPZ filtering:** Export the database as a Response Policy Zone (RPZ) file and load it into BIND, Unbound, or any RPZ-capable resolver. Blocking happens at the DNS layer with zero latency overhead on permitted traffic.
192
+
193
+ **Firewall EDL integration:** Generate External Dynamic Lists for Palo Alto, Fortinet, or Cisco firewalls. The delta sync endpoint keeps the list current without manual intervention.
194
+
195
+ **AI tool governance in schools:** The database includes a dedicated AI Tools subcategory covering 16,000+ domains — chatbots, essay writers, homework solvers, deepfake tools, and voice cloning services. Districts can permit approved AI tutoring tools while blocking services that undermine academic integrity.
196
+
197
+ ---
198
+
199
+ ## How the database is built
200
+
201
+ The classification pipeline processes approximately 300,000 newly discovered domains every day. Each domain is fetched, its content extracted and analyzed through a multi-stage machine learning pipeline that assigns one or more of 57+ content categories. Unlike single-label classifiers that force every domain into exactly one bucket, the multi-label approach recognizes that real-world websites often span multiple topics. A domain hosting both educational math content and an unmoderated chat forum receives both the Education and the Chat/Messaging labels, allowing the policy engine to make a nuanced decision rather than defaulting to a blanket block or allow.
202
+
203
+ Every classification is verified against a confidence threshold before entering the production database. Domains whose content changes significantly between crawls are re-evaluated and re-labeled automatically. The result is a living dataset that reflects the current state of the web rather than a static snapshot that grows stale within weeks.
204
+
205
+ All content categories required by CIPA — obscene material, CSAM, and content harmful to minors — are maintained as top-level categories with the highest screening priority. Additional categories cover productivity concerns (Social Media, Streaming, Gaming, Shopping), security threats (Malware, Phishing, Command and Control), and emerging risks (AI Tools, Deepfakes, Cryptocurrency).
206
+
207
+ ## Delivery formats
208
+
209
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database is available in multiple formats beyond this Python client:
210
+
211
+ - **REST API** — real-time lookups with millisecond response times
212
+ - **CSV downloads** — daily-refreshed flat files for offline use
213
+ - **DNS / RPZ blocklists** — ready-to-load zone files
214
+ - **PAC files** — browser-level proxy auto-config
215
+ - **Hosts files** — simple domain-to-localhost mapping
216
+ - **Firewall EDLs** — external dynamic lists for next-gen firewalls
217
+
218
+ ---
219
+
220
+ ## Related services
221
+
222
+ For organizations that need broader domain intelligence beyond CIPA compliance, the following services complement this package:
223
+
224
+ * **[Website Categorization API](https://www.websitecategorizationapi.com):** Real-time URL classification using the IAB taxonomy across 700+ categories, supporting ad-tech, brand safety, and content analytics.
225
+
226
+ * **[AI Tools Blocklist](https://www.aitoolsblocklist.com):** A daily-refreshed database of classified AI-tool domains — chatbots, code assistants, image generators, voice cloners — organized into functional categories for granular acceptable-use policies.
227
+
228
+ * **[Web Filtering Database](https://www.webfilteringdatabase.com):** Enterprise-grade downloadable database of 100 million domains across 59 content categories, designed for DNS-level blocking in firewalls, proxies, and secure web gateways.
229
+
230
+ * **[URL Categorization Database](https://www.urlcategorizationdatabase.com):** Categorized domains at enterprise scale for contextual targeting, brand safety, and large-scale analytics.
231
+
232
+ * **[Phishing Detection API](https://www.phishingdetectionapi.com):** Real-time phishing domain detection powered by a daily-updated database of 390,000+ DNS-verified active phishing domains, built for cybersecurity teams, email providers, and safe browsing implementations.
233
+
234
+ ---
235
+
236
+ ## Links
237
+
238
+ - Product and documentation: [https://www.cipawebfiltering.com](https://www.cipawebfiltering.com)
239
+ - FCC — Children's Internet Protection Act: [https://www.fcc.gov/consumers/guides/childrens-internet-protection-act](https://www.fcc.gov/consumers/guides/childrens-internet-protection-act)
240
+ - E-Rate program: [https://www.fcc.gov/general/e-rate-program](https://www.fcc.gov/general/e-rate-program)
241
+
242
+ ## License
243
+
244
+ MIT
@@ -0,0 +1,25 @@
1
+ """
2
+ cipawebfiltering — Python client for the CIPA Web Filtering API.
3
+
4
+ A lightweight wrapper around the REST API at
5
+ https://www.cipawebfiltering.com that lets school districts, libraries,
6
+ and managed service providers look up, filter, and synchronize a
7
+ 120-million-domain content classification database from Python.
8
+ """
9
+
10
+ from .client import (
11
+ CIPAWebFilteringClient,
12
+ CIPAWebFilteringError,
13
+ AuthenticationError,
14
+ RateLimitError,
15
+ NotFoundError,
16
+ )
17
+
18
+ __version__ = "1.0.0"
19
+ __all__ = [
20
+ "CIPAWebFilteringClient",
21
+ "CIPAWebFilteringError",
22
+ "AuthenticationError",
23
+ "RateLimitError",
24
+ "NotFoundError",
25
+ ]
@@ -0,0 +1,209 @@
1
+ """
2
+ CIPA Web Filtering API client.
3
+
4
+ Wraps the REST endpoints at https://www.cipawebfiltering.com:
5
+
6
+ GET /api/v1/lookup/{domain} single domain classification
7
+ GET /api/v1/categories list all 57+ content categories
8
+ POST /api/v1/bulk-lookup classify up to 1,000 domains
9
+ GET /api/v1/delta changes since a timestamp
10
+ GET /api/v1/stats database statistics
11
+
12
+ Only the standard library and ``requests`` are required.
13
+ """
14
+
15
+ import time
16
+ from typing import Dict, Iterator, List, Optional
17
+
18
+ import requests
19
+
20
+ DEFAULT_BASE_URL = "https://cipawebfiltering.com/api/v1"
21
+ DEFAULT_TIMEOUT = 30
22
+ USER_AGENT = "cipawebfiltering-python/1.0.0 (+https://www.cipawebfiltering.com)"
23
+
24
+
25
+ class CIPAWebFilteringError(Exception):
26
+ """Base exception for all client errors."""
27
+
28
+
29
+ class AuthenticationError(CIPAWebFilteringError):
30
+ """Raised on 401/403 — missing, invalid, expired or revoked API key."""
31
+
32
+
33
+ class RateLimitError(CIPAWebFilteringError):
34
+ """Raised on 429 — request quota exceeded for the current plan."""
35
+
36
+
37
+ class NotFoundError(CIPAWebFilteringError):
38
+ """Raised on 404 — resource or endpoint not found."""
39
+
40
+
41
+ class CIPAWebFilteringClient:
42
+ """
43
+ Client for the CIPA Web Filtering domain classification API.
44
+
45
+ Args:
46
+ api_key: Your API key from the account dashboard.
47
+ base_url: Override the API base URL (useful for testing).
48
+ timeout: Per-request timeout in seconds.
49
+ max_retries: Automatic retries on 429 / 5xx with backoff.
50
+
51
+ Example:
52
+ >>> from cipawebfiltering import CIPAWebFilteringClient
53
+ >>> client = CIPAWebFilteringClient("your_api_key")
54
+ >>> result = client.lookup("example.com")
55
+ >>> result["categories"]
56
+ ['Education']
57
+ """
58
+
59
+ def __init__(
60
+ self,
61
+ api_key: str,
62
+ base_url: str = DEFAULT_BASE_URL,
63
+ timeout: int = DEFAULT_TIMEOUT,
64
+ max_retries: int = 3,
65
+ ):
66
+ if not api_key:
67
+ raise ValueError("api_key is required")
68
+ self.api_key = api_key
69
+ self.base_url = base_url.rstrip("/")
70
+ self.timeout = timeout
71
+ self.max_retries = max_retries
72
+ self._session = requests.Session()
73
+ self._session.headers.update(
74
+ {
75
+ "Authorization": f"Bearer {api_key}",
76
+ "Accept": "application/json",
77
+ "Accept-Encoding": "gzip",
78
+ "User-Agent": USER_AGENT,
79
+ }
80
+ )
81
+
82
+ def _request(self, method: str, path: str, **kwargs) -> Dict:
83
+ url = f"{self.base_url}/{path.lstrip('/')}"
84
+ last_exc = None
85
+ for attempt in range(self.max_retries + 1):
86
+ try:
87
+ resp = self._session.request(method, url, timeout=self.timeout, **kwargs)
88
+ except requests.RequestException as exc:
89
+ last_exc = exc
90
+ if attempt < self.max_retries:
91
+ time.sleep(2 ** attempt)
92
+ continue
93
+ raise CIPAWebFilteringError(f"Request to {url} failed: {exc}") from exc
94
+
95
+ if resp.status_code in (200, 201):
96
+ return resp.json()
97
+ if resp.status_code == 401:
98
+ raise AuthenticationError(self._msg(resp, "Invalid or missing API key."))
99
+ if resp.status_code == 403:
100
+ raise AuthenticationError(self._msg(resp, "API key revoked or plan does not include this endpoint."))
101
+ if resp.status_code == 404:
102
+ raise NotFoundError(self._msg(resp, "Resource not found."))
103
+ if resp.status_code == 429:
104
+ if attempt < self.max_retries:
105
+ retry_after = int(resp.headers.get("Retry-After", 2 ** attempt))
106
+ time.sleep(retry_after)
107
+ continue
108
+ raise RateLimitError(self._msg(resp, "Rate limit exceeded."))
109
+ if resp.status_code >= 500:
110
+ if attempt < self.max_retries:
111
+ time.sleep(2 ** attempt)
112
+ continue
113
+ raise CIPAWebFilteringError(self._msg(resp, "Server error."))
114
+ raise CIPAWebFilteringError(self._msg(resp, f"Unexpected status {resp.status_code}."))
115
+ raise CIPAWebFilteringError(f"Request failed after retries: {last_exc}")
116
+
117
+ @staticmethod
118
+ def _msg(resp: requests.Response, default: str) -> str:
119
+ try:
120
+ body = resp.json()
121
+ return body.get("message") or body.get("error") or default
122
+ except ValueError:
123
+ return default
124
+
125
+ def lookup(self, domain: str) -> Dict:
126
+ """
127
+ Classify a single domain against the CIPA filtering database.
128
+ Returns multi-label categories, block recommendation, and confidence.
129
+ """
130
+ domain = self._clean_domain(domain)
131
+ return self._request("GET", f"/lookup/{domain}")
132
+
133
+ def is_blocked(self, domain: str, policy: str = "default") -> bool:
134
+ """Convenience boolean — should this domain be blocked under the given policy?"""
135
+ result = self.lookup(domain)
136
+ return bool(result.get("should_block", False))
137
+
138
+ def bulk_lookup(self, domains: List[str]) -> Dict:
139
+ """Classify up to 1,000 domains in a single request."""
140
+ if len(domains) > 1000:
141
+ raise ValueError("bulk_lookup accepts at most 1000 domains; use bulk_lookup_all().")
142
+ cleaned = [self._clean_domain(d) for d in domains]
143
+ return self._request("POST", "/bulk-lookup", json={"domains": cleaned})
144
+
145
+ def bulk_lookup_all(self, domains: List[str]) -> List[Dict]:
146
+ """Classify any number of domains by chunking into 1,000-item requests."""
147
+ results: List[Dict] = []
148
+ for i in range(0, len(domains), 1000):
149
+ chunk = domains[i : i + 1000]
150
+ resp = self.bulk_lookup(chunk)
151
+ results.extend(resp.get("results", resp.get("domains", [])))
152
+ return results
153
+
154
+ def categories(self) -> Dict:
155
+ """Return the full list of 57+ content categories with descriptions."""
156
+ return self._request("GET", "/categories")
157
+
158
+ def domains(
159
+ self,
160
+ category: Optional[str] = None,
161
+ status: Optional[str] = None,
162
+ cursor: Optional[str] = None,
163
+ ) -> Dict:
164
+ """Return one page of classified domains, optionally filtered by category."""
165
+ params = {}
166
+ if category:
167
+ params["category"] = category
168
+ if status:
169
+ params["status"] = status
170
+ if cursor:
171
+ params["cursor"] = cursor
172
+ return self._request("GET", "/domains", params=params)
173
+
174
+ def iter_domains(self, **filters) -> Iterator[Dict]:
175
+ """Yield every domain record matching filters, walking cursor-based pagination."""
176
+ cursor = None
177
+ while True:
178
+ page = self.domains(cursor=cursor, **filters)
179
+ for record in page.get("domains", []):
180
+ yield record
181
+ cursor = page.get("next_cursor")
182
+ if not cursor:
183
+ break
184
+
185
+ def delta(self, since: str) -> Dict:
186
+ """Return additions and removals since an ISO-8601 timestamp."""
187
+ return self._request("GET", "/delta", params={"since": since})
188
+
189
+ def stats(self) -> Dict:
190
+ """Return database statistics: total domains, category counts, last update."""
191
+ return self._request("GET", "/stats")
192
+
193
+ @staticmethod
194
+ def _clean_domain(domain: str) -> str:
195
+ d = domain.strip().lower()
196
+ for prefix in ("https://", "http://"):
197
+ if d.startswith(prefix):
198
+ d = d[len(prefix):]
199
+ d = d.split("/")[0].split("?")[0]
200
+ return d
201
+
202
+ def close(self) -> None:
203
+ self._session.close()
204
+
205
+ def __enter__(self):
206
+ return self
207
+
208
+ def __exit__(self, *exc):
209
+ self.close()
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.1
2
+ Name: cipawebfiltering
3
+ Version: 1.0.0
4
+ Summary: Python client for the CIPA Web Filtering API — 120M+ classified domains for K-12 schools, districts, and libraries.
5
+ Home-page: https://www.cipawebfiltering.com
6
+ Author: Alpha Quantum
7
+ Author-email: info@alpha-quantum.com
8
+ License: MIT
9
+ Project-URL: Homepage, https://www.cipawebfiltering.com
10
+ Project-URL: API Documentation, https://www.cipawebfiltering.com/docs/integration-guide.php
11
+ Project-URL: Source, https://www.cipawebfiltering.com
12
+ Description: # cipawebfiltering
13
+
14
+ A production-ready Python client for the [CIPA web filtering](https://www.cipawebfiltering.com) domain classification database — 120 million domains classified across 57+ content categories, purpose-built for K-12 school districts, public libraries, and any organization that must comply with the Children's Internet Protection Act. The package wraps the REST API in a small, typed, dependency-light interface so IT administrators, network engineers, and compliance teams can look up, filter, and synchronize domain intelligence directly from Python.
15
+
16
+ ---
17
+
18
+ ## What is CIPA and why does it matter?
19
+
20
+ The Children's Internet Protection Act (CIPA) is a United States federal law enacted in 2000 that requires schools and libraries receiving E-Rate funding or LSTA grants to implement internet safety policies and technology protection measures. In practice, this means deploying a web filtering solution that blocks access to content that is obscene, contains child sexual abuse material (CSAM), or is harmful to minors. Districts must also adopt and enforce an acceptable-use policy that covers student activity on and off campus, including 1:1 device programs.
21
+
22
+ Compliance is not optional: failure to meet CIPA requirements puts E-Rate funding at risk, which for many districts represents hundreds of thousands of dollars annually. Beyond the legal obligation, schools and libraries have a duty of care to protect minors from harmful material while preserving access to educational resources. Over-blocking legitimate content is almost as damaging as under-blocking, because it frustrates teachers, disrupts lesson plans, and erodes trust in the filtering system.
23
+
24
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database addresses both sides of this challenge. Every domain receives multi-label classification rather than a single verdict, so a domain that hosts both educational and social-media content is tagged with both categories. Policy engines can then make precise blocking decisions per category instead of relying on a blunt allow-or-deny list, dramatically reducing false positives while maintaining full coverage of CIPA-mandated content types.
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pip install cipawebfiltering
32
+ ```
33
+
34
+ The only runtime dependency is [`requests`](https://requests.readthedocs.io/). Python 3.7 and newer are supported.
35
+
36
+ ---
37
+
38
+ ## Quick start
39
+
40
+ ```python
41
+ from cipawebfiltering import CIPAWebFilteringClient
42
+
43
+ client = CIPAWebFilteringClient("your_api_key_here")
44
+
45
+ # Check a single domain
46
+ result = client.lookup("example-games-site.com")
47
+ print(result["categories"]) # ["Gaming", "Gambling"]
48
+ print(result["should_block"]) # True
49
+ print(result["confidence"]) # 0.97
50
+
51
+ # Convenience boolean for inline policy decisions
52
+ if client.is_blocked("unknown-domain.net"):
53
+ enforce_block("unknown-domain.net")
54
+ ```
55
+
56
+ An API key is required and can be obtained from the account dashboard at [cipawebfiltering.com](https://www.cipawebfiltering.com) after subscribing to a plan. Keys are passed automatically as a Bearer token on every request.
57
+
58
+ ---
59
+
60
+ ## Configuration
61
+
62
+ ```python
63
+ client = CIPAWebFilteringClient(
64
+ api_key="your_api_key_here",
65
+ base_url="https://cipawebfiltering.com/api/v1", # override for testing
66
+ timeout=30, # per-request timeout in seconds
67
+ max_retries=3, # automatic backoff on 429 and 5xx
68
+ )
69
+ ```
70
+
71
+ Transient failures — HTTP 429 rate limits and 5xx server errors — are retried automatically with exponential backoff, honoring the `Retry-After` header when present. Authentication errors raise immediately.
72
+
73
+ ---
74
+
75
+ ## API methods
76
+
77
+ ### Single domain lookup
78
+
79
+ ```python
80
+ result = client.lookup("social-media-site.com")
81
+ ```
82
+
83
+ **Response:**
84
+
85
+ ```json
86
+ {
87
+ "domain": "social-media-site.com",
88
+ "categories": ["Social Media", "User-Generated Content"],
89
+ "should_block": true,
90
+ "confidence": 0.95,
91
+ "last_seen": "2026-07-22T08:00:00Z",
92
+ "dns_active": true
93
+ }
94
+ ```
95
+
96
+ Pass a bare domain — `example.com`, not `https://example.com/page`. Subdomains resolve to their registrable domain automatically. The response includes multi-label categories, a block recommendation based on your policy tier, and a confidence score. Both found and not-found domains return HTTP 200; check the `should_block` boolean or the `categories` array.
97
+
98
+ ### Bulk lookup
99
+
100
+ Classify up to 1,000 domains in a single request:
101
+
102
+ ```python
103
+ report = client.bulk_lookup(["tiktok.com", "khanacademy.org", "steam-community.ru"])
104
+ for row in report["results"]:
105
+ print(row["domain"], row["categories"], row["should_block"])
106
+ ```
107
+
108
+ For arbitrarily large inputs, chunking is handled automatically:
109
+
110
+ ```python
111
+ all_results = client.bulk_lookup_all(my_50000_domains)
112
+ blocked = [r for r in all_results if r["should_block"]]
113
+ ```
114
+
115
+ ### List categories
116
+
117
+ Retrieve the full taxonomy of 57+ content categories with descriptions:
118
+
119
+ ```python
120
+ cats = client.categories()
121
+ for cat in cats["categories"]:
122
+ print(cat["name"], "-", cat["description"])
123
+ ```
124
+
125
+ Categories include CIPA-mandated types such as Adult Content, Violence, Weapons, Drugs, Gambling, and Malware, as well as productivity-relevant categories like Social Media, Streaming, Gaming, and Shopping.
126
+
127
+ ### Sync the full database
128
+
129
+ For DNS-level filtering, firewall External Dynamic Lists (EDLs), or local proxy caches, stream the entire classified domain list:
130
+
131
+ ```python
132
+ with open("blocked_domains.txt", "w") as fh:
133
+ for record in client.iter_domains(category="Adult Content"):
134
+ fh.write(record["domain"] + "\n")
135
+ ```
136
+
137
+ Then keep it current with daily delta syncs instead of re-downloading everything:
138
+
139
+ ```python
140
+ changes = client.delta(since="2026-07-21T00:00:00Z")
141
+ for added in changes["added"]:
142
+ local_blocklist.add(added["domain"])
143
+ for removed in changes["removed"]:
144
+ local_blocklist.discard(removed["domain"])
145
+ ```
146
+
147
+ This "full load once, delta forever" pattern lets a modest API quota support millions of local lookups, because the actual matching happens in your own DNS resolver, Redis, SQLite, or flat file.
148
+
149
+ ### Database statistics
150
+
151
+ ```python
152
+ stats = client.stats()
153
+ print(stats["total_domains"]) # 120000000+
154
+ print(stats["last_updated"]) # "2026-07-22T06:00:00Z"
155
+ print(stats["new_today"]) # ~300000
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Error handling
161
+
162
+ The client raises a small, specific exception hierarchy:
163
+
164
+ ```python
165
+ from cipawebfiltering import (
166
+ CIPAWebFilteringError,
167
+ AuthenticationError,
168
+ RateLimitError,
169
+ NotFoundError,
170
+ )
171
+
172
+ try:
173
+ result = client.lookup("example.com")
174
+ except AuthenticationError:
175
+ # 401/403 — renew or rotate the key
176
+ ...
177
+ except RateLimitError:
178
+ # 429 after retries — back off or upgrade the plan
179
+ ...
180
+ except CIPAWebFilteringError:
181
+ # any other API or network failure
182
+ ...
183
+ ```
184
+
185
+ The client is also a context manager, so the underlying HTTP session is cleaned up automatically:
186
+
187
+ ```python
188
+ with CIPAWebFilteringClient("your_api_key_here") as client:
189
+ print(client.stats())
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Use cases
195
+
196
+ **District-wide filtering:** Apply consistent content policies across every building in a district. Import the database into your DNS resolver or secure web gateway and enforce category-based rules that distinguish between a blocked gaming site and a permitted educational game.
197
+
198
+ **1:1 Chromebook and laptop programs:** Students take devices home, outside the school firewall. Feed the domain list into a DNS-over-HTTPS resolver or endpoint agent to maintain CIPA compliance on and off campus.
199
+
200
+ **Public library internet access:** Libraries must filter content on public terminals while respecting patron privacy and intellectual freedom. Multi-label classification lets librarians allow research resources that a single-category system would wrongly block.
201
+
202
+ **DNS and RPZ filtering:** Export the database as a Response Policy Zone (RPZ) file and load it into BIND, Unbound, or any RPZ-capable resolver. Blocking happens at the DNS layer with zero latency overhead on permitted traffic.
203
+
204
+ **Firewall EDL integration:** Generate External Dynamic Lists for Palo Alto, Fortinet, or Cisco firewalls. The delta sync endpoint keeps the list current without manual intervention.
205
+
206
+ **AI tool governance in schools:** The database includes a dedicated AI Tools subcategory covering 16,000+ domains — chatbots, essay writers, homework solvers, deepfake tools, and voice cloning services. Districts can permit approved AI tutoring tools while blocking services that undermine academic integrity.
207
+
208
+ ---
209
+
210
+ ## How the database is built
211
+
212
+ The classification pipeline processes approximately 300,000 newly discovered domains every day. Each domain is fetched, its content extracted and analyzed through a multi-stage machine learning pipeline that assigns one or more of 57+ content categories. Unlike single-label classifiers that force every domain into exactly one bucket, the multi-label approach recognizes that real-world websites often span multiple topics. A domain hosting both educational math content and an unmoderated chat forum receives both the Education and the Chat/Messaging labels, allowing the policy engine to make a nuanced decision rather than defaulting to a blanket block or allow.
213
+
214
+ Every classification is verified against a confidence threshold before entering the production database. Domains whose content changes significantly between crawls are re-evaluated and re-labeled automatically. The result is a living dataset that reflects the current state of the web rather than a static snapshot that grows stale within weeks.
215
+
216
+ All content categories required by CIPA — obscene material, CSAM, and content harmful to minors — are maintained as top-level categories with the highest screening priority. Additional categories cover productivity concerns (Social Media, Streaming, Gaming, Shopping), security threats (Malware, Phishing, Command and Control), and emerging risks (AI Tools, Deepfakes, Cryptocurrency).
217
+
218
+ ## Delivery formats
219
+
220
+ The [CIPA web filtering](https://www.cipawebfiltering.com) database is available in multiple formats beyond this Python client:
221
+
222
+ - **REST API** — real-time lookups with millisecond response times
223
+ - **CSV downloads** — daily-refreshed flat files for offline use
224
+ - **DNS / RPZ blocklists** — ready-to-load zone files
225
+ - **PAC files** — browser-level proxy auto-config
226
+ - **Hosts files** — simple domain-to-localhost mapping
227
+ - **Firewall EDLs** — external dynamic lists for next-gen firewalls
228
+
229
+ ---
230
+
231
+ ## Related services
232
+
233
+ For organizations that need broader domain intelligence beyond CIPA compliance, the following services complement this package:
234
+
235
+ * **[Website Categorization API](https://www.websitecategorizationapi.com):** Real-time URL classification using the IAB taxonomy across 700+ categories, supporting ad-tech, brand safety, and content analytics.
236
+
237
+ * **[AI Tools Blocklist](https://www.aitoolsblocklist.com):** A daily-refreshed database of classified AI-tool domains — chatbots, code assistants, image generators, voice cloners — organized into functional categories for granular acceptable-use policies.
238
+
239
+ * **[Web Filtering Database](https://www.webfilteringdatabase.com):** Enterprise-grade downloadable database of 100 million domains across 59 content categories, designed for DNS-level blocking in firewalls, proxies, and secure web gateways.
240
+
241
+ * **[URL Categorization Database](https://www.urlcategorizationdatabase.com):** Categorized domains at enterprise scale for contextual targeting, brand safety, and large-scale analytics.
242
+
243
+ * **[Phishing Detection API](https://www.phishingdetectionapi.com):** Real-time phishing domain detection powered by a daily-updated database of 390,000+ DNS-verified active phishing domains, built for cybersecurity teams, email providers, and safe browsing implementations.
244
+
245
+ ---
246
+
247
+ ## Links
248
+
249
+ - Product and documentation: [https://www.cipawebfiltering.com](https://www.cipawebfiltering.com)
250
+ - FCC — Children's Internet Protection Act: [https://www.fcc.gov/consumers/guides/childrens-internet-protection-act](https://www.fcc.gov/consumers/guides/childrens-internet-protection-act)
251
+ - E-Rate program: [https://www.fcc.gov/general/e-rate-program](https://www.fcc.gov/general/e-rate-program)
252
+
253
+ ## License
254
+
255
+ MIT
256
+
257
+ Keywords: cipa,web filtering,content filtering,dns filtering,k-12,school web filter,domain classification,url categorization,children's internet protection act,safe browsing,firewall edl,acceptable use policy,domain database
258
+ Platform: UNKNOWN
259
+ Classifier: Development Status :: 5 - Production/Stable
260
+ Classifier: Intended Audience :: Developers
261
+ Classifier: Intended Audience :: Education
262
+ Classifier: Intended Audience :: Information Technology
263
+ Classifier: License :: OSI Approved :: MIT License
264
+ Classifier: Programming Language :: Python :: 3
265
+ Classifier: Programming Language :: Python :: 3.7
266
+ Classifier: Programming Language :: Python :: 3.8
267
+ Classifier: Programming Language :: Python :: 3.9
268
+ Classifier: Programming Language :: Python :: 3.10
269
+ Classifier: Programming Language :: Python :: 3.11
270
+ Classifier: Programming Language :: Python :: 3.12
271
+ Classifier: Topic :: Internet :: Proxy Servers
272
+ Classifier: Topic :: Security
273
+ Classifier: Topic :: System :: Networking :: Firewalls
274
+ Requires-Python: >=3.7
275
+ Description-Content-Type: text/markdown
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ setup.py
5
+ cipawebfiltering/__init__.py
6
+ cipawebfiltering/client.py
7
+ cipawebfiltering.egg-info/PKG-INFO
8
+ cipawebfiltering.egg-info/SOURCES.txt
9
+ cipawebfiltering.egg-info/dependency_links.txt
10
+ cipawebfiltering.egg-info/requires.txt
11
+ cipawebfiltering.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.20.0
@@ -0,0 +1 @@
1
+ cipawebfiltering
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,48 @@
1
+ import pathlib
2
+ from setuptools import setup, find_packages
3
+
4
+ HERE = pathlib.Path(__file__).parent
5
+ README = (HERE / "README.md").read_text(encoding="utf-8")
6
+
7
+ setup(
8
+ name="cipawebfiltering",
9
+ version="1.0.0",
10
+ description="Python client for the CIPA Web Filtering API — 120M+ classified domains for K-12 schools, districts, and libraries.",
11
+ long_description=README,
12
+ long_description_content_type="text/markdown",
13
+ author="Alpha Quantum",
14
+ author_email="info@alpha-quantum.com",
15
+ url="https://www.cipawebfiltering.com",
16
+ project_urls={
17
+ "Homepage": "https://www.cipawebfiltering.com",
18
+ "API Documentation": "https://www.cipawebfiltering.com/docs/integration-guide.php",
19
+ "Source": "https://www.cipawebfiltering.com",
20
+ },
21
+ license="MIT",
22
+ packages=find_packages(exclude=("tests", "test")),
23
+ python_requires=">=3.7",
24
+ install_requires=["requests>=2.20.0"],
25
+ keywords=[
26
+ "cipa", "web filtering", "content filtering", "dns filtering",
27
+ "k-12", "school web filter", "domain classification", "url categorization",
28
+ "children's internet protection act", "safe browsing", "firewall edl",
29
+ "acceptable use policy", "domain database",
30
+ ],
31
+ classifiers=[
32
+ "Development Status :: 5 - Production/Stable",
33
+ "Intended Audience :: Developers",
34
+ "Intended Audience :: Education",
35
+ "Intended Audience :: Information Technology",
36
+ "License :: OSI Approved :: MIT License",
37
+ "Programming Language :: Python :: 3",
38
+ "Programming Language :: Python :: 3.7",
39
+ "Programming Language :: Python :: 3.8",
40
+ "Programming Language :: Python :: 3.9",
41
+ "Programming Language :: Python :: 3.10",
42
+ "Programming Language :: Python :: 3.11",
43
+ "Programming Language :: Python :: 3.12",
44
+ "Topic :: Internet :: Proxy Servers",
45
+ "Topic :: Security",
46
+ "Topic :: System :: Networking :: Firewalls",
47
+ ],
48
+ )