hostedpi


Namehostedpi JSON
Version 0.4.3 PyPI version JSON
download
home_pageNone
SummaryPython interface to the Mythic Beasts Hosted Pi API
upload_time2025-07-25 15:33:03
maintainerNone
docs_urlNone
authorBen Nuttall
requires_python<4.0,>=3.9
licenseBSD 3-Clause License
keywords raspberrypi piwheels mythicbeasts hostedpi picloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
hostedpi
========

.. image:: https://badge.fury.io/py/hostedpi.svg
    :target: https://badge.fury.io/py/hostedpi
    :alt: Latest Version

Python interface to the `Mythic Beasts Hosted Pi`_ API, developed by the `piwheels`_ team
(`Ben Nuttall`_ and `Dave Jones`_).

.. _Mythic Beasts Hosted Pi: https://www.mythic-beasts.com/order/rpi
.. _piwheels: https://www.piwheels.org/
.. _Ben Nuttall: https://github.com/bennuttall
.. _Dave Jones: https://github.com/waveform80

This module provides a Pythonic interface to the API, as well as a command line interface.

The authors of this library are not affiliated with Mythic Beasts, but we use their Pi cloud to
power the piwheels project.

Documentation of the API itself can be found at
https://www.mythic-beasts.com/support/api/raspberry-pi

.. note::
    
    Note that the library is currently in beta. The API and CLI are not yet stable and may change.
    Once the library reaches v1.0, it will be considered stable.

Usage
=====

View the information about Pis in your account from the command line:

.. code-block:: console

    $ hostedpi list          
    pi123
    pi234
    pi345
    pi456
    $ hostedpi table
    ┏━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┓
    ┃ Name  ┃ Model ┃ Memory ┃ CPU Speed ┃
    ┡━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━┩
    │ pi123 │ 3     │ 1 GB   │ 1.2 GHz   │
    │ pi234 │ 3     │ 1 GB   │ 1.2 GHz   │
    │ pi345 │ 4     │ 8 GB   │ 2.0 GHz   │
    │ pi456 │ 4     │ 4 GB   │ 1.5 GHz   │
    └───────┴───────┴────────┴───────────┘
    $ hostedpi table pi123
    ┏━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┓
    ┃ Name  ┃ Model ┃ Memory ┃ CPU Speed ┃
    ┡━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━┩
    │ pi123 │ 3     │ 1 GB   │ 1.2 GHz   │
    └───────┴───────┴────────┴───────────┘

    $ hostedpi table pi345 --full
    ┏━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
    ┃ Name  ┃ Model ┃ Memory ┃ CPU Speed ┃ NIC Speed ┃ Disk size ┃ Status     ┃ Initialised keys ┃ IPv4 SSH port ┃
    ┡━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
    │ pi345 │ 4B    │ 8 GB   │ 2.0 GHz   │ 1 Gbps    │ 50 GB     │ Powered on │ Yes              │ 5387          │
    └───────┴───────┴────────┴───────────┴───────────┴───────────┴────────────┴──────────────────┴───────────────┘

Provision a new Pi with your public key and SSH into it:

.. code-block:: console

    $ hostedpi create mypi --model 3 --ssh-key-path ~/.ssh/id_rsa.pub --wait
    Server provisioned
    ┏━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┓
    ┃ Name ┃ Model ┃ Memory ┃ CPU Speed ┃
    ┡━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━┩
    │ mypi | 3     │ 1 GB   │ 1.2 GHz   │
    └──────┴───────┴────────┴───────────┘
    $ hostedpi ssh command mypi
    ssh -p 5063 root@ssh.mypi.hostedpi.com
    $ ssh -p 5063 root@ssh.mypi.hostedpi.com
    root@mypi:~#

Write a Python script to provision a new Pi and output its SSH command:

.. code-block:: python

    from hostedpi import PiCloud, Pi4ServerSpec

    cloud = PiCloud()
    
    pi = cloud.create_pi(name="mypi", spec=Pi4ServerSpec())
    print(pi.ipv4_ssh_command)

* See the `getting_started`_ page for information on how to get API keys and authenticate
* See the `cli/index`_ page for information on using the command line interface
* See the `api/index`_ page for the module's API reference

