build_tools.corpus_db_viewer.app
Textual TUI application for corpus database viewer.
Provides an interactive terminal interface for browsing database tables.
Classes
Modal screen for displaying table schema information. |
|
Modal screen for export options. |
|
Modal screen showing keyboard shortcuts. |
|
A Textual app for viewing corpus database provenance records. |
Module Contents
- class build_tools.corpus_db_viewer.app.SchemaModal(schema_data, table_name)[source]
Bases:
textual.screen.ModalScreen[None]Modal screen for displaying table schema information.
Initialize schema modal.
Parameters
- schema_datadict[str, Any]
Schema information from queries.get_table_schema()
- table_namestr
Name of the table
- DEFAULT_CSS = Multiline-String
Show Value
""" SchemaModal { align: center middle; } SchemaModal > Container { width: 90%; height: 85%; border: thick $background 80%; background: $surface; } #schema-content { width: 100%; height: 1fr; overflow-y: auto; } .schema-section { margin: 1; padding: 1; border: solid $primary; } .schema-title { text-style: bold; color: $accent; } """
Default TCSS.
- schema_data
- table_name
- class build_tools.corpus_db_viewer.app.ExportModal(default_filename)[source]
Bases:
textual.screen.ModalScreen[dict[str,str]]Modal screen for export options.
Initialize export modal.
Parameters
- default_filenamestr
Default filename (without extension)
- DEFAULT_CSS = Multiline-String
Show Value
""" ExportModal { align: center middle; } ExportModal > Container { width: 60; height: auto; border: thick $background 80%; background: $surface; padding: 1 2; } ExportModal Input { margin: 1 0; } ExportModal Horizontal { height: auto; align: center middle; margin: 1 0; } """
Default TCSS.
- default_filename
- class build_tools.corpus_db_viewer.app.HelpModal(name=None, id=None, classes=None)[source]
Bases:
textual.screen.ModalScreen[None]Modal screen showing keyboard shortcuts.
Initialize the screen.
- Parameters:
- DEFAULT_CSS = Multiline-String
Show Value
""" HelpModal { align: center middle; } HelpModal > Container { width: 70; height: auto; border: thick $background 80%; background: $surface; padding: 2; } """
Default TCSS.
- class build_tools.corpus_db_viewer.app.CorpusDBViewerApp(db_path, export_dir, page_size=50)[source]
Bases:
textual.app.App[None]A Textual app for viewing corpus database provenance records.
This interactive TUI provides table browsing, schema viewing, and export functionality for SQLite databases.
Initialize the app.
Parameters
- db_pathPath
Path to SQLite database
- export_dirPath
Directory for exported files
- page_sizeint, optional
Number of rows per page, by default 50
- CSS = Multiline-String
Show Value
""" Screen { layout: horizontal; } #sidebar { width: 30; height: 100%; border-right: solid $primary; background: $boost; } #main-content { width: 1fr; height: 100%; } #table-info { height: 3; background: $boost; padding: 0 1; } #data-table-container { height: 1fr; } DataTable { height: 100%; } ListView { height: 100%; } ListItem { padding: 0 1; } .sidebar-title { text-style: bold; padding: 1; background: $primary; color: $text; } """
Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.
- BINDINGS
The default key bindings.
- db_path
- export_dir
- page_size = 50