CPanel API Client. Supports cPanel API 2 and UAPI.
Project description
CPanel API Client for Python
Supports cPanel API 2 and 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 = CPanelApi(hostname, username, password)
Domain list:
In [10]: client.uapi.DomainInfo.list_domains()
Out [10]:
{'messages': None,
'status': 1,
'data': {'main_domain': 'site.info',
'sub_domains': ['cabinet.site.info',
'news.site.info',
'shop.site.info'],
'parked_domains': [],
'addon_domains': []},
'errors': None,
'metadata': {},
'warnings': None}
SSH kyes:
In [20]: client.cpanel2.SSH.listkeys()
Out [20]:
{'cpanelresult': {'postevent': {'result': 1},
'apiversion': 2,
'preevent': {'result': 1},
'module': 'SSH',
'func': 'listkeys',
'data': [],
'event': {'result': 1}}}
Function call syntax:
client.api_version.ModuleName.function_name({'param': 'value'})
client.api_version.ModuleName.function_name(param='value')
client.api_version.ModuleName.function_name({'param': 'value'}, param='value')
client.api_cal('version', 'ModuleName', 'function_name', {'param': 'value'}, param='value')
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.2.0.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cpanel-api-0.2.0.tar.gz.
File metadata
- Download URL: cpanel-api-0.2.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.7.12-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c40cdc9fbef95787e131e6957c21848924c3059161e4c50d1548bc20d8f323
|
|
| MD5 |
d2024cce381ca6021fe8cfcccd82db3e
|
|
| BLAKE2b-256 |
67f8a8e68d215d7e1ac2146a40eb6c7a20672584059139f74cffc6e4e38fcba6
|
File details
Details for the file cpanel_api-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cpanel_api-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.7.12-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbc2c74e3929d98746e347595299a62aa78ab3027c969cc2928de5b6a4d6d10a
|
|
| MD5 |
786903dd52327eca6faf70bb46acb82d
|
|
| BLAKE2b-256 |
3e5c29d6537e5b94982bff3db96a3489cdf0038a606958b3dfd90993782af943
|