Python interface to the Mythic Beasts Hosted Pi API
Project description
Python interface to the Mythic Beasts Hosted Pi API, developed by the piwheels team (Ben Nuttall and Dave Jones).
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
Usage
View the information about Pis in your account from the command line:
$ hostedpi ls
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 ┃ IPv6 Address ┃
┡━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
│ pi345 │ 4B │ 8 GB │ 2.0 GHz │ 1 Gbps │ 50 GB │ Powered on │ Yes │ 5381 │ 2a00:1098:8:17d::1 │
└───────┴───────┴────────┴───────────┴───────────┴───────────┴────────────┴──────────────────┴───────────────┴────────────────────┘
Provision a new Pi with your public key and SSH into it:
$ hostedpi create mypi --model 3 --ssh-key-path ~/.ssh/id_rsa.pub --wait
┏━━━━━━┳━━━━━━━━━━━━━┓
┃ Name ┃ Status ┃
┡━━━━━━╇━━━━━━━━━━━━━┩
│ mypi │ Provisioned │
└──────┴─────────────┘
$ 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:
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
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hostedpi-0.4.6.tar.gz.
File metadata
- Download URL: hostedpi-0.4.6.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50dbc10824b10fdfcc7ed480f2af19f887b8931068658f394409e90c55d72c0a
|
|
| MD5 |
50223391875de76cdaa687390fd7d975
|
|
| BLAKE2b-256 |
5a56c91c249d381c3ca1baa96259c79a7e4fd3aaf82d8678bd9f074a2e911010
|
File details
Details for the file hostedpi-0.4.6-py3-none-any.whl.
File metadata
- Download URL: hostedpi-0.4.6-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8047ee6b873480c60787a83dada8272343fd0e34b6df65f6e5ebfcb1a3e1564
|
|
| MD5 |
5c37d23b3170ac1a5d3ce6eb59f69490
|
|
| BLAKE2b-256 |
e20ea45c1eaa0674b509379b27c9a4c2212bee9f632f215c2ba68a349214cb1c
|