Skip to main content

Create easily Star Trek influenced LCARS user interfaces

Project description

PyLCARS

Tests License: MIT Python 3.8+ Version 0.1.0

Create Star Trek LCARS-inspired user interfaces with Python and PyQt5.

PyLCARS is a Python library that brings the iconic LCARS (Library Computer Access and Retrieval System) aesthetic from Star Trek to modern applications. Build retro-futuristic UIs with pre-styled widgets, smooth animations, SVG rendering, and integrated audio feedback.

๐Ÿš€ Quick Start

from PyQt5 import QtWidgets
from pylcars import Lcars, Bracket, Colors

app = QtWidgets.QApplication([])
window = Lcars()

button = Bracket(window.centralwidget)
button.setText("ENGAGE")
button.set_color(Colors.orange)
button.setGeometry(300, 200, 200, 50)

window.show()
app.exec_()

โœจ Features

  • ๐ŸŽจ LCARS-themed Widgets - Pre-styled UI components matching the Star Trek aesthetic
  • ๐Ÿ–ผ๏ธ SVG Support - Dynamic vector graphics with automatic caching
  • ๐Ÿ”Š Audio Integration - Built-in WAV file playback with PyAudio
  • โšก Animation Effects - Visual feedback including "tickle" highlighting
  • ๐ŸŽฏ Type-Safe - Full type hints for IDE support and static analysis
  • ๐Ÿ“š Well-Documented - Comprehensive docstrings and usage guides
  • โœ… Tested - Pytest suite with GitHub Actions CI/CD
  • ๐Ÿ”ง Customizable - Easy theming and configuration
  • ๐Ÿ“ฆ Modern Python - Pure Python 3.8+ with minimal dependencies

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.8 or higher
  • PyQt5
  • PortAudio (for audio support)

Ubuntu/Debian

sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-pyqt5 portaudio19-dev

pip install pylcars

macOS

brew install python3 portaudio
pip install PyQt5 pylcars

Windows

  1. Install Python 3.8+ from python.org
  2. Install PyAudio and PyQt5:
    pip install PyQt5 pylcars
    
    For audio support, use pipwin:
    pip install pipwin
    pipwin install portaudio
    pip install pyaudio
    

From Source

git clone https://github.com/StowasserH/pylcars.git
cd pylcars
pip install -e .

๐Ÿ“– Documentation

๐ŸŽฎ Demo Applications

Try the included examples:

# Interactive widget showcase
python -m pylcars.demos.menu

# Color palette display
python -m pylcars.demos.colors_showcase

# All widgets in one place
python -m pylcars.demos.widgets_showcase

# Custom theme example
python -m pylcars.demos.custom_theme

# Minimal "Hello LCARS" window
python -m pylcars.demos.simple_window

# Audio playback grid
python -m pylcars.demos.sounds

๐Ÿงฉ Available Widgets

Widget Purpose Example
Bracket Clickable button with corner styling Bracket(window.centralwidget).setText("CLICK")
Block Simple colored rectangle Block(window.centralwidget).set_color(Colors.orange)
Deco Decorative label with SVG Deco(window.centralwidget).setText("Title")
Separator Directional divider line Separator(window.centralwidget).setOrientation(Orientation.right)
Slider Interactive value slider Slider(window.centralwidget).setRange(0, 100)
Textline Text label with color Textline(window.centralwidget).setText("Status")
Updown Navigation buttons with center Updown(window.centralwidget).setGeometry(...)
Menue Multi-page menu system Menue(window.centralwidget).add_page(...)
Semicircle Rounded corner decoration Semicircle(window.centralwidget).setOrientation(...)
Lcars Main window class window = Lcars()

๐ŸŽจ LCARS Color Palette

from pylcars import Colors

Colors.orange        # #f90 - Primary LCARS orange
Colors.flieder       # #c9c - Light purple
Colors.blaugrau      # #99c - Blue-gray
Colors.rostbraun     # #c66 - Rust brown
Colors.beige         # #fc9 - Beige
Colors.leuchtblau    # #99f - Bright blue
Colors.apricot       # #f96 - Apricot
Colors.pink          # #c69 - Pink
Colors.hellorange    # #fc4 - Bright orange
Colors.rot           # #c00 - Red

