Skip to main content

PythonAnywhere API wrapper.

Project description


*A PythonAnywhere API wrapper.*

.. image::

.. image::



from pythonanywhere_wrapper.client import PythonAnywhere

# If running on a PythonAnywhere terminal, your token and username will
# be discovered automatically. Be sure to setup your API_TOKEN first.

# For information on setting up your API_TOKEN visit
API_TOKEN = "test-token"

# Your PythonAnywhere Username
USER = "test-user"

client = PythonAnywhere(api_key=API_TOKEN, user=USER)



# List all your consoles
response = client.consoles()

# View consoles shared with you
response = client.consoles.shared_with_you()

# Get console by id
response = client.consoles(console_id=123456)

# Kill a console by id
response = client.consoles.delete(console_id=123456)


# Start sharing a file
response = client.files.sharing.create(data={"path": "/path/to/file"})

# Get sharing status by path
response = client.files.sharing(path="/path/to/file")

# Stop sharing a file
response = client.files.sharing.delete(path="/path/to/file")

# List contents of a directory and subdirectories
response = client.files.tree(path="/path/to/directory")


# List all webapps
response = client.webapps()

# Create a new webapp
response = client.webapps.create(data={
"domain_name": "",
"python_version": "python27",

# Get webapp by domain name
response = client.webapps(domain_name="")

# Modify config of a webapp. Follow with reloading webapp.
response = client.webapps.update(
domain_name="", data={
"python_version": "3.6",
"virtualenv_path": "/path/to/virtualenv",

# Delete webapp by domain name
response = client.webapps.delete(domain_name="")

# Reload webapp
response = client.webapps.reload(domain_name="")

Static Files::

# List all static files mappings for a domain
response = client.webapps.static_files(

# Create a new static file mapping for a domain. Reload webapp required.
response = client.webapps.static_files.create(
domain_name="", data={
"url": "/static/", "path": "/path/to/static/dir"

# Get static file mapping by id
response = client.webapps.static_files(
domain_name="", static_id=123

# Modify a static file mapping. Reload webapp required.
response = client.webapps.static_files.update(
domain_name="", static_id=123, data={
"url": "/static/", "path": "/path/to/static/dir"

# Delete a static file mapping by id. Reload webapp required.
response = client.webapps.static_files.delete(
domain_name="", static_id=123


This application uses Open Source components. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.

:Project: chargify-python
:Copyright: Copyright (c) 2010 Hindsight Labs
:License: (MIT)



0.2.0 (2017-10-21)

* name change from pythonanywhere to pythonanywhere-wrapper
* Add history


* Add attribution for chargify-python


* Initial release on PyPI

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pythonanywhere-wrapper, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pythonanywhere-wrapper-0.2.0.tar.gz (15.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page