.. _getting_started: https://hostedpi.readthedocs.io/en/latest/getting_started.html
.. _cli/index: https://hostedpi.readthedocs.io/en/latest/cli/index.html
.. _api/index: https://hostedpi.readthedocs.io/en/latest/api/index.html

Documentation
=============

Documentation for this module can be found at https://hostedpi.readthedocs.io/

Documentation of the API itself can be found at
https://www.mythic-beasts.com/support/api/raspberry-pi

Contributing
============

* Source code can be found on GitHub at https://github.com/piwheels/hostedpi
* Code and documentation contributions welcome
* The issue tracker can be found at https://github.com/piwheels/hostedpi/issues
* For issues with the API itself, please contact Mythic Beasts support
  https://www.mythic-beasts.com/support


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hostedpi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "raspberrypi, piwheels, mythicbeasts, hostedpi, picloud",
    "author": "Ben Nuttall",
    "author_email": "ben@bennuttall.com",
    "download_url": "https://files.pythonhosted.org/packages/8c/4e/b1814b4d54ed526196df83a0f9705acf9d17eb9c8659f3b5ff7fe47f67e7/hostedpi-0.4.3.tar.gz",
    "platform": null,
    "description": "========\nhostedpi\n========\n\n.. image:: https://badge.fury.io/py/hostedpi.svg\n    :target: https://badge.fury.io/py/hostedpi\n    :alt: Latest Version\n\nPython interface to the `Mythic Beasts Hosted Pi`_ API, developed by the `piwheels`_ team\n(`Ben Nuttall`_ and `Dave Jones`_).\n\n.. _Mythic Beasts Hosted Pi: https://www.mythic-beasts.com/order/rpi\n.. _piwheels: https://www.piwheels.org/\n.. _Ben Nuttall: https://github.com/bennuttall\n.. _Dave Jones: https://github.com/waveform80\n\nThis module provides a Pythonic interface to the API, as well as a command line interface.\n\nThe authors of this library are not affiliated with Mythic Beasts, but we use their Pi cloud to\npower the piwheels project.\n\nDocumentation of the API itself can be found at\nhttps://www.mythic-beasts.com/support/api/raspberry-pi\n\n.. note::\n    \n    Note that the library is currently in beta. The API and CLI are not yet stable and may change.\n    Once the library reaches v1.0, it will be considered stable.\n\nUsage\n=====\n\nView the information about Pis in your account from the command line:\n\n.. code-block:: console\n\n    $ hostedpi list          \n    pi123\n    pi234\n    pi345\n    pi456\n    $ hostedpi table\n    \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n    \u2503 Name  \u2503 Model \u2503 Memory \u2503 CPU Speed \u2503\n    \u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n    \u2502 pi123 \u2502 3     \u2502 1 GB   \u2502 1.2 GHz   \u2502\n    \u2502 pi234 \u2502 3     \u2502 1 GB   \u2502 1.2 GHz   \u2502\n    \u2502 pi345 \u2502 4     \u2502 8 GB   \u2502 2.0 GHz   \u2502\n    \u2502 pi456 \u2502 4     \u2502 4 GB   \u2502 1.5 GHz   \u2502\n    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n    $ hostedpi table pi123\n    \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n    \u2503 Name  \u2503 Model \u2503 Memory \u2503 CPU Speed \u2503\n    \u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n    \u2502 pi123 \u2502 3     \u2502 1 GB   \u2502 1.2 GHz   \u2502\n    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n    $ hostedpi table pi345 --full\n    \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n    \u2503 Name  \u2503 Model \u2503 Memory \u2503 CPU Speed \u2503 NIC Speed \u2503 Disk size \u2503 Status     \u2503 Initialised keys \u2503 IPv4 SSH port \u2503\n    \u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n    \u2502 pi345 \u2502 4B    \u2502 8 GB   \u2502 2.0 GHz   \u2502 1 Gbps    \u2502 50 GB     \u2502 Powered on \u2502 Yes              \u2502 5387          \u2502\n    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\nProvision a new Pi with your public key and SSH into it:\n\n.. code-block:: console\n\n    $ hostedpi create mypi --model 3 --ssh-key-path ~/.ssh/id_rsa.pub --wait\n    Server provisioned\n    \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n    \u2503 Name \u2503 Model \u2503 Memory \u2503 CPU Speed \u2503\n    \u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n    \u2502 mypi | 3     \u2502 1 GB   \u2502 1.2 GHz   \u2502\n    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n    $ hostedpi ssh command mypi\n    ssh -p 5063 root@ssh.mypi.hostedpi.com\n    $ ssh -p 5063 root@ssh.mypi.hostedpi.com\n    root@mypi:~#\n\nWrite a Python script to provision a new Pi and output its SSH command:\n\n.. code-block:: python\n\n    from hostedpi import PiCloud, Pi4ServerSpec\n\n    cloud = PiCloud()\n    \n    pi = cloud.create_pi(name=\"mypi\", spec=Pi4ServerSpec())\n    print(pi.ipv4_ssh_command)\n\n* See the `getting_started`_ page for information on how to get API keys and authenticate\n* See the `cli/index`_ page for information on using the command line interface\n* See the `api/index`_ page for the module's API reference\n\n.. _getting_started: https://hostedpi.readthedocs.io/en/latest/getting_started.html\n.. _cli/index: https://hostedpi.readthedocs.io/en/latest/cli/index.html\n.. _api/index: https://hostedpi.readthedocs.io/en/latest/api/index.html\n\nDocumentation\n=============\n\nDocumentation for this module can be found at https://hostedpi.readthedocs.io/\n\nDocumentation of the API itself can be found at\nhttps://www.mythic-beasts.com/support/api/raspberry-pi\n\nContributing\n============\n\n* Source code can be found on GitHub at https://github.com/piwheels/hostedpi\n* Code and documentation contributions welcome\n* The issue tracker can be found at https://github.com/piwheels/hostedpi/issues\n* For issues with the API itself, please contact Mythic Beasts support\n  https://www.mythic-beasts.com/support\n\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "Python interface to the Mythic Beasts Hosted Pi API",
    "version": "0.4.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/piwheels/hostedpi/issues",
        "Documentation": "https://hostedpi.readthedocs.io",
        "Repository": "https://github.com/piwheels/hostedpi/issues"
    },
    "split_keywords": [
        "raspberrypi",
        " piwheels",
        " mythicbeasts",
        " hostedpi",
        " picloud"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3e1265b3059516074cda8265e2472f81bde2cfa5e0d3afa802e3332d0c60e59f",
                "md5": "518c582f649af2936d6ffeb21c715199",
                "sha256": "53c184f01f2337f7223b5cddfcfad78dc60573116ce00308e17b4bdd20f036f6"
            },
            "downloads": -1,
            "filename": "hostedpi-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "518c582f649af2936d6ffeb21c715199",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 28612,
            "upload_time": "2025-07-25T15:33:02",
            "upload_time_iso_8601": "2025-07-25T15:33:02.690189Z",
            "url": "https://files.pythonhosted.org/packages/3e/12/65b3059516074cda8265e2472f81bde2cfa5e0d3afa802e3332d0c60e59f/hostedpi-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8c4eb1814b4d54ed526196df83a0f9705acf9d17eb9c8659f3b5ff7fe47f67e7",
                "md5": "ed4fddc8d67cb8e0f08698531c37a92a",
                "sha256": "f2dbfb7815a74f67e51d3674383e0ebe93d1e7b27aae83659457e050029d7318"
            },
            "downloads": -1,
            "filename": "hostedpi-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ed4fddc8d67cb8e0f08698531c37a92a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 21530,
            "upload_time": "2025-07-25T15:33:03",
            "upload_time_iso_8601": "2025-07-25T15:33:03.883058Z",
            "url": "https://files.pythonhosted.org/packages/8c/4e/b1814b4d54ed526196df83a0f9705acf9d17eb9c8659f3b5ff7fe47f67e7/hostedpi-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 15:33:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "piwheels",
    "github_project": "hostedpi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hostedpi"
}
        
Elapsed time: 0.64779s