Skip to main content

Lib-Hal9k

The HackerLab 9000 controller library.

(Note: This project is unaffiliated with the Android Mod which goes by the name Hal9k.)

Lingo

This library is designed to provide the simplest possible API for controlling VirtualBox VMs, without any of the fancy stuff. There are only three actions we care about:

  • Starting the VM.
  • Stopping the VM.
  • Reverting the VM to the most recent snapshot.

This functionality is similar to that of a basic music player, which provides a familiar metaphor. In the language of this library, a VM is a "Track," which you can "play," "rewind," or "stop."

The Meta controller can list and retrieve tracks.

Demo

>>> from hal9k import Meta
>>> # Instantiate a Meta controller.
>>> meta = Meta()
>>> # Retrieve a track listing.
>>> meta.get_tracks()
['Debian 9.12 x64', 'MSEdge - Win10', 'Kali 2020.2 x64']
>>> # Instantiate a Track controller.
>>> track = meta.fetch('Debian 9.12 x64')
>>> # Start the track.
>>> track.play()
>>> # Check that it's running.
>>> track.status()
1
>>> # Stop the track.
>>> track.stop()
>>> # Check that it's stopped.
>>> track.status()
0
>>> # Rewind the track.
>>> track.rewind()

How it Works

The Meta.get_tracks function returns a list of the names of all VMs which have a PRODUCTION snapshot defined. The Track.rewind function restores the track's PRODUCTION snapshot. There can be only one PRODUCTION shapshot for each VM. If you decide to make a new PRODUCTION snapshot, be sure to delete the one previous. Any VMs lacking a PRODUCTION snapshot will be invisible to hal9k.

A hal9k.track.TrackException exception will be raised for Track.play and Track.rewind if the track is already playing. Likewise for Track.stop if the track is already stopped. Tracks must be stopped before using Track.play or Track.rewind, and tracks must be playing before using Track.stop.

Changelog

  • 0.7.0 :: Added hal9k.track.TrackException error handling.
  • 0.6.2 :: Updated names and language.
  • 0.6.1 :: Updated Meta.get_tracks function to list only production-ready VMs.
  • 0.6.0 :: Added rewind function to Track class.
  • 0.5.0 :: Added status function to Track class.
  • 0.4.0 :: Added stop function to Track class.
  • 0.3.0 :: Added Track class with play function.
  • 0.2.0 :: Added fetch function to Meta class.
  • 0.1.0 :: Added Meta class with get_tracks function.

Release files for Lib-HaL9k 0.7.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 Lib-HaL9k 0.7.0
File Size Uploaded
Lib-HaL9k-0.7.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Lib-HaL9k 0.7.0
File Interpreter ABI Platform
Lib_HaL9k-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / Lib-HaL9k-0.7.0.tar.gz

Download URL Lib-HaL9k-0.7.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
016c5673b9a6272b7febbf70cfe01c7f48ea7ef2e6c8302fae2fbe4119a6b77a
BLAKE2b-256 checksum
How to use checksums
3d1a262ea19c7e56420444cd8740aa664cfa9df8178b7a5b4194fe2b3b5621a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

Release files / Lib_HaL9k-0.7.0-py3-none-any.whl

Download URL Lib_HaL9k-0.7.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e15ff9164d211b5bceb4cada0eaf3566a6b4c938d6c5fd171ac61fb226faceb7
BLAKE2b-256 checksum
How to use checksums
57a95320bd2213c324ab7361ecdadee44c3e61a4deeb959817dd06f8aee8eae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.2

2 release files

0.6.1

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