Or use any hex color:

widget.set_color("#00ff00")  # Any hex value

๐Ÿ“ Fonts and Media

Note on Copyrighted Content: The LCARS font and Star Trek sounds are not included with PyLCARS for copyright reasons. However, many beautiful fonts and sound effects from the Star Trek films and TV series are available from fan communities and archives online.

You can find Star Trek-themed fonts and sounds by searching:

  • GitHub for "LCARS font" and "Star Trek fonts" repositories
  • Star Trek fan communities and forums
  • General font archives with Star Trek collections

Once you have the LCARS font file (.ttf), install it to ~/.local/share/fonts/ and run fc-cache -f ~/.local/share/fonts/. See USAGE.md for detailed font installation instructions.

๐Ÿ’ป Complete Example

from PyQt5 import QtWidgets
from pylcars import Lcars, Bracket, Slider, Textline, Colors

class MyApp:
    def __init__(self):
        self.app = QtWidgets.QApplication([])
        self.window = Lcars()
        self.window.setWindowTitle("My LCARS App")
        self.setup_widgets()

    def setup_widgets(self):
        central = self.window.centralwidget

        # Title
        title = Textline(central)
        title.setText("CONTROL PANEL")
        title.set_color(Colors.leuchtblau)
        title.setGeometry(50, 20, 700, 40)

        # Power slider
        label = Textline(central)
        label.setText("Power:")
        label.set_color(Colors.beige)
        label.setGeometry(50, 80, 100, 30)

        slider = Slider(central)
        slider.set_color(Colors.orange)
        slider.setRange(0, 100)
        slider.setGeometry(160, 80, 400, 40)
        slider.valueChanged.connect(self.on_power_changed)

        # Power value display
        self.power_display = Textline(central)
        self.power_display.set_color(Colors.hellorange)
        self.power_display.setGeometry(570, 80, 100, 30)

        # Control button
        button = Bracket(central)
        button.setText("ACTIVATE")
        button.set_color(Colors.orange)
        button.setGeometry(50, 150, 150, 50)
        button.clicked.connect(self.on_activate)

    def on_power_changed(self, value):
        self.power_display.setText(f"{value}%")

    def on_activate(self):
        print("Activated!")
        self.power_display.tickle(Colors.orange)

    def run(self):
        self.window.show()
        self.app.exec_()

if __name__ == "__main__":
    MyApp().run()

๐Ÿ”Š Audio Support

from pylcars import Lcars

window = Lcars()
window.set_play_sound(True)
window.set_sound_file("path/to/sound.wav")
window.play_sound()

Connect audio to button clicks:

button = Bracket(window.centralwidget)
button.clicked.connect(lambda: window.play_sound())

๐Ÿ—๏ธ Project Structure

pylcars/
โ”œโ”€โ”€ __init__.py              # Package exports
โ”œโ”€โ”€ lcars.py                 # Main window class
โ”œโ”€โ”€ sound.py                 # Audio playback
โ”œโ”€โ”€ colors.py                # LCARS color palette
โ”œโ”€โ”€ conditions.py            # Status conditions
โ”œโ”€โ”€ enumeration.py           # Base enumeration
โ”œโ”€โ”€ orientation.py           # Direction constants
โ”œโ”€โ”€ config.py                # Configuration constants
โ”œโ”€โ”€ widgets/                 # Widget components
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ widgets.py           # Base widget class
โ”‚   โ”œโ”€โ”€ bracket.py           # Button widget
โ”‚   โ”œโ”€โ”€ block.py             # Rectangle widget
โ”‚   โ”œโ”€โ”€ deco.py              # Decorative label
โ”‚   โ”œโ”€โ”€ separator.py         # Divider widget
โ”‚   โ”œโ”€โ”€ slider.py            # Slider control
โ”‚   โ”œโ”€โ”€ textline.py          # Text label
โ”‚   โ”œโ”€โ”€ updown.py            # Navigation control
โ”‚   โ”œโ”€โ”€ menue.py             # Menu system
โ”‚   โ””โ”€โ”€ semicircle.py        # Rounded bracket
โ””โ”€โ”€ demos/                   # Example applications
    โ”œโ”€โ”€ simple_window.py     # Minimal example
    โ”œโ”€โ”€ colors_showcase.py   # Color palette
    โ”œโ”€โ”€ widgets_showcase.py  # All widgets
    โ”œโ”€โ”€ custom_theme.py      # Custom styling
    โ”œโ”€โ”€ menu.py              # Interactive demo
    โ””โ”€โ”€ sounds.py            # Audio demo

