How bhwthy/seo-audit-tool works
Purpose and entry points
This repository is a Python SEO-audit system for inspecting one or many public website URLs, scoring SEO health, and rendering/exporting results. Primary invocation is run_audit.py, which dispatches CLI single/batch audits or launches the local Flask dashboard. Direct library use centers on SEOAuditor in seo_audit.py.
Grounding: run_audit.py, seo_audit.py, README.md
Core audit engine
SEOAuditor is the authoritative single-page analysis pipeline. It fetches a target URL through an HTTP session, parses the returned HTML, derives technical, metadata, content, image, link, social, and structured-data findings, then combines rule-based deductions into an overall numeric score and letter grade. It also emits detailed results and summaries.
Grounding: seo_audit.py, seo_audit_example.com_20250804_152323.json
External boundary: target websites
The principal runtime boundary is outbound HTTP(S) access to arbitrary audited sites. The engine depends on response status, headers, timing, TLS/HTTPS availability, compression, HTML markup, and linked resources. This means audit completeness and latency are governed by remote-server availability, redirects, certificate behavior, and configured request timeouts/user-agent behavior.
Grounding: seo_audit.py, requirements.txt
Batch orchestration and reporting
BatchSEOAuditor coordinates independent single-site audits concurrently, aggregates individual result objects, identifies cross-site patterns, and produces comparison-oriented output. Batch URLs are supplied from a file or programmatically; results can be exported as JSON and CSV for spreadsheet or automation consumers.
Grounding: batch_seo_audit.py, sample_urls.txt, run_audit.py
Web/API delivery layer
The Flask dashboard provides browser-facing single and batch submission flows, progress/result presentation, and report download behavior. It also exposes the audit capability as an HTTP API, separating request/UI handling from the underlying audit engine and batch executor. HTML rendering is server-template based rather than a separate frontend application.
Grounding: web_dashboard.py, templates/index.html, run_audit.py
Deployment-facing API surface
A second Python HTTP entry point exists under api/, likely intended for serverless deployment. Vercel configuration, a Procfile, build script, runtime pin, and separate API dependencies indicate two hosting models: a conventional Flask process and a Vercel-compatible API deployment. Engineers should reconcile behavior/dependencies between these surfaces when changing audit endpoints.
Grounding: api/index.py, api/requirements.txt, vercel.json
Material runtime and artifacts
The system runs on Python with dependencies declared both globally and for the API deployment. It requires network egress and uses local filesystem output for generated report artifacts; checked-in example audit JSON files demonstrate the persisted report shape. Static HTML files at the repository root appear to be alternate/prototype dashboard pages, while the deployed template is under templates/.
Grounding: requirements.txt, runtime.txt, seo_audit_example.com_20250804_153508.json
Main entry points: batch_seo_audit.py BatchSEOAuditor · seo_audit.py SEOAuditor · web_dashboard.py Flask dashboard · run_audit.py CLI dispatcher
Components 17
Entry points
- CLI dispatcher · Selects single, batch, or dashboard execution.
run_audit.py - Batch URL input
sample_urls.txt
Audit engine
- SEOAuditor · Authoritative URL analysis pipeline.
seo_audit.py - HTTP session · Retrieves audited pages and response metadata.
seo_audit.py - HTML analysis · Extracts technical, metadata, content, image, link, social, and schema findings.
seo_audit.py - Score and grade · Combines findings into numeric and letter SEO health results.
seo_audit.py - BatchSEOAuditor · Runs independent audits and identifies cross-site patterns.
batch_seo_audit.py
Delivery and deployment
- Flask dashboard · Accepts audit submissions, renders progress/results, and serves downloads.
web_dashboard.py - Dashboard template
templates/index.html - Serverless API · Alternate Vercel-compatible audit endpoint.
api/index.py - Vercel deployment
vercel.json - Python runtime · Global runtime dependencies support audit execution and network access.
requirements.txt - API dependencies · Separate dependency set for the API deployment.
api/requirements.txt
Reports
- Audit result · Structured findings, score, grade, and aggregate comparisons.
seo_audit_example.com_20250804_152323.json - JSON and CSV exports · Batch results are written for automation and spreadsheet consumers.
batch_seo_audit.py - Persisted example report · Demonstrates the local filesystem report shape.
seo_audit_example.com_20250804_153508.json
Other components
- Audited websites · Remote availability, redirects, TLS, markup, and linked resources govern audit completeness.
Connections 21
- CLI dispatcher → SEOAuditor: single audit
- CLI dispatcher → BatchSEOAuditor: batch audit
- CLI dispatcher → Flask dashboard: launches
- Batch URL input → BatchSEOAuditor: URLs
- BatchSEOAuditor → SEOAuditor: concurrent audits
- SEOAuditor → HTTP session: fetches URL
- HTTP session → Audited websites: outbound HTTP(S)
- HTTP session → HTML analysis: response HTML and headers
- HTML analysis → Score and grade: findings
- Score and grade → Audit result: results and summary
- BatchSEOAuditor → JSON and CSV exports: exports JSON/CSV
- BatchSEOAuditor → Audit result: aggregates
- Flask dashboard → SEOAuditor: single submission
- Flask dashboard → BatchSEOAuditor: batch submission
- Flask dashboard → Dashboard template: renders
- Flask dashboard → JSON and CSV exports: downloads
- Serverless API → SEOAuditor: audit endpoint
- Vercel deployment → Serverless API: deploys
- Python runtime → SEOAuditor: runtime libraries
- API dependencies → Serverless API: deployment libraries
- Audit result → Persisted example report: persisted shape