How rudra370/lazy_csv_viewer works
Project Type and Purpose
• This is a standalone desktop GUI application (“Lazy CSV Viewer”) built in Python using the Tkinter toolkit.
• Purpose: Efficiently load and page through large CSV files, with support for custom delimiters, adjustable page sizes, and column management.
High-Level Architectural Layers
• Presentation/UI Layer (Tkinter widgets)
• Application Logic Layer (pagination controller, column manager, navigation handler)
• Data Access Layer (CSV file reader/loader)
• (Optional) Packaging Layer (PyInstaller)
Main Components
a. UI Components
• Main Window
• Menu/Button Bar (Open CSV, Delimiter dropdown, Page Size input, Show/Hide Columns, Expand/Collapse Columns)
• Table/Grid View (display rows)
• Navigation Controls (Previous/Next Page buttons, keyboard shortcuts)
b. Controllers / Business Logic
• CSVLoader Module – opens file, reads only current page chunk
• PaginationController – tracks current page, page size, next/previous logic
• ColumnManager – maintains column visibility & width state
• NavigationHandler – maps button clicks and keyboard events to controller methods
c. Data Store
d. External/Platform Services
• Python Runtime (3.6+)
• Tkinter library
• (For distribution) PyInstaller bundler
Relationships and Data Flow
• User action → Tkinter Widget Event → NavigationHandler or ColumnManager → calls PaginationController → invokes CSVLoader to fetch data → returns row data → Table View updates
• Delimiter change or page-size update triggers Application Logic Layer to recalculate pages
• /Hide/Expand columns modifies Table View configuration
• Packaging step is orthogonal: takes main.py + dependencies → PyInstaller → standalone executable
Architectural Patterns / Principles
• Layered Architecture:
• UI layer is decoupled from file I/O.
• Single Responsibility: each module (loader, pagination, UI components) handles one concern.
• “Lazy Loading” / Pagination Pattern: only load needed rows from disk, minimizing memory usage.
• Event-Driven GUI: user events drive state changes.