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.6rc0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c831396b7f2d2d5116b0a9f10b73e4c5bf3a7bd0687aaa9637ab3732c3a214 |
|
MD5 | 17c551a170da8248ec0f0efead49ce4d |
|
BLAKE2b-256 | 52c67071c67d2bcd6ee0a6a0758a082e2737c11ba51892b0baa5e0d8bacad695 |
Close
Hashes for mypythonanywhere-0.0.6rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c4e18385f6d5a97763eb4439b6c8da2c94e461b4126d46c8059f01d72d6570d |
|
MD5 | b5f404643adec9a8dbed6254d85fc358 |
|
BLAKE2b-256 | 963d8da842e67cb69149bd2c52ccbdec8c6661e32ce9ef130076e52481517814 |