Create easily Star Trek influenced LCARS user interfaces
Project description
PyLCARS
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
- Install Python 3.8+ from python.org
- Install PyAudio and PyQt5:
pip install PyQt5 pylcars
For audio support, usepipwin: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
- Usage Guide - Complete usage documentation with examples
- Architecture - System design and internal structure
- Contributing - Development guidelines
- Changelog - Version history and updates
๐ฎ 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()beforeapp.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02863fd9cfb24bbf29d62f75bf3177b1a7f88c360c782d89a566a6854880262f
|
|
| MD5 |
6c8698918702b6562ffa9dec2f364119
|
|
| BLAKE2b-256 |
f9d38944543b074d745922f0efa031e28b02f5b9a1ac37938ccdf657ea16fe12
|
Provenance
The following attestation bundles were made for pylcars-0.1.0.tar.gz:
Publisher:
publish.yml on StowasserH/pylcars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylcars-0.1.0.tar.gz -
Subject digest:
02863fd9cfb24bbf29d62f75bf3177b1a7f88c360c782d89a566a6854880262f - Sigstore transparency entry: 1191556833
- Sigstore integration time:
-
Permalink:
StowasserH/pylcars@c22bfbdc98af6aa8a64e410dd00ab25a6dacdb18 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/StowasserH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c22bfbdc98af6aa8a64e410dd00ab25a6dacdb18 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8080c8ae4fda89116794f5a7693825fea48c0740cb3cbef1c0d44dd2ad6eebea
|
|
| MD5 |
ee4f4217d88bc980a59d370a618b8b4f
|
|
| BLAKE2b-256 |
3e1e6efe34b24c5a8c4952da4cbc0b62793794ce2676976c5edca79b5c3f5587
|
Provenance
The following attestation bundles were made for pylcars-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on StowasserH/pylcars
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylcars-0.1.0-py3-none-any.whl -
Subject digest:
8080c8ae4fda89116794f5a7693825fea48c0740cb3cbef1c0d44dd2ad6eebea - Sigstore transparency entry: 1191556834
- Sigstore integration time:
-
Permalink:
StowasserH/pylcars@c22bfbdc98af6aa8a64e410dd00ab25a6dacdb18 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/StowasserH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c22bfbdc98af6aa8a64e410dd00ab25a6dacdb18 -
Trigger Event:
workflow_dispatch
-
Statement type: