Skip to main content
# WHMCSpy

WHMCSpy is a Python interface to the WHMCS REST API.

[![PyPI version](https://badge.fury.io/py/whmcspy.svg)](https://badge.fury.io/py/whmcspy)
[![Documentation Status](https://readthedocs.org/projects/whmcspy/badge/?version=latest)](https://whmcspy.readthedocs.io/en/latest/?badge=latest)

## Usage

Create a WHMCS interface with the API URL and credentials and use it to
call the API.

```python
import whmcspy

whmcs = whmcspy.WHMCS(
'https://example.com/whmcs/includes/api.php',
'identifier',
'secret')
whmcs.accept_order(2)
```

In general API methods can be called as methods in the WHMCS class. For
available API methods see the [WHMCS API reference](
https://developers.whmcs.com/api-reference/).
Note that the casing of the methods differ from the API actions. While the
API actions are CamelCased the methods are snake_cased.

### Calling unimplemented actions

Not all API actions are implemented as Python methods (they will be
implemented as required, of course pull-requests are accepted). In order to
call actions that are not yet implemented [call()] can be used. Example:

```python
response = whmcs.call(
'SomeAction',
param=value,
list_param=[
element,
element2,
]
)
```

See the [call()] documentation for more info.

Some actions return batches of results. To iterate over all results multiple
requests need to be done. For this a convenience method is added:
[paginated_call()]
This method is a generator which yields batches. Using keywords additional
params are accepted. Example:

```python
for response in whmcs.paginated_call(
'GetOrders'):
for order in response['orders']['order']:
print(order)
```

[call()]: https://whmcspy.readthedocs.io/en/latest/whmcspy.html#whmcspy.api.WHMCS.call
[paginated_call()]: https://whmcspy.readthedocs.io/en/latest/whmcspy.html#whmcspy.api.WHMCS.paginated_call


Metadata

Release files for whmcspy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whmcspy 0.3.0
File Size Uploaded Provenance Actions
whmcspy-0.3.0.tar.gz 5.6 kB Without provenance Details for whmcspy-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whmcspy 0.3.0
File Interpreter ABI Platform Actions
whmcspy-0.3.0-py3-none-any.whl Python 3 none any Details for whmcspy-0.3.0-py3-none-any.whl

Total release size: 13.4 kB

Release files / whmcspy-0.3.0.tar.gz

Download URL whmcspy-0.3.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
49e325074a051fa6b200d17028d62cf6c78ac54fc3bbe0a3d3f0ef263a7207a1
BLAKE2b-256 checksum
How to use checksums
4c6bf918878e395a92bfe303be6c1124d662390e57cde571b1c29729121f178d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / whmcspy-0.3.0-py3-none-any.whl

Download URL whmcspy-0.3.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e4caae34dc9dbdb2cbff24d6e86a413d6f9efd5134fd418bd3aa6881c1b2483
BLAKE2b-256 checksum
How to use checksums
2dafa3d154020bd977ffc60fd0c6291503b694a23faae7ead92de970ded2101d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Security for whmcspy 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page