See ARCHITECTURE.md for detailed system design.

๐Ÿงช Development

Setting Up for Development

# Clone and install
git clone https://github.com/StowasserH/pylcars.git
cd pylcars

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install with development dependencies
pip install -e ".[dev]"

Running Tests

# Run all tests
pytest tests/ -v

# With coverage
pytest tests/ --cov=pylcars --cov-report=term-missing

# Type checking
mypy pylcars/

# Code style
flake8 pylcars/

Code Quality Standards

  • Type Hints: All functions must have parameter and return type hints
  • Docstrings: Google-style docstrings for all public APIs
  • Testing: New features should include tests
  • Style: PEP 8 compliance (100 char line length)
  • Coverage: Aim for >70% code coverage

๐Ÿ› Troubleshooting

Audio not working

  • Ensure PortAudio is installed: sudo apt-get install portaudio19-dev
  • Test PyAudio: python -c "import pyaudio; print(pyaudio.__version__)"

PyQt5 import errors

  • Reinstall: pip install --upgrade PyQt5
  • Or use system package: sudo apt-get install python3-pyqt5

Window won't display

  • Ensure you call window.show() before app.exec_()
  • Check that widgets have explicit .setGeometry() calls

Widgets invisible

  • All widgets need explicit positioning: widget.setGeometry(x, y, w, h)
  • Default size is 0, so they won't appear without geometry

๐Ÿ“š Learning Resources

  • USAGE.md - Comprehensive usage guide with code examples
  • ARCHITECTURE.md - Design documentation and system architecture
  • CONTRIBUTING.md - Development guidelines
  • pylcars/demos/ - Working example applications
  • Docstrings in source code - Class and method documentation

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for:

  • Development setup
  • Code style guidelines
  • Testing requirements
  • Pull request process

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Star Trek - For the iconic LCARS aesthetic
  • PyQt5 - The GUI framework that makes this possible
  • Contributors - Everyone who has contributed to this project

๐Ÿ”— Links

๐ŸŽฏ Project Status

Aspect Status
Development โœ… Active
Version 0.1.0
Python Support 3.8, 3.9, 3.10, 3.11, 3.12
Tests โœ… Passing
Documentation โœ… Complete
Type Hints โœ… 100%
CI/CD โœ… GitHub Actions

๐Ÿ“‹ Roadmap

  • More widget types (progress bars, indicators)
  • Advanced animations and transitions
  • Theme system with loadable theme files
  • Extended audio format support
  • Performance optimizations
  • PyPI publishing
  • More demo applications
  • Video tutorials

Ready to build something legendary? Start with the Usage Guide! ๐Ÿš€

May your interfaces be bold and your colors be vivid! ๐Ÿ––

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

pylcars-0.1.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

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

pylcars-0.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylcars-0.1.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylcars-0.1.0.tar.gz
Algorithm Hash digest
SHA256 02863fd9cfb24bbf29d62f75bf3177b1a7f88c360c782d89a566a6854880262f
MD5 6c8698918702b6562ffa9dec2f364119
BLAKE2b-256 f9d38944543b074d745922f0efa031e28b02f5b9a1ac37938ccdf657ea16fe12

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylcars-0.1.0.tar.gz:

Publisher: publish.yml on StowasserH/pylcars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pylcars-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylcars-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8080c8ae4fda89116794f5a7693825fea48c0740cb3cbef1c0d44dd2ad6eebea
MD5 ee4f4217d88bc980a59d370a618b8b4f
BLAKE2b-256 3e1e6efe34b24c5a8c4952da4cbc0b62793794ce2676976c5edca79b5c3f5587

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylcars-0.1.0-py3-none-any.whl:

Publisher: publish.yml on StowasserH/pylcars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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