WHM Api interface
Project description
>>> ========================================================== <<<
>>> _ <<<
>>> __ __| |__ __ _ _ __ ___ _ __ _ _ <<<
>>> \ \ /\ / /| '_ \ / _` || '_ ` _ \ | '_ \ | | | | <<<
>>> \ V V / | | | || (_| || | | | | || |_) || |_| | <<<
>>> \_/\_/ |_| |_| \__,_||_| |_| |_|| .__/ \__, | <<<
>>> |_| |___/ <<<
>>> ========================================================== <<<
Description
This is a first version of the Python WHM API interface library While it was inspired by SIRBUGS script to create CPanels, while trying to adapt it to use as a library - it was completely reworked. In the first version only a generic function call is implemented, which allows full control of the WHM panel, but lacks "convenience" functions for mostly used specific WHM Api functions.
Setup
$ pip install whambampy
Usage
def create_cpanel():
from whambampy import whm
whm = whm(host='example.com', username='whmuser', api_token='mysecuretoken')
result = whm.call(function='createacct', username='newuser', domain='new.example.com')
if 'Creation Ok' in result['metadata'].get('reason'):
return True
Full list of WHM Api functions can be found in api_commands.py
Documentation regarding api contracts for each function can be found at https://api.docs.cpanel.net/openapi/whm/operation/{{ function_name }}
Suggestions and contributions are always welcome. Any found bugs should be filed in issues
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
File details
Details for the file WhamBamPy-0.0.7.tar.gz
.
File metadata
- Download URL: WhamBamPy-0.0.7.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dafb5b65c77b31c0c2021485caeeb9406c3017014ca26871b1c7e5380e72d80c |
|
MD5 | db8b2924e4ef7832ccdffc538a0380b3 |
|
BLAKE2b-256 | a9ebaa56a78c7134ec6b41b17c7a616b6a0e86199082bc2af3702e6b15d54221 |