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 AccountType, FriendlyPythonAnywhereClient
client = FriendlyPythonAnywhereClient(
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.pythonanywhere import PythonAnywhereClient
from mypythonanywhere.types.requests.console_requests import GetConsoleInfo
client = PythonAnywhereClient(
# --- 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.11rc0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 234aaa0cd883315a431b3d742acff2d43d6d2ee4491cd0e9051c8a556215e34a |
|
MD5 | c3e57c66ffa3a5635d76c1ee0c4239cc |
|
BLAKE2b-256 | 7a6de4b59e71968521c6c1d07e3da827753f14e6a427917680be353d4a91756c |
Close
Hashes for mypythonanywhere-0.0.11rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8576381ddd60ff4a8ca7774aa3f01985c656669259d3507d0d9f8632241888f2 |
|
MD5 | 72265f3f29f5fd3547be5fe74df13fc3 |
|
BLAKE2b-256 | 084a8b2de1a7d858dc2c14c3993798a1a7a17472a31c6dfb6f22ec8646c30328 |