Skip to main content

Python client library for Website Categorization API.

Project description

website-categorization-py license website-categorizations-py release website-categorization-py build

Overview

The client library for Website Categorization API in Python language.

The minimum Python version is 3.6.

Installation

pip install website-categorization

Examples

Full API documentation available here

Create a new client

from websitecategorization import *

client = Client('Your API key')

Make basic requests

# Get categories for a domain name.
response = client.data('whoisxmlapi.com')
print("Responded? " + "Yes" if response.website_responded else "No")
if response.website_responded:
    for cat in response.categories:
        if cat.tier1:
            print("Tier1 cat: " + str(cat.tier1.name))
        if cat.tier2:
            print("Tier2 cat: " + str(cat.tier2.name))

Advanced usage

Extra request parameters

# Specifying minimal level of confidence
response = client.data('whoisxmlapi.com', 0.75)

# Getting raw API response in XML and CSV
xml = client.raw_data('whoisxmlapi.com', output_format=Client.XML_FORMAT)
csv = client.raw_data('whoisxmlapi.com', output_format=Client.CSV_FORMAT)

Changelog

1.0.0 (2021-07-08)

  • First release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

website-categorization-1.0.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

website_categorization-1.0.0-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page