A terminal user interface (TUI) application for managing stock ticker symbols. This application allows you to add, view, edit, and delete stock ticker symbols stored in a local SQLite database.
- Interactive TUI: Navigate using arrow keys and menu selections
- Add Tickers: Add new stock ticker symbols with optional notes
- View Tickers: Display all stored ticker symbols
- Edit Tickers: Modify existing ticker symbols and notes
- Delete Tickers: Remove ticker symbols from the database
- SQLite Storage: All data is persisted in a local SQLite database
- Shell Support: Compatible with both Fish and Bash shells
- Python 3.x (with curses support)
- Fish shell (recommended) or Bash
-
Clone this repository:
git clone https://github.com/adjn/tui-example.git cd tui-example -
Ensure Python 3 is installed:
python3 --version
./stock_tracker.fish./stock_tracker.shpython3 stock_tracker.py- ↑/↓ Arrow Keys: Navigate menu options
- Enter: Select a menu option
- q: Quit the application
- View All Tickers: Display all stored ticker symbols with their IDs and notes
- Add New Ticker: Add a new ticker symbol to the database
- Edit Ticker: Modify an existing ticker symbol by its ID
- Delete Ticker: Remove a ticker symbol from the database by its ID
- Exit: Close the application
The application stores data in a SQLite database file named stocks.db in the same directory as the application. The database is created automatically on first run.
CREATE TABLE tickers (
id INTEGER PRIMARY KEY AUTOINCREMENT,
symbol TEXT NOT NULL UNIQUE,
notes TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);- Select "Add New Ticker" from the main menu
- Enter the ticker symbol (e.g., "AAPL")
- Optionally add notes (e.g., "Apple Inc.")
- Press Enter to save
- Select "View All Tickers" to see the ID of the ticker you want to edit
- Select "Edit Ticker" from the main menu
- Enter the ticker ID
- Enter the new symbol and notes
- Press Enter to save changes
- Select "View All Tickers" to see the ID of the ticker you want to delete
- Select "Delete Ticker" from the main menu
- Enter the ticker ID
- Confirm deletion by pressing 'y'
- Fish Shell: All features fully supported
- Bash Shell: All features fully supported
Both shell launchers check for Python 3 availability and provide appropriate error messages if dependencies are missing.
This is a demo project for educational purposes.