Skip to main content

CPanel API Client. Supports latest UAPI.

Project description

CPanel API Client for Python

Supports only UAPI.

$ pip install cpanel-api

Basic usage:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys

from cpanel_api import *

logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)

hostname = 'HOSTNAME_OR_IPADRESS'
username = 'USERNAME'
password = 'PASSWORD'

client = CPanelClient(hostname, username, password)

r = client.SSH.get_port()
print('SSH port:', r.data.port)

from pprint import pprint
r = client.DomainInfo.list_domains()
pprint(r.data)

Function call syntax:

client.ModuleName.function_name({'param': 'value'})
client.ModuleName.function_name(param='value')
client.ModuleName.function_name({'param': 'value'}, param='value')
client.api('ModuleName', 'function_name', {'param': 'value'}, param='value')

Pagination:

client.ModuleName.function_name({'api.paginate': 1, 'api.paginate_size': 10, 'api.paginate_page': 2})

Links:

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

cpanel-api-0.1.2.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

cpanel_api-0.1.2-py3-none-any.whl (3.1 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