Skip to content

Architecture

cbabil edited this page Jul 30, 2025 · 3 revisions

Architecture

This page provides an overview of the project's architecture and folder structure.

Folder Structure

The project uses a src layout, which separates the source code from other files in the repository.

  • .github/: This directory contains GitHub-specific files, such as workflow definitions.
  • .gitignore: This file tells Git which files to ignore when committing.
  • .pre-commit-config.yaml: This file configures the pre-commit hooks.
  • LICENSE: This file contains the license for the project.
  • README.md: This file provides a general overview of the project.
  • SECURITY.md: This file provides information about the project's security policy.
  • pyproject.toml: This file contains the configuration for the project's development tools, such as black, isort, and flake8.
  • requirements.txt: This file lists the Python packages that are required to run the project.
  • setup.py: This file is used to install the project.
  • src/: This directory contains the source code for the project.
    • speedtest/: This is the main package for the project.
      • __main__.py: This file contains the main entry point for the script.
      • config.py: This file contains the configuration for the script.
      • lib/: This directory contains the core logic for the script.
        • schemas.py: This file contains the functions for working with JSON schemas.
        • speedtest.py: This file contains the functions for running the speedtest and validating the output.
        • templates.py: This file contains the functions for working with templates.
      • schemas/: This directory contains the JSON schemas.
      • templates/: This directory contains the templates.
      • tests/: This directory contains the tests for the project.

High-Level Architecture

The script is designed to be modular and extensible. The core logic is separated from the command-line interface, which makes it easy to reuse the code in other projects.

The script follows these steps:

  1. Parse the command-line arguments.
  2. Run the speedtest CLI tool.
  3. Validate the JSON output against a schema.
  4. Format the data using a template.

Clone this wiki locally