Skip to main content

Vesta

Vesta is a Vestaboard client library for Python. It provides API clients and character encoding utilities.

Installation

Vesta requires Python 3.11 or later and has no other runtime dependencies. It can be installed via PyPI.

$ python -m pip install vesta

Usage

API Clients

Cloud API

CloudClient provides a client interface for interacting with a Vestaboard using the Cloud API, which supersedes the Read / Write API. It supports reading and writing messages and configuring message transitions.

Note that a Vestaboard API token is required. This token can be obtained from the Developer section of the web app.

import vesta

cloud_client = vesta.CloudClient("api_token")

# Write and read messages:
message = vesta.encode_text("{67} Hello, World {68}")
assert cloud_client.write_message(message)
assert cloud_client.read_message() == message

# Configure how new messages animate onto the board:
cloud_client.set_transition("wave", "gentle")

Subscription API

SubscriptionClient provides a client interface for interacting with multiple Vestaboards using the Subscription API.

Note that an API secret and key is required to get subscriptions or send messages. These credentials can be created from the Developer section of the web app.

Messages can be posted as either text strings or two-dimensional arrays of character codes representing the exact positions of characters on the board.

If text is specified, the lines will be centered horizontally and vertically. Character codes will be inferred for alphanumeric and punctuation characters, or they can be explicitly specified using curly braces containing the character code (such as {5} or {65}).

import vesta

subscription_client = vesta.SubscriptionClient("api_key", "api_secret")

# List subscriptions and send them messages:
subscriptions = subscription_client.get_subscriptions()
for subscription in subscriptions:
    subscription_client.send_message(subscription["id"], "{67} Hello, World {68}")

Local API

LocalClient provides a client interface for interacting with a Vestaboard over the local network using Vestaboard's Local API.

Note that Vestaboard owners must first request a Local API enablement token in order to use the Local API.

import vesta

local_client = vesta.LocalClient()

# The Vestaboard's Local API must be enabled to get its Local API key. After
# you've done this once, you can save the key somewhere safe and pass it
# directly to LocalClient() for future client initializations.
local_api_key = local_client.enable(ENABLEMENT_TOKEN)
# e.g. local_client = LocalClient(local_api_key)
assert local_client.enabled

# Once enabled, you can write and read messages:
message = vesta.encode_text("{67} Hello, World {68}")
assert local_client.write_message(message)
assert local_client.read_message() == message

VBML API

VBMLClient provides a client interface for Vestaboard's VBML (Vestaboard Markup Language) API.

import vesta

component = Component(
    "Vestaboard Markup Language",
    justify="center",
    align="center",
    width=22,
    height=6,
)

vbml_client = vesta.VBMLClient()
vesta.pprint(vbml_client.compose([component]))

Read / Write API

ReadWriteClient provides a client interface for interacting with a Vestaboard using the deprecated Read / Write API.

Vestaboard has renamed the Read / Write API to the Cloud API. This client is deprecated; switch to CloudClient, which offers the same functionality plus message transitions.

Platform Client

Client provides a client interface for interacting with the deprecated Vestaboard Platform API.

This is the original Vestaboard Platform API. It is deprecated and has been superseded by the other APIs listed above. In particular, Vestaboard encourages users of the Platform API to switch to the Subscription API, which offers nearly identical functionality.

Character Encoding

All Vestaboard characters (letters, numbers, symbols, and colors) are encoded as integer character codes. Vesta includes some useful routines for working with these character codes.

encode() encodes a string as a list of character codes. In addition to printable characters, the string can contain character code sequences inside curly braces, such as {5} or {65}.

>>> vesta.encode("{67} Hello, World {68}")
[67, 0, 8, 5, 12, 12, 15, 55, 0, 23, 15, 18, 12, 4, 0, 68]

encode_row() encodes a string as a row of character codes. It builds on encode() by providing alignment control.

>>> vesta.encode_row("{67} Hello, World {68}", align="center")
[0, 0, 0, 67, 0, 8, 5, 12, 12, 15, 55, 0, 23, 15, 18, 12, 4, 0, 68, 0, 0, 0]

encode_text() encodes a string of text into rows of character codes, further building on encode() and encode_row() with the addition of alignment, margin control, and line breaks.

>>> encode_text("multiple\nlines\nof\ntext", align="center", valign="middle")
[
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 13, 21, 12, 20, 9, 16, 12, 5, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 12, 9, 14, 5, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 5, 24, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]

Lastly, pprint() can be used to pretty-print encoded characters to the console, which can be useful during development.

>>> vesta.pprint([0, 0, 0, 67, 0, 8, 5, 12, 12, 15, 55, 0, 23, 15, 18, 12, 4, 0, 68, 0, 0, 0])
| | | |◼︎| |H|E|L|L|O|,| |W|O|R|L|D| |◼︎| | | |

Examples

License

This project is licensed under the terms of the MIT license.

Metadata

Release files for vesta 0.15.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 vesta 0.15.0
File Size Uploaded
vesta-0.15.0.tar.gz 20.4 kB Details

Built distribution (wheel)

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

Total release size: 37.4 kB

Release files / vesta-0.15.0.tar.gz

Download URL vesta-0.15.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0405a8d6096fee13bfeddcac4178bec998d1b500b120de5d9a4eee3645b108a0
BLAKE2b-256 checksum
How to use checksums
098b61d856f2835eb0fc8d9c7d02dd7d19858185160840dcfffce7a6bfa8b05e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / vesta-0.15.0-py3-none-any.whl

Download URL vesta-0.15.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9963958c704e40463c66e3cca632bd9deb90e3690634b14340121863d719dc05
BLAKE2b-256 checksum
How to use checksums
f53bb296f13917426983c9f4063d819a4939743f8bfb8088abc25e79a2a7e731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.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