Skip to content

Python library and command line interface to the Mythic Beasts Hosted Pi API

License

Notifications You must be signed in to change notification settings

piwheels/hostedpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 a Pi from the command line:

$ hostedpi show mypi
Name: mypi
Provision status: live
Model: Raspberry Pi 3B
Disk size: 10GB
Power: on
IPv6 address: 2a00:1098:8:5b::1
IPv6 network: 2a00:1098:8:5b00::/56
Initialised keys: yes
SSH keys: 4
IPv4 SSH port: 5091
Location: MER
URLs:
  http://www.mypi.hostedpi.com
  https://www.mypi.hostedpi.com
SSH commands:
  ssh -p 5091 [email protected]  #IPv4
  ssh root@[2a00:1098:8:5b::1]  #IPv6

Provision a new Pi and view its SSH command (using Python):

>>> from hostedpi import PiCloud
>>> api_id = '8t29hvcux5g9vud8'
>>> secret = 'QNwsvxZY8SxT3OiLt:Vmz-D1mWQuoZ'
>>> cloud = PiCloud(api_id, secret, ssh_key_path='/home/ben/.ssh/id_rsa.pub')
>>> pi = cloud.create_pi('mypi')
>>> print(pi.ssh_command)
ssh -p 5123 [email protected]

See the getting started page for information on how to authenticate, and see the command line interface page for information on using the command line interface.

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