Skip to main content

Python port of FlaschenTaschen display control library

Project description

FlaschenTaschen Python Client

A Python port of the FlaschenTaschen display control library for the Noisebridge FlaschenTaschen LED display.

Features

  • UDP Client: Direct communication with FlaschenTaschen displays
  • Canvas & Drawing: Pixel-level control with primitive drawing (lines, rectangles, circles)
  • Content Generators: Text, image, and video rendering to the display
  • Interactive Demos: 9+ demo animations including Conway's Game of Life, plasma effects, fractals, and more
  • CLI Tools: Command-line utilities for quick content sending
  • Multi-layer Support: 16-layer display rendering with compositing

Installation

Basic Installation

pip install flaschen-taschen-py

With Optional Dependencies

For image support:

pip install flaschen-taschen-py[image]

For video support:

pip install flaschen-taschen-py[video]

For numpy optimization (demos):

pip install flaschen-taschen-py[numpy]

For all features:

pip install flaschen-taschen-py[image,video,numpy]

Quick Start

Send Text to Display

send-text -g 45x35 -h display.local "Hello World"

Send Image

send-image -g 45x35 image.png

Send Video

send-video -g 45x35 -fps 24 video.mp4

Debug Display

ft-debugger -m fill -t 10  # Fill screen for 10 seconds

Interactive Demos

Run any of these demos:

# Classic simulations
python -m flaschen_taschen.demos.life -g 45x35 -t 30          # Conway's Game of Life
python -m flaschen_taschen.demos.maze -g 45x35 -t 30          # Procedural maze generation
python -m flaschen_taschen.demos.sierpinski -g 45x35 -t 30    # Sierpinski triangle

# Generative graphics
python -m flaschen_taschen.demos.plasma -g 45x35              # Plasma effect
python -m flaschen_taschen.demos.matrix -g 45x35              # Matrix rain
python -m flaschen_taschen.demos.firefly -g 45x35             # Wandering particles
python -m flaschen_taschen.demos.blur -g 45x35                # Blur effect

# Advanced effects
python -m flaschen_taschen.demos.fractal -g 45x35             # Mandelbrot zoom
python -m flaschen_taschen.demos.lines -g 45x35               # Animated lines
python -m flaschen_taschen.demos.random_dots -g 45x35         # Random particles
python -m flaschen_taschen.demos.hack -g 45x35                # Rotating 3D text
python -m flaschen_taschen.demos.nblogo -g 45x35              # Noisebridge logo
python -m flaschen_taschen.demos.sflogo -g 45x35              # Sequoia Fabrica logo

Common Demo Options

-g, --geometry WxH[+X+Y]   Display geometry (default: 45x35)
-h, --host HOSTNAME        Display hostname (default: localhost)
-l, --layer N              Layer number 0-15 (default: 0)
-d, --delay MS             Frame delay in milliseconds (default: 0)
-t, --timeout S            Run for N seconds then exit

Python API

Basic Example

from flaschen_taschen.client import Canvas, Color
import time

# Connect to display
canvas = Canvas(geometry="45x35", host="display.local")

# Draw and send
canvas.set_pixel(10, 10, Color.RED)
canvas.draw_rect(20, 20, 10, 10, Color.GREEN)
canvas.send()

time.sleep(1)
canvas.cleanup()

Rendering Loop

from flaschen_taschen.client import Canvas, Color

canvas = Canvas(geometry="45x35", host="display.local")

for frame in range(100):
    canvas.clear()
    # Draw frame content
    canvas.draw_circle(22, 17, frame % 10, Color.BLUE)
    canvas.send()

canvas.cleanup()

Project Structure

  • flaschen_taschen/ - Main package
    • client/ - UDP communication, Canvas, Color support
    • demos/ - Interactive demo animations
    • generators/ - Text, image, video content generators
    • cli/ - Command-line tool entry points
    • utils/ - Bitmap font and utility functions
  • tests/ - Test suite (150+ tests)
  • scripts/ - Shell script wrappers for demos

Configuration

Display Connection

from flaschen_taschen.client import Config

config = Config(
    geometry="45x35+10+5",  # Width, height, X offset, Y offset
    host="display.local",
    port=1337,
    delay=0,  # Frame delay in ms
)

Colors

from flaschen_taschen.client import Color

# Named colors
red = Color.RED
blue = Color.BLUE

# RGB values
custom = Color(255, 128, 0)  # Orange

# Hex strings
hex_color = Color.from_hex("#FF8000")

Development

Clone the repository and install with dev dependencies:

git clone https://github.com/FlaschenTaschen/ft-py.git
cd ft-py
pip install -e ".[dev,image,video,numpy]"

Run tests:

pytest

Requirements

  • Python 3.8+
  • No required external dependencies for core functionality
  • Optional: Pillow (image support), ffmpeg-python (video support), numpy (performance)

License

MIT

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flaschen_taschen_py-0.1.1.tar.gz (60.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flaschen_taschen_py-0.1.1-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file flaschen_taschen_py-0.1.1.tar.gz.

File metadata

  • Download URL: flaschen_taschen_py-0.1.1.tar.gz
  • Upload date:
  • Size: 60.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for flaschen_taschen_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6b5e561ec77110b765e82bffd35d4e8a34735ea8895eb5767bc3fcef91fc1129
MD5 63550f94ad5b993344a5aa1c6ca4e06d
BLAKE2b-256 6714a939b56d1e19aae9408f587666543cfdaf46fbd9b927bb2492f8019e80cb

See more details on using hashes here.

File details

Details for the file flaschen_taschen_py-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flaschen_taschen_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe06763b8d6dfb93ab2bd8534bf84e1684db16d906bae0022ede4df65185ec4b
MD5 17ae9c041e6dfe6e20112ae785ca7fce
BLAKE2b-256 4e33da6eb4a77c14de191dc2ab4217f7543d467fc4f4860c269ac6731d871daf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page