How martimy/bat-q works
Project type and purpose
• Bat-Q is a Streamlit-based web application for interactive network configuration analysis.
• It leverages the Batfish network analysis engine (running in a Docker container) via the pyBatfish API.
File structure
• Home.py
• Entry point: sets up the Streamlit app, navigation menu, and dispatches to individual pages.
• pages/
• 1_Questions.py, 2_Analysis.py, 3_Fail_Tests.py, 4_Differential.py
• Each module implements one Streamlit “page” of the wizard (question selection, result display, failure simulation, comparative analysis).
• pages/common/
• plotting.py – topology and data visualization helpers
• presenter.py – transforms raw query answers into tables/plots
• queries.py – wrappers around pyBatfish question calls
• questions.py – metadata and grouping of available Batfish questions
• reader.py – handles snapshot .zip ingestion and Batfish snapshot creation
• utils.py – shared utility functions (file I/O, environment variable lookup, error handling)
• pics/
• Static screenshots used in the README (not part of runtime flow)
• requirements.txt
• Lists Streamlit, pyBatfish (pinned to a compatible version), and other Python dependencies
• .gitignore, LICENSE, README.md
README for additional insights
• Architecture is not explicitly diagrammed, but the narrative describes five main user flows (upload/home, questions, analysis, failure tests, differential).
• Underlying pattern: a single-process Streamlit app that orchestrates pyBatfish queries against a remote or local Docker–hosted Batfish server.
• Data flows: user → Streamlit UI → common.reader → pyBatfish → Batfish server → common.presenter/plotting → Streamlit UI.