A python wrapper for the pythonanywhere.com API
Project description
MyPythonAnywhere
A python package to communicate with PythonAnywhere api.
Installation
The beta package is available at PyPi.
Get Started
Requirements
-
Api Token: get your api token from pythonanywhere account page.
-
Determine if your account is US_Based or EU_Based ( It's commonly US. )
-
Your username.
Create Client
from mypythonanywhere import PythonAnywhereClient, AccountType
client = PythonAnywhereClient(
username='MerrilleChoate',
token='API_TOKEN',
account_type=AccountType.UsBased
)
Send Requests
Get cpu usage.
>>> result = client.cpu.get_cpu_usage()
>>> print(result)
# CpuUsage(daily_cpu_limit_seconds=100, next_reset_time='2022-04-17T11:23:40', daily_cpu_total_usage_seconds=0.0)
Get all of your consoles.
>>> result = client.consoles.get_consoles()
>>> print(result)
# [Console(id=24036640, user='MerrilleChoate', executable='python2.7', arguments='', working_directory=None, name='Python2.7 console 24036640', console_url='/user/MerrilleChoate/consoles/24036640/', console_frame_url='/user/MerrilleChoate/consoles/24036640/frame/')]
Direct Call
from mypythonanywhere.types.requests.console_requests import GetConsoleInfo
# --- sniff ---
console = client(GetConsoleInfo(123456789)) # Console
🍟 Not all methods are implemented yet! ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mypythonanywhere-0.0.10rc0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb95cc7bb9de506f619a2dad17f41538ab43dc3d75597d2ad82d79d6babda8e |
|
MD5 | 3a50d268742361f09eef239b18912e14 |
|
BLAKE2b-256 | 0ea60e3da0c3adfd57d8628168f54115511561e0c6f2625fb923a85c988ad792 |
Close
Hashes for mypythonanywhere-0.0.10rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8155a4b641d9828219a28c5830557d36210b24c556431d8f0cfa0baa840812f |
|
MD5 | e659180d3bc7fe4a2825597d86e9300e |
|
BLAKE2b-256 | f2ea538f9f070bd4342fdd4314b1a71ff36601831ae12af0dd57229691562cf1 |