A TUI application I built with textual for TerminalCraft for making graphs from CSV spreadsheets, and rendering stock graphs, aswell as electronic graphs (555, RC)
- RC filter analysis: Calculate transient response for Resistor-capacitor circuits
- 555 timer circuits:
- Astable mode (oscillating) frequency calculations
- Monostable mode (one shot) pulse width calculations
- Resistor color code calculator: Convert between resistance values and color bands. (don't worry about the gap in the middle)
- Ohm's law calculator: Solves for voltage, current, resistance or power.
- Real market data π€―: Retrieves OHLC data (thanks to Yahoo Finance)
- Stock charts: Candlestick for render, area for preview.
- Technical indicators: Basic statistics and market indicators
- Ticker search: Search for stocks by ticker symbol or company name (Tesla, Nvidia, NVDA)
- Multi-format plotting:
- Line, bar, area, scatter, and pie charts
- Support for single and multi-series exports (pie charts only)
- Interactive plot rendering: Real-time visualization with Textual's plotext
- Export to PNG: Save charts in PNG format (1500x750)
- Persistence: Autosaves data and position when quitting (spreadsheet data, electronic resistor values, etc)
- Custom themes: Is compatible with any textual theme
- Python 3.14+ (older may work)
- pip (Python package manager, obviously)
-
git clone or download the repository:
cd GrafTUI -
install required dependencies:
pip install -r requirements.txt
-
run the python file:
python main.py
Use the navigation bar at the top to switch between modules:
- MARKETS: Stock market analysis and charting
- ELECTRONICS: Circuit simulators and calculators
- DATA VIEW: Custom data import and plotting
- Enter a stock ticker (e.g.,
AAPL,GOOGL) - Select time period and interval (auto-adjusted for accuracy)
- View candlestick chart with OHLC data
- Export chart as PNG or view market statistics
- RC Filter: Enter resistance and capacitance values
- 555 Timer: Calculate frequency or pulse width based on resistor/capacitor values
- Resistor Color: Input resistance value or click on color bands
- Ohm's Law: Enter ANY two electrical values to solve for the rest
- Import CSV: Load data from CSV files with transpose detection
- Plot Data: Choose from line, bar, area, scatter, or pie chart types
- Multi-Series: Plot multiple data series with combined or separate exports
- Export: Save visualizations as high-resolution PNG files
Tab: Navigate between elementsEnter: Confirm/Execute actionEsc: Close modals and dialogs- Arrow keys: Navigate lists and selections
GrafTUI/
βββ main.py # Main app.
βββ views.py # UI components
βββ fin_controller.py # Financial data fetching and logic
βββ sim_controller.py # Electronic calculations
βββ tools_views.py # Resistor calc and Ohm's law calc UI
βββ exporter.py # Chart exporting, using matplotlib
βββ financial_manager.py # Yahoo finance api integrating
βββ fin_indicators.py # Basic analysis indicators
βββ config_manager.py # User preferences manager
βββ workspace_manager.py # Persistence manager
βββ file_manager.py # File picker/saver
βββ statistics_engine.py # Data calculations
βββ app_styles.tcss # Textual CSS styling
βββ requirements.txt # Python dependencies
βββ README.md # What you're currently looking at
tly looking at
The application follows a Model-view-controller architecture
- Models:
financial_manager.py,fin_indicators.py,sim_controller.py - Views:
views.py,tools_views.py,file_manager.py - Controllers:
fin_controller.py,sim_controller.py(hybrid) - Managers: Config, workspace, and file management utilities
Performance heavy libraries like matplotlib or yfinance are only imported when needed to minimize startup latency.
Data fetching was threaded to keep the UI responsive (UI would lock up, if not threaded.)
- textual - Main TUI framework
- textual-plotext - Plotext integration for textual
-
matplotlib - Chart generating and exporting
-
numpy - Numerical calculations
-
yfinance - Yahoo Finance data fetching and processing
-
pandas - Data manipulation (implied by yfinance)
-
requests - HTTP client for ticker search and fetching
This project is licensed under the MIT License - see LICENSE file for details.
Developed for TerminalCraft YSWS using Textual & Python β€οΈοΏ½οΈ