websiteclassificationapi 2.15__py3-none-any.whl → 2.15.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
test/__init__.py CHANGED
@@ -1,62 +1,62 @@
1
- """
2
- Python wrapper for website categorization API (service of www.websitecategorizationapi.com)
3
-
4
- Explanation of available classifiers:
5
-
6
- Classifier_type should be set to either iab1 (Tier 1 categorization) or iab2 (Tier 2 categorization) for general websites or ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites.
7
-
8
- IAB Tier 1 categorization returns probabilities of text being classified as one of 29 possible categories.
9
-
10
- IAB Tier 2 categorization returns probabilities of text being classified as one of 447 possible categories.
11
-
12
- Ecommerce Tier 1 categorization returns probabilities of text being classified as one of 21 possible categories.
13
-
14
- Ecommerce Tier 2 website categorization returns probabilities of text being classified as one of 182 possible categories.
15
-
16
- Ecommerce Tier 3 website categorization returns probabilities of text being classified as one of 1113 possible categories.
17
- """
18
-
19
- import requests
20
- import json
21
-
22
- class websiteclassificationapi:
23
- def __init__(self):
24
- pass
25
-
26
- @staticmethod
27
- def get_categorization(url,api_key,category_type):
28
- """
29
- url = URL of website
30
- api_key = api key
31
- category_type = iab1 or iab2 for general websites, ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites
32
- """
33
- if category_type=='iab1':
34
- url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category1_url.php"
35
- elif category_type=='iab2':
36
- url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category2_url.php"
37
- elif category_type=='ecommerce1':
38
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category1.php"
39
- elif category_type=='ecommerce2':
40
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category2.php"
41
- elif category_type=='ecommerce3':
42
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category3.php"
43
-
44
- if (('http://' not in url) or ('https://' not in url)):
45
- url = 'http://'+url
46
- try:
47
- url = requests.utils.quote(url)
48
- print("URL:", url)
49
- payload='query='+url+'&api_key='+api_key+'&data_type=url'
50
- headers = {
51
- 'Content-Type': 'application/x-www-form-urlencoded'
52
- }
53
- response = requests.request("POST", url_api, headers=headers, data=payload)
54
- data = json.loads(response.text)
55
- try:
56
- category = data['classification'][0]['category']
57
- except:
58
- category = 'url could not be loaded'
59
- return category
60
- except Exception as e:
61
- print(e)
1
+ """
2
+ Python wrapper for website categorization API (service of www.websitecategorizationapi.com)
3
+
4
+ Explanation of available classifiers:
5
+
6
+ Classifier_type should be set to either iab1 (Tier 1 categorization) or iab2 (Tier 2 categorization) for general websites or ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites.
7
+
8
+ IAB Tier 1 categorization returns probabilities of text being classified as one of 29 possible categories.
9
+
10
+ IAB Tier 2 categorization returns probabilities of text being classified as one of 447 possible categories.
11
+
12
+ Ecommerce Tier 1 categorization returns probabilities of text being classified as one of 21 possible categories.
13
+
14
+ Ecommerce Tier 2 website categorization returns probabilities of text being classified as one of 182 possible categories.
15
+
16
+ Ecommerce Tier 3 website categorization returns probabilities of text being classified as one of 1113 possible categories.
17
+ """
18
+
19
+ import requests
20
+ import json
21
+
22
+ class websiteclassificationapi:
23
+ def __init__(self):
24
+ pass
25
+
26
+ @staticmethod
27
+ def get_categorization(url,api_key,category_type):
28
+ """
29
+ url = URL of website
30
+ api_key = api key
31
+ category_type = iab1 or iab2 for general websites, ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites
32
+ """
33
+ if category_type=='iab1':
34
+ url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category1_url.php"
35
+ elif category_type=='iab2':
36
+ url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category2_url.php"
37
+ elif category_type=='ecommerce1':
38
+ url_api = "https://www.websitecategorizationapi.com/api/iab/gpt_category1.php"
39
+ elif category_type=='ecommerce2':
40
+ url_api = "https://www.websitecategorizationapi.com/api/iab/gpt_category2.php"
41
+ elif category_type=='ecommerce3':
42
+ url_api = "https://www.websitecategorizationapi.com/api/gpt_new1/gpt_category3.php"
43
+
44
+ if (('http://' not in url) or ('https://' not in url)):
45
+ url = 'http://'+url
46
+ try:
47
+ url = requests.utils.quote(url)
48
+ print("URL:", url)
49
+ payload='query='+url+'&api_key='+api_key+'&data_type=url'
50
+ headers = {
51
+ 'Content-Type': 'application/x-www-form-urlencoded'
52
+ }
53
+ response = requests.request("POST", url_api, headers=headers, data=payload)
54
+ data = json.loads(response.text)
55
+ try:
56
+ category = data['classification'][0]['category']
57
+ except:
58
+ category = 'url could not be loaded'
59
+ return category
60
+ except Exception as e:
61
+ print(e)
62
62
  pass
