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.0.tar.gz (22.1 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.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flaschen_taschen_py-0.1.0.tar.gz
  • Upload date:
  • Size: 22.1 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.0.tar.gz
Algorithm Hash digest
SHA256 5b927e078464fa725b39fe34a1361e8135c22d92bd2b1cebd9db814a91e856c3
MD5 37fe59028db7601f77f012e4d2b782f4
BLAKE2b-256 f5b2d1b1a89c6bc9da0988d87a108beedd271f8ddbece4714df9080a3613fc62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flaschen_taschen_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00cc44381c0ed3dab49f95fae8341ee9731263703243565b9ace30faf1c0104d
MD5 babd583b5f733651d907355514a20bb1
BLAKE2b-256 350dc29017dbcc8e401d2e5b1f92579732f49e37e423b6f2ad6c93e1b0a40170

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