How boldandbrad/fffetch works
Main Components
• Main Application/Entry Point:
– fffetch.go is the orchestrator—it initializes the process and controls the overall workflow.
• Data Fetching Module:
– The internal/pfr package contains files (data.go and html.go) responsible for web scraping and processing HTML data from Pro Football Reference.
• Data Analysis/Calculation Module:
– The internal/calc package (advStats.go and ffStats.go) performs various calculations and statistical analyses on the fetched data.
• Utility Module:
– The internal/util package provides shared helper functions (io.go and structs.go) likely used by both the data fetching and data analyzing modules.
Interactions and Data Flow
• The Main Application calls functions in the pfr module to start data fetching.
• Data fetched (raw HTML and parsed data structures) is then passed on to the calc module for advanced statistical analysis.
• Utility functions are used at various stages for tasks such as file I/O or data structure management.
Architectural Patterns and Design Principles
• Modular design: The project organizes functionality into distinct internal packages (calc, pfr, util), which helps in isolating concerns.
• A layered approach: fffetch.go acts on the top layer, coordinating lower-level modules.
• That Web Scraping techniques are used, which may hint at dependency on external data sources and an inherent asynchronous or rate-limited access pattern (as mentioned in the README).
Relevant Technologies and Frameworks
• Go Programming Language (as reflected in go.mod/go.sum and the overall codebase).
• Web Scraping: Techniques implemented in the pfr module.
• Data Analysis: Statistical calculations found in the calc module.
• Dependency management: Go modules (as indicated by go.mod), ensuring reproducibility of builds.