Skip to main content

image

made-with-python License: MIT PyPI version Code Size


Overview

An API wrapper around the PythonAnywhere's API. The name stands for pythonanywherewrapper. The key-features are,

  • Modern API wrapper using the async / await syntax
  • 100% API coverage, 100% tested
  • Object-oriented
  • Fully documented & Typehinted
  • Caching handled

We strive to provide an easy-to-use, batteries included modern API wrapper. The documentation can be found here, for help please open an issue.

Installation

The required Python version for the module is 3.9 or above.

# Linux/MacOS
python3 -m pip install pyaww

# Windows
py -m pip install pyaww

Quick Example

To use this module, you first have to create an API key over here. After you've done that, copy the credentials and provide them to the pyaww.User class. It is advised that you do not make your token public within the code, instead, you should store it securely using a package like python-dotenv.

This module is asynchronous meaning it utilises the async / await syntax.

import pyaww
import asyncio

# construct the user class
client = pyaww.User("sexychad420", "my-python-anywhere-token")

async def cpu() -> dict:
    """Gets the CPU information."""
    return await client.get_cpu_info()

asyncio.run(cpu())

Using this module within PythonAnywhere webapps might be a little tricky as they only support WSGI at the moment. However, you can run the function calls synchronously with asyncio module if your desired web framework doesn't support async syntax. Some back-end frameworks such as flask support async syntax in the routes, example:

from flask import Flask
import pyaww

app = Flask(__name__)
client = pyaww.User("sexychad420", "my-python-anywhere-token")

@app.route("/")
async def cpu_usage():
    return await client.get_cpu_info()

if __name__ == '__main__':
    app.run()

If there is no way that you can use the async/await syntax within your webapp, you can downgrade to >3.0.0 versions of this module.

Metadata

Release files for pyaww 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyaww 1.0.0
File Size Uploaded
pyaww-1.0.0.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyaww 1.0.0
File Interpreter ABI Platform
pyaww-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / pyaww-1.0.0.tar.gz

Download URL pyaww-1.0.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6a214f78a90dd0fe1506db4391e4c3b9c5ebbec625295e76842578c6647bc6bc
BLAKE2b-256 checksum
How to use checksums
396338f54649978ce6e973433331cec477d34d903a698d084f4887e67f2148a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / pyaww-1.0.0-py3-none-any.whl

Download URL pyaww-1.0.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9142edac9983a42b1ecba0f11c9cdc85258d8a42a59889a71c115ddf77faa34
BLAKE2b-256 checksum
How to use checksums
008d164b69a77759b0ca7d7cca27b0d361b51f10717728e91e7f4924724c8082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page