PythonAnywhereClient
Project description
PythonAnywhere Client
This is a Python client library for interacting with the PythonAnywhere platform. The library provides functions to manage web applications, tasks, and other features offered by PythonAnywhere. It uses the requests library for making HTTP requests and provides a simple interface to perform various tasks.
Installation
You can install it using pip
pip install pythonanywhere-client
Usage
from pythonanywhere_client import PythonAnywhereClient
# Replace with your PythonAnywhere username and password
username = 'your_username'
password = 'your_password'
client = PythonAnywhereClient(username, password)
# Logging in
login_response = client.login()
if login_response.error:
print('Login failed:', login_response.data['message'])
else:
print('Login successful!')
# Get web application expiry date
app_name = 'your_app_name'
expiry_response = client.get_app_expiry_date(app_name)
if expiry_response.error:
print('Error:', expiry_response.data['message'])
else:
print('Expiry Date:', expiry_response.data['expiry_date'])
# ... (other tasks)
Methods
login()
- Log in to the PythonAnywhere platformlogout()
- Log out from the PythonAnywhere platformget_app_expiry_date(app_name)
- Get the expiry date of a web applicationreload_app(app_name)
- Reload a web application.get_tasks()
: Get a list of user's tasks.create_task(command, description, hour, minute, enabled=True, interval='daily')
- Create a new task.delete_task(task_id)
- Delete a task.extend_task(task_id)
- Extend the schedule of a task.extend_app(app_name)
- Extend the schedule of a web application.can_create_tasks()
- Check if the user is allowed to create tasks.
Contributing
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
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 pythonanywhere-client-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d9bb7f7e85c04c6b5cb550fe161aa8edbacd9778947c0e346c7597ea78f4269 |
|
MD5 | 7b7b53e30886bfd4cc5f59b801c05b8a |
|
BLAKE2b-256 | 2724d9efc1c6543a252c17ca35ebd8668aa06889ee4ace86ba1eb3d95a1c7a28 |
Close
Hashes for pythonanywhere_client-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4b704523faa3ca781a2c7accd08fc1b59f8243f067d7dba9aa416e5b3340e11 |
|
MD5 | 67fe806635a49169c50cb6b639b6ebfd |
|
BLAKE2b-256 | 0e96cdcfbd22b902bdb64e8fb1874774cf798d754844ec403ca237b3bfefd3f4 |