pyseoa
pyseoa
๐ Python SEO Analyzer โ CLI, Library & Web ๐ฆ
pyseoa
is a modern, threadโready Python toolkit for deepโdive SEO audits.
Use it as a library, CLI tool, or integrate with FastAPI for web apps.
๐ Features (v0.2.3)
- โ
Single & Batch Analysis
- Run SEO checks on one or multiple URLs via crawl or direct URL
- Smart internal link crawling and multithreading for performance
- โ๏ธ Feature Flags
Easily enable or disable checks via bitflags:
- Title, Meta description, H1, Image alts
- Canonical, OpenGraph, Twitter meta
- Robots.txt, Sitemap, Favicon
- Accessibility hints, Structured Data (JSONโLD), Mobile-friendliness
- Keyword density (with custom allow/deny lists)
- Hreflang, Metaโrobots, Web Vitals, AMP compliance
- ๐ Exporters
- JSON, CSV, Markdown
- Fancy HTML report with styles
- PDF (via FPDF)
- Terminal summary
- ๐ Threaded Workflow
- Multi-threaded crawling, analysis, and exporting
- Optional progress bars via
tqdm
- ๐ CLI Tool & API Support
- Run via
pyseoโanalyze
CLI:seo-analyze https://example.com --crawl --export html
- Fully importable โ works great with FastAPI, Flask, Streamlit, Dash, etc.
- Run via
โก Install
pip install pyseoa
# or, specify version:
pip install pyseoa==0.2.3
๐งพ Basic Library Example
from pyseoa import SmartBatchSEOAnalyzer
urls = ["https://example.com", "https://another.com"]
analyzer = SmartBatchSEOAnalyzer(urls, follow_links=True)
analyzer.run_batch_analysis()
# Save outputs
analyzer.exporters.json.export(analyzer.results)
analyzer.exporters.csv.export(analyzer.results)
analyzer.exporters.html.export(analyzer.results, output="report.html")
๐โโ๏ธ CLI Usage
Analyze a single site:
seo-analyze https://example.com
Batch or crawled analysis:
seo-analyze --crawl --export html urls.txt
Run seo-analyze --help
for full options list.
๐งฉ Integration with Web Apps
E.g. With FastAPI or Flask in your web project:
from fastapi import FastAPI, Form
from pyseoa import SmartBatchSEOAnalyzer
app = FastAPI()
@app.post("/analyze")
def analyze(url: str = Form(...), crawl: bool = Form(False)):
analyzer = SmartBatchSEOAnalyzer([url], follow_links=crawl)
analyzer.run_batch_analysis()
return analyzer.results
๐ง Command-Line Installer
Install via Git:
git clone https://github.com/sempre76/pyseoa.git
cd pyseoa
pip install -e .
๐ฆ Whatโs New in v0.2.x
- Dynamic internal link crawling
- Feature flags overhaul
- New exporters: Markdown, PDF, Terminal
- Multi-threaded pipelines with progress bars
- Web integration: SmartBatchAnalyzer & FastAPI-ready
๐ฅ Contributing
PRs welcome! Please check:
- Code:
pip install .
, run basic analyzers - Tests: run under example projects or use CLI
- Docs: update examples & feature flags in README
๐ License & Author
- MIT License โ see the LICENSE file
- Maintained by masem โ contact: contact@masem.at
๐ Links
- ๐ PyPI: https://pypi.org/project/pyseoa/
- ๐งช GitHub: https://github.com/masm1899/pyseoa/
- ๐ Web UI Demo: seo.masem.at (Powered by FastAPI)
- ๐ See also FastAPI companion project: masem-seo-web