Skip to main content

hostedpi

Latest Version

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     ┃ Boot Progress ┃ IPv4 SSH port ┃ IPv6 Address       ┃ Location ┃ Power ┃
┡━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━┩
│ pi345 │ 4B    │ 8 GB   │ 2.0 GHz   │ 1 Gbps    │ 50 GB     │ Powered on │ booted        │ 5381          │ 2a00:1098:8:17d::1 │ CLL      │ True  │
└───────┴───────┴────────┴───────────┴───────────┴───────────┴────────────┴───────────────┴───────────────┴────────────────────┴──────────┴───────┘

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

Release files for hostedpi 0.5.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 hostedpi 0.5.0
File Size Uploaded
hostedpi-0.5.0.tar.gz 23.4 kB Details

Built distribution (wheel)

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

Total release size: 54.2 kB

Release files / hostedpi-0.5.0.tar.gz

Download URL hostedpi-0.5.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5b5adce14fc17462ee452d755e7b506e67d335a05f4824b7c05b640c00b1ac75
BLAKE2b-256 checksum
How to use checksums
98e085e9de7e0b0900fcba829e820d946033fb9f886457511ea3cdfb09c84866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / hostedpi-0.5.0-py3-none-any.whl

Download URL hostedpi-0.5.0-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b10674e2894a87aa44fc1782efa473315c154a77c99116551e587f24ee03064
BLAKE2b-256 checksum
How to use checksums
d468fb12e028f7434eb7fa45636c27d4f847b02ff58d3a9393078df6c3bb0e65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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