@@ -1,62 +1,62 @@
1
- """
2
- Python wrapper for website categorization API (service of www.websitecategorizationapi.com)
3
-
4
- Explanation of available classifiers:
5
-
6
- Classifier_type should be set to either iab1 (Tier 1 categorization) or iab2 (Tier 2 categorization) for general websites or ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites.
7
-
8
- IAB Tier 1 categorization returns probabilities of text being classified as one of 29 possible categories.
9
-
10
- IAB Tier 2 categorization returns probabilities of text being classified as one of 447 possible categories.
11
-
12
- Ecommerce Tier 1 categorization returns probabilities of text being classified as one of 21 possible categories.
13
-
14
- Ecommerce Tier 2 website categorization returns probabilities of text being classified as one of 182 possible categories.
15
-
16
- Ecommerce Tier 3 website categorization returns probabilities of text being classified as one of 1113 possible categories.
17
- """
18
-
19
- import requests
20
- import json
21
-
22
- class websiteclassificationapi:
23
- def __init__(self):
24
- pass
25
-
26
- @staticmethod
27
- def get_categorization(url,api_key,category_type):
28
- """
29
- url = URL of website
30
- api_key = api key
31
- category_type = iab1 or iab2 for general websites, ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites
32
- """
33
- if category_type=='iab1':
34
- url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category1_url.php"
35
- elif category_type=='iab2':
36
- url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category2_url.php"
37
- elif category_type=='ecommerce1':
38
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category1.php"
39
- elif category_type=='ecommerce2':
40
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category2.php"
41
- elif category_type=='ecommerce3':
42
- url_api = "https://www.websitecategorizationapi.com/api/iab/gpt/gpt_category3.php"
43
-
44
- if (('http://' not in url) or ('https://' not in url)):
45
- url = 'http://'+url
46
- try:
47
- url = requests.utils.quote(url)
48
- print("URL:", url)
49
- payload='query='+url+'&api_key='+api_key+'&data_type=url'
50
- headers = {
51
- 'Content-Type': 'application/x-www-form-urlencoded'
52
- }
53
- response = requests.request("POST", url_api, headers=headers, data=payload)
54
- data = json.loads(response.text)
55
- try:
56
- category = data['classification'][0]['category']
57
- except:
58
- category = 'url could not be loaded'
59
- return category
60
- except Exception as e:
61
- print(e)
1
+ """
2
+ Python wrapper for website categorization API (service of www.websitecategorizationapi.com)
3
+
4
+ Explanation of available classifiers:
5
+
6
+ Classifier_type should be set to either iab1 (Tier 1 categorization) or iab2 (Tier 2 categorization) for general websites or ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites.
7
+
8
+ IAB Tier 1 categorization returns probabilities of text being classified as one of 29 possible categories.
9
+
10
+ IAB Tier 2 categorization returns probabilities of text being classified as one of 447 possible categories.
11
+
12
+ Ecommerce Tier 1 categorization returns probabilities of text being classified as one of 21 possible categories.
13
+
14
+ Ecommerce Tier 2 website categorization returns probabilities of text being classified as one of 182 possible categories.
15
+
16
+ Ecommerce Tier 3 website categorization returns probabilities of text being classified as one of 1113 possible categories.
17
+ """
18
+
19
+ import requests
20
+ import json
21
+
22
+ class websiteclassificationapi:
23
+ def __init__(self):
24
+ pass
25
+
26
+ @staticmethod
27
+ def get_categorization(url,api_key,category_type):
28
+ """
29
+ url = URL of website
30
+ api_key = api key
31
+ category_type = iab1 or iab2 for general websites, ecommerce1, ecommerce2 and ecommerce3 for E-commerce or product websites
32
+ """
33
+ if category_type=='iab1':
34
+ url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category1_url.php"
35
+ elif category_type=='iab2':
36
+ url_api = "https://www.websitecategorizationapi.com/api/iab/iab_category2_url.php"
37
+ elif category_type=='ecommerce1':
38
+ url_api = "https://www.websitecategorizationapi.com/api/iab/gpt_category1.php"
39
+ elif category_type=='ecommerce2':
40
+ url_api = "https://www.websitecategorizationapi.com/api/iab/gpt_category2.php"
41
+ elif category_type=='ecommerce3':
42
+ url_api = "https://www.websitecategorizationapi.com/api/gpt_new1/gpt_category3.php"
43
+
44
+ if (('http://' not in url) or ('https://' not in url)):
45
+ url = 'http://'+url
46
+ try:
47
+ url = requests.utils.quote(url)
48
+ print("URL:", url)
49
+ payload='query='+url+'&api_key='+api_key+'&data_type=url'
50
+ headers = {
51
+ 'Content-Type': 'application/x-www-form-urlencoded'
52
+ }
53
+ response = requests.request("POST", url_api, headers=headers, data=payload)
54
+ data = json.loads(response.text)
55
+ try:
56
+ category = data['classification'][0]['category']
57
+ except:
58
+ category = 'url could not be loaded'
59
+ return category
60
+ except Exception as e:
61
+ print(e)
62
62
  pass
