Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jul 30, 2024. It is now read-only.
/mofhPublic archive

An API client for MyOwnFreeHost in Python

License

NotificationsYou must be signed in to change notification settings

Wallvon/mofh

Repository files navigation

LicenseCompatible Python versionsPyPi monthly downloadsPyPi version

Tests

mofh by Robert S.

An API wrapper forMyOwnFreeHost.

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:

importmofh# With a context managerwithmofh.Client(username="example",password="password")asclient:response=client.create(username='example',password='password',contactemail='example@example.com',domain='subdomain.example.com',plan='MyAwesomePlan')print(response)# ---# Without a context managerclient=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:

importmofh# With a context managerasyncwithmofh.AsyncClient(username="example",password="password")asclient:response=awaitclient.create(username='example',password='password',contactemail='example@example.com',domain='subdomain.example.com',plan='MyAwesomePlan')print(response)# ---# Without a context managerclient=mofh.AsyncClient(username="example",password="password")response=awaitclient.create(username='example',password='password',contactemail='example@example.com',domain='subdomain.example.com',plan='MyAwesomePlan')print(response)awaitclient.close()

Custom session

It is possible to use custom requests or aiohttp session with configured timeouts and other settings.

Sync:

importmofhfromrequestsimportSessionclient=mofh.Client(username="example",password="password",session=Session())

Async:

importmofhfromaiohttpimportClientSession,ClientTimeoutclient=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:

importmofhclient=mofh.Client(username="example",password="password",api_url="https://panel.myownfreehost.net/xml-api/")

[8]ページ先頭

©2009-2025 Movatter.jp