pythonanywhere


Namepythonanywhere JSON
Version 0.12.1 PyPI version JSON
download
home_pagehttps://github.com/pythonanywhere/helper_scripts/
SummaryPythonAnywhere helper tools for users
upload_time2023-08-11 17:17:43
maintainer
docs_urlNone
authorPythonAnywhere LLP
requires_python>=3.8
licenseMIT
keywords pythonanywhere api cloud web hosting
VCS
bugtrack_url
requirements python-dateutil click docopt importlib-metadata packaging psutil pytest pytest-cov pytest-mock pytest-mypy requests responses schema tabulate typer urllib3 virtualenvwrapper
Travis-CI
coveralls test coverage No coveralls.
            ![Build Status](https://github.com/pythonanywhere/helper_scripts/actions/workflows/tests.yaml/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/pythonanywhere)](https://pypi.org/project/pythonanywhere/)
[![Downloads](https://pepy.tech/badge/pythonanywhere)](https://pepy.tech/project/pythonanywhere)

# PythonAnywhere cli tool

`pa` is a single command to manage PythonAnywhere services. 

It is designed to be run from PythonAnywhere consoles, but many subcommands can be executed directly 
from your own machine (see [usage](#Usage) below). 

## Installing
### On PythonAnywhere
In a PythonAnywhere Bash console, run: 

    pip3.10 install --user pythonanywhere

If there is no `python3.10` on your PythonAnywhere account, 
you should upgrade your account to the newest system image.
See [here](https://help.pythonanywhere.com/pages/ChangingSystemImage) how to do that.
`pa` works with python 3.8, 3.9, and 3.10 but we recommend using the latest system image.

### On your own machine
Install the `pythonanywhere` package from [PyPI](https://pypi.org/project/pythonanywhere/). 
We recommend using `pipx` if you want to use it only as a cli tool, or a virtual environment 
if you want to use a programmatic interface in your own code.

## Usage

There are two ways to use the package. You can just run the scripts or use the underlying api wrappers directly in your scripts.

### Command line interface

### Running `pa` on your local machine

`pa` expects the presence of some environment variables that are provided when you run your code in a PythonAnywere console.
You need to provide them if you run `pa` on your local machine.

`API_TOKEN` -- you need to set this to allow `pa` to connect to the [PythonAnywere API](https://help.pythonanywhere.com/pages/API). 
To get an API token, log into PythonAnywhere and go to the "Account" page using the link at the top right. 
Click on the "API token" tab, and click the "Create a new API token" button to get your token.

`PYTHONANYWHERE_SITE` is used to connect to PythonAnywhere API and defaults to `www.pythonanywhere.com`, 
but you may need to set it to `eu.pythonanywhere.com` if you use our EU site.   

If your username on PythonAnywhere is different from the username on your local machine, 
you may need to set `USER` for the environment you run `pa` in.   

### Programmatic usage in your code

Take a look at the [`pythonanywhere.task`](https://github.com/pythonanywhere/helper_scripts/blob/master/pythonanywhere/task.py) 
module and docstrings of `pythonanywhere.task.Task` class and its methods.   

### Legacy scripts

Some legacy [scripts](https://github.com/pythonanywhere/helper_scripts/blob/master/legacy.md) (separate for each action) are still available.

## Contributing

Pull requests are welcome!  You'll find tests in the [tests](https://github.com/pythonanywhere/helper_scripts/blob/master/tests) folder...

    # prep your dev environment
    mkvirtualenv --python=python3.10 helper_scripts
    pip install -r requirements.txt
    pip install -e .

    # running the tests:
    pytest

    # make sure that the code that you have written is well tested:
    pytest --cov=pythonanywhere --cov=scripts

    # to just run the fast tests:
    pytest -m 'not slowtest' -v


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pythonanywhere/helper_scripts/",
    "name": "pythonanywhere",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pythonanywhere api cloud web hosting",
    "author": "PythonAnywhere LLP",
    "author_email": "developers@pythonanywhere.com",
    "download_url": "https://files.pythonhosted.org/packages/d1/8a/f2055a5e45907648e2a1a63749c8989c468c99db684eb8f1f19d4d99ff08/pythonanywhere-0.12.1.tar.gz",
    "platform": null,
    "description": "![Build Status](https://github.com/pythonanywhere/helper_scripts/actions/workflows/tests.yaml/badge.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/pypi/v/pythonanywhere)](https://pypi.org/project/pythonanywhere/)\n[![Downloads](https://pepy.tech/badge/pythonanywhere)](https://pepy.tech/project/pythonanywhere)\n\n# PythonAnywhere cli tool\n\n`pa` is a single command to manage PythonAnywhere services. \n\nIt is designed to be run from PythonAnywhere consoles, but many subcommands can be executed directly \nfrom your own machine (see [usage](#Usage) below). \n\n## Installing\n### On PythonAnywhere\nIn a PythonAnywhere Bash console, run: \n\n    pip3.10 install --user pythonanywhere\n\nIf there is no `python3.10` on your PythonAnywhere account, \nyou should upgrade your account to the newest system image.\nSee [here](https://help.pythonanywhere.com/pages/ChangingSystemImage) how to do that.\n`pa` works with python 3.8, 3.9, and 3.10 but we recommend using the latest system image.\n\n### On your own machine\nInstall the `pythonanywhere` package from [PyPI](https://pypi.org/project/pythonanywhere/). \nWe recommend using `pipx` if you want to use it only as a cli tool, or a virtual environment \nif you want to use a programmatic interface in your own code.\n\n## Usage\n\nThere are two ways to use the package. You can just run the scripts or use the underlying api wrappers directly in your scripts.\n\n### Command line interface\n\n### Running `pa` on your local machine\n\n`pa` expects the presence of some environment variables that are provided when you run your code in a PythonAnywere console.\nYou need to provide them if you run `pa` on your local machine.\n\n`API_TOKEN` -- you need to set this to allow `pa` to connect to the [PythonAnywere API](https://help.pythonanywhere.com/pages/API). \nTo get an API token, log into PythonAnywhere and go to the \"Account\" page using the link at the top right. \nClick on the \"API token\" tab, and click the \"Create a new API token\" button to get your token.\n\n`PYTHONANYWHERE_SITE` is used to connect to PythonAnywhere API and defaults to `www.pythonanywhere.com`, \nbut you may need to set it to `eu.pythonanywhere.com` if you use our EU site.   \n\nIf your username on PythonAnywhere is different from the username on your local machine, \nyou may need to set `USER` for the environment you run `pa` in.   \n\n### Programmatic usage in your code\n\nTake a look at the [`pythonanywhere.task`](https://github.com/pythonanywhere/helper_scripts/blob/master/pythonanywhere/task.py) \nmodule and docstrings of `pythonanywhere.task.Task` class and its methods.   \n\n### Legacy scripts\n\nSome legacy [scripts](https://github.com/pythonanywhere/helper_scripts/blob/master/legacy.md) (separate for each action) are still available.\n\n## Contributing\n\nPull requests are welcome!  You'll find tests in the [tests](https://github.com/pythonanywhere/helper_scripts/blob/master/tests) folder...\n\n    # prep your dev environment\n    mkvirtualenv --python=python3.10 helper_scripts\n    pip install -r requirements.txt\n    pip install -e .\n\n    # running the tests:\n    pytest\n\n    # make sure that the code that you have written is well tested:\n    pytest --cov=pythonanywhere --cov=scripts\n\n    # to just run the fast tests:\n    pytest -m 'not slowtest' -v\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PythonAnywhere helper tools for users",
    "version": "0.12.1",
    "project_urls": {
        "Homepage": "https://github.com/pythonanywhere/helper_scripts/"
    },
    "split_keywords": [
        "pythonanywhere",
        "api",
        "cloud",
        "web",
        "hosting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d18af2055a5e45907648e2a1a63749c8989c468c99db684eb8f1f19d4d99ff08",
                "md5": "c61af9e2679797be217798c64a667a47",
                "sha256": "bc23ff4f55f3ed8ab4458ee8c2be1962b7e4082934ec46a472a3e301ae41d8a0"
            },
            "downloads": -1,
            "filename": "pythonanywhere-0.12.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c61af9e2679797be217798c64a667a47",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 60582,
            "upload_time": "2023-08-11T17:17:43",
            "upload_time_iso_8601": "2023-08-11T17:17:43.402462Z",
            "url": "https://files.pythonhosted.org/packages/d1/8a/f2055a5e45907648e2a1a63749c8989c468c99db684eb8f1f19d4d99ff08/pythonanywhere-0.12.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-11 17:17:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pythonanywhere",
    "github_project": "helper_scripts",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.8.2"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.3"
                ]
            ]
        },
        {
            "name": "docopt",
            "specs": [
                [
                    "==",
                    "0.6.2"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "4.13.0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": []
        },
        {
            "name": "psutil",
            "specs": [
                [
                    "==",
                    "5.9.4"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.2.0"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "pytest-mock",
            "specs": [
                [
                    "==",
                    "3.10.0"
                ]
            ]
        },
        {
            "name": "pytest-mypy",
            "specs": [
                [
                    "==",
                    "0.10.3"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "responses",
            "specs": [
                [
                    "==",
                    "0.22.0"
                ]
            ]
        },
        {
            "name": "schema",
            "specs": [
                [
                    "==",
                    "0.7.2"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "typer",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.14"
                ]
            ]
        },
        {
            "name": "virtualenvwrapper",
            "specs": [
                [
                    "==",
                    "4.8.4"
                ]
            ]
        }
    ],
    "lcname": "pythonanywhere"
}
        
Elapsed time: 0.10313s