@@ -1,11 +1,15 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: websiteclassificationapi
3
- Version: 2.15
3
+ Version: 2.15.2
4
4
  Summary: Website classification API
5
- Home-page: https://github.com/websitecategorization/websiteclassificationnapi
5
+ Home-page: https://www.websitecategorizationapi.com
6
6
  Author-email: info@websitecategorizationapi.com
7
7
  Project-URL: Homepage, https://www.websitecategorizationapi.com
8
+ Project-URL: Source, https://github.com/explainableaixai/websitecategorizationapi
9
+ Project-URL: AI Agent Allow List, https://www.aiagentallowlist.com
10
+ Project-URL: Shadow AI Tools, https://www.shadowaitools.com
8
11
  Project-URL: AI Tools Blocklist, https://www.aitoolsblocklist.com
12
+ Project-URL: Resume Reader API, http://resumereaderapi.com
9
13
  Keywords: website categorization,classification,categorization
10
14
  Classifier: License :: OSI Approved :: MIT License
11
15
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.3
@@ -120,13 +124,13 @@ Having verticals set up may also mean better filtering and lead to higher conver
120
124
 
121
125
  ## Our other services
122
126
 
123
- Companies that manage internet access often start with a [web filtering database](https://webfilteringdatabase.com) to review how domains are categorized. This supports better decisions around policy cr
124
- eation, reporting, and risk visibility. Many of those teams also evaluate a [web filtering service](https://webfilteringservice.com) to apply those controls in production.
127
+ Companies that manage internet access often start with a [web filtering database](https://www.webfilteringdatabase.com) to review how domains are categorized. This supports better decisions around policy cr
128
+ eation, reporting, and risk visibility. Many of those teams also evaluate a [web filtering service](https://www.webfilteringservice.com) to apply those controls in production.
125
129
 
126
130
 
127
131
  We also provide an [Anonymization API](https://www.anonymizationapi.com) for privacy-preserving media and data workflows.
128
132
 
129
- Schools and libraries subject to the Children's Internet Protection Act need more than generic web categories — they need a purpose-built [CIPA web filtering](https://www.cipawebfiltering.com) database with 120 million domains organized into 57+ content categories aligned to federal compliance requirements. Pairing categorization with threat intelligence strengthens any filtering deployment, and our [phishing detection API](https://www.phishingdetectionapi.com) delivers real-time lookups against 390,000+ DNS-verified active phishing domains so that malicious URLs are blocked before they reach end users. Together, these services give IT teams the classification depth and security coverage needed to protect students, staff, and network infrastructure.
133
+ Schools and libraries subject to the Children's Internet Protection Act need more than generic web categories, they need a purpose-built [CIPA web filtering](https://www.cipawebfiltering.com) database with 120 million domains organized into 57+ content categories aligned to federal compliance requirements. Pairing categorization with threat intelligence strengthens any filtering deployment, and our [phishing detection API](https://www.phishingdetectionapi.com) delivers real-time lookups against 390,000+ DNS-verified active phishing domains so that malicious URLs are blocked before they reach end users. Together, these services give IT teams the classification depth and security coverage needed to protect students, staff, and network infrastructure.
130
134
 
131
135
  ## AI explainability
132
136
 
@@ -183,7 +187,7 @@ Our digital solutions are trusted by organizations seeking reliable, secure, and
183
187
 
184
188
  Business growth is supported through our [corporate enrichment data](https://www.companydataapi.com), delivering actionable intelligence much like the work at [Cambridge](https://www.cam.ac.uk). For cybersecurity and research teams, our [domain dataset](https://www.urlcategorizationdatabase.com) offers extensive categorization, paralleling the data-centric methods at [Berkeley](https://www.berkeley.edu).
185
189
 
186
- By aligning our solutions with the excellence demonstrated at [Yale](https://www.yale.edu) and [Cornell](https://www.cornell.edu), we ensure that your organization stays at the cutting edge—combining technology, research, and practical results for every challenge.
190
+ By aligning our solutions with the excellence demonstrated at [Yale](https://www.yale.edu) and [Cornell](https://www.cornell.edu), we ensure that your organization stays at the cutting edge, combining technology, research, and practical results for every challenge.
187
191
 
188
192
 
189
193
  ## Example classifications
@@ -318,6 +322,10 @@ Example classification for website www.github.com:
318
322
 
319
323
  For teams building acceptable-use or data-loss-prevention policies around generative AI, the [AI Tools Blocklist](https://www.aitoolsblocklist.com) complements this classifier with a purpose-built feed of AI-tool domains grouped into functional categories (chatbots, code assistants, media generators, voice cloning, and more). It answers a question generic categorization cannot: not just "is this site AI-related," but "which kind of AI tool is it," which is what granular blocking policies require.
320
324
 
325
+ Website classification at massive scale also applies to discovering acquisition candidates across the full web. Our [web-scale deal origination platform](https://www.acquisitionuniverse.com) screens over 100 million classified domains against buyer acquisition theses, extracting 15 operational signals per company from their public web presence. Private equity firms, search funds, and corporate development teams use the pipeline to surface non-obvious targets whose websites reveal strong fit signals, leadership depth, recurring revenue indicators, compliance readiness, that conventional company databases never capture.
326
+
327
+ The same classification engine powers contextual audience segments for programmatic advertising without cookies. Our [cookieless advertising data platform](https://www.cookielessaudiences.com) delivers domain datasets pre-categorized under the IAB content taxonomy, enabling DSPs and publishers to target audiences based on page context rather than user-level tracking. With Chrome, Safari, and Firefox deprecating third-party cookies, domain-level contextual classification is becoming the primary signal for brand-safe, regulation-compliant ad placement at scale.
328
+
321
329
  ## Useful resources used in development of website categorization
322
330
 
323
331
  - [Tensorflow](https://www.tensorflow.org/)
@@ -332,3 +340,16 @@ For teams building acceptable-use or data-loss-prevention policies around genera
332
340
 
333
341
  - [Top shopify stores](https://www.leadsquantum.com)
334
342
  - [AI Tools Blocklist](https://www.aitoolsblocklist.com)
343
+ - [CV parser](http://resumereaderapi.com), AI resume parsing API that turns PDF/DOCX resumes into structured JSON
344
+
345
+ Classifying scraped or user-submitted pages means ingesting text you don't control, and that text regularly contains names, emails, and phone numbers. A [PII detection API](https://www.piidetectionapi.com) can flag and mask personal data in each document before classification results and source text are persisted. Teams subject to GDPR use automated [PII masking](https://www.piidetectionapi.com) as the standard pre-processing step for any external text pipeline.
346
+
347
+ Classifying a website answers what it is; agent deployments also need to know where its sensitive surfaces live. An [AI agent allowlist](https://www.aiagentallowlist.com) enriches every domain with verified URLs for 28 page types, letting policy engines allow research pages while denying credential and transaction surfaces. Classification plus [page-level agent policy](https://www.aiagentallowlist.com) is becoming the standard pairing for safe autonomous browsing.
348
+
349
+ ## Related packages on PyPI and npm
350
+
351
+ - [aiblocklist](https://pypi.org/project/aiblocklist/) (also on [npm](https://www.npmjs.com/package/aiblocklist)): Python client for the [AI tools blocklist](https://www.aitoolsblocklist.com), 20,000+ AI-tool domains in 18 functional categories, daily refresh, feed downloads for DNS and firewall enforcement.
352
+ - [shadowaitools](https://pypi.org/project/shadowaitools/) (also on [npm](https://www.npmjs.com/package/shadowaitools)): a command-line tool that reads a DNS, proxy or firewall export and lists the AI tools in it; the hosted audit at [shadowaitools.com](https://www.shadowaitools.com) adds the per-user view, training verdicts and the PDF evidence pack.
353
+ - [aiagentallowlist](https://pypi.org/project/aiagentallowlist/) (also on [npm](https://www.npmjs.com/package/aiagentallowlist)): the [AI agent allow list](https://www.aiagentallowlist.com) client, verified page-type URLs and per-URL verdicts across 40 million+ domains for web-browsing agents.
354
+ - [phishingdetectionapi](https://pypi.org/project/phishingdetectionapi/), [cipawebfiltering](https://pypi.org/project/cipawebfiltering/), [productcategorizationapi](https://pypi.org/project/productcategorizationapi/) on PyPI; [webfilteringdatabase](https://www.npmjs.com/package/webfilteringdatabase) and [websitecategorization](https://www.npmjs.com/package/websitecategorization) on npm.
355
+ - Repositories: [github.com/explainableaixai](https://github.com/explainableaixai), [gitlab.com/url-classifications](https://gitlab.com/url-classifications).
@@ -0,0 +1,7 @@
1
+ test/__init__.py,sha256=2CRQNSj3wox7JogFAtEbBDR-3_xnfgmjOm51zq2W4uA,2801
2
+ websiteclassificationapi/__init__.py,sha256=2CRQNSj3wox7JogFAtEbBDR-3_xnfgmjOm51zq2W4uA,2801
3
+ websiteclassificationapi-2.15.2.dist-info/LICENSE,sha256=7Fog1crdAQKBoXwk300JwPHIMJV-386OAuvTrd-N8hs,1083
4
+ websiteclassificationapi-2.15.2.dist-info/METADATA,sha256=ue43bIY8O4Dp469wu9S9fWhxbBeNejjBB3w5q6oFrdc,20606
5
+ websiteclassificationapi-2.15.2.dist-info/WHEEL,sha256=BNRMDyzLkkcmlv0J8ppDQkk2VED33SesJDynr9ED1gc,91
6
+ websiteclassificationapi-2.15.2.dist-info/top_level.txt,sha256=e76DP_x4tfbB3dn42joSGBVORT6U6GlMaReN7W-X8nY,30
7
+ websiteclassificationapi-2.15.2.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- test/__init__.py,sha256=wTdBA0QbwpUvhKcdWegp481T0tvA6XcAb9BkdSDkzvE,2869
2
- websiteclassificationapi/__init__.py,sha256=wTdBA0QbwpUvhKcdWegp481T0tvA6XcAb9BkdSDkzvE,2869
3
- websiteclassificationapi-2.15.dist-info/LICENSE,sha256=7Fog1crdAQKBoXwk300JwPHIMJV-386OAuvTrd-N8hs,1083
4
- websiteclassificationapi-2.15.dist-info/METADATA,sha256=nBW2gYcnam2XHLNZGG5ULaQ0nBu83WRRM6rFJM3EBRs,16567
5
- websiteclassificationapi-2.15.dist-info/WHEEL,sha256=BNRMDyzLkkcmlv0J8ppDQkk2VED33SesJDynr9ED1gc,91
6
- websiteclassificationapi-2.15.dist-info/top_level.txt,sha256=e76DP_x4tfbB3dn42joSGBVORT6U6GlMaReN7W-X8nY,30
7
- websiteclassificationapi-2.15.dist-info/RECORD,,