Skip to main content

License Compatible Python versions PyPi monthly downloads PyPi version

Tests

mofh by Robert S.

An API wrapper for MyOwnFreeHost.

Installation

To install from PyPi run

pip install mofh

Documentation

https://mofh.readthedocs.io

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)

Source distribution for mofh 1.0.2
File Size Uploaded
mofh-1.0.2.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mofh 1.0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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