mofh by Robert S.
An API wrapper for MyOwnFreeHost.
Installation
To install from PyPi run
pip install mofh
Documentation
Versioning
mofh uses the following versioning pattern:
major.minor.patch
- Major: Breaking changes, the bot is no longer compatible with previous versions.
- Minor: New features, no breaking changes.
- Patch: Bug fixes and small improvements.
Usage
Basic usage (creating an account)
Sync:
import mofh
# With a context manager
with mofh.Client(username="example", password="password") as client:
response = client.create(username='example', password='password', contactemail='example@example.com',
domain='subdomain.example.com', plan='MyAwesomePlan')
print(response)
# ---
# Without a context manager
client = mofh.Client(username="example", password="password")
response = client.create(username='example', password='password', contactemail='example@example.com',
domain='subdomain.example.com', plan='MyAwesomePlan')
print(response)
client.close()
Async:
import mofh
# With a context manager
async with mofh.AsyncClient(username="example", password="password") as client:
response = await client.create(username='example', password='password', contactemail='example@example.com',
domain='subdomain.example.com', plan='MyAwesomePlan')
print(response)
# ---
# Without a context manager
client = mofh.AsyncClient(username="example", password="password")
response = await client.create(username='example', password='password', contactemail='example@example.com',
domain='subdomain.example.com', plan='MyAwesomePlan')
print(response)
await client.close()
Custom session
It is possible to use custom requests or aiohttp session with configured timeouts and other settings.
Sync:
import mofh
from requests import Session
client = mofh.Client(username="example", password="password", session=Session())
Async:
import mofh
from aiohttp import ClientSession, ClientTimeout
client = mofh.AsyncClient(username="example", password="password", session=ClientSession(timeout=ClientTimeout))
Custom API URL
In case URL gets changed for some reason it is possible to overwrite the API URL:
import mofh
client = mofh.Client(username="example", password="password", api_url="https://panel.myownfreehost.net/xml-api/")
Release files for mofh 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mofh-1.0.2.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mofh-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.6 kB
Release files / mofh-1.0.2.tar.gz
| Download URL | mofh-1.0.2.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a50bf4a84e6bbf0eee7b5fd56dc2921806b0da24a3d71924445a6e7b9a01267a
|
|
BLAKE2b-256 checksum How to use checksums |
51c042b17a2a4d1cc8faecb13c32dd22cbcd380aefe2834be0a5719bcdf5e615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / mofh-1.0.2-py3-none-any.whl
| Download URL | mofh-1.0.2-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43dcbea249cb7fd43b23d08518bf6db0eaa3c9a5780b0346a06f83f468ef27e6
|
|
BLAKE2b-256 checksum How to use checksums |
52e4b54b3dfb84a11586765aeac0132f300e69627ddfdd7c0c7dbb44381fecae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|