Skip to main content

A fast CLI tool to audit sitemaps for HTTP status codes and canonical tag mismatches.

Project description

Sitemap Tester 🔍

PyPI version License: MIT

A lightweight, high-speed terminal utility to audit XML sitemaps. It checks every URL for HTTP status codes, redirects, and canonical tag accuracy.

🌟 Features

  • Automated Crawling: Extracts all URLs from any standard XML sitemap.
  • Status Checker: Identifies broken links (404), server errors (500), and redirects (301/302).
  • Canonical Validation:
    • Detects missing canonical tags.
    • Flags pages with multiple canonical tags.
    • Verifies if the canonical URL matches the sitemap URL (Self-referential check).
  • Modern Tech: Built with uv, requests, and BeautifulSoup4.

📦 Installation

Install directly from PyPI:

pip install sitemap-tester

Or using uv:

uv tool install sitemap-tester

🚀 Usage

Once installed, you can run the tool from anywhere in your terminal using the sitemap-tester command:

Basic Check

sitemap-tester https://example.com/sitemap.xml

Using a Custom Tag

If your sitemap uses a tag other than <loc> for URLs, you can specify it:

sitemap-tester https://example.com/sitemap.xml --key url

📊 Example Output

🚀 Analyzing 54 URLs....

1. https://example.com/ | Status: 200 | Canonical Match: ✅
2. https://example.com/about | Status: 200 | Canonical Match: ✅
3. https://example.com/old-page | Status: 301 | Redirected to https://example.com/new-page | Canonical Match: ❌

========================================
Total status errors: 1
Total canonical errors: 1
========================================

🛠️ Development

To contribute or run locally:

  1. Clone the repo: git clone https://github.com/Mayank170906/sitemap-tester.git
  2. Install dependencies: uv sync
  3. Run tests: uv run sitemap-tester [URL]

📄 License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sitemap_tester-0.1.3.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sitemap_tester-0.1.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file sitemap_tester-0.1.3.tar.gz.

File metadata

  • Download URL: sitemap_tester-0.1.3.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for sitemap_tester-0.1.3.tar.gz
Algorithm Hash digest
SHA256 83a2fc70b6f9b224623f957a7b779ef700f74302d414df6da3d6de54bee092dd
MD5 74acaad1c9a7ddd7039b4bee35ea75e4
BLAKE2b-256 8503dad52a3652adb6c13df937dca8a9a6e7ede4c75100c2c8efe25ce4d8123a

See more details on using hashes here.

File details

Details for the file sitemap_tester-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sitemap_tester-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b8065c0d8b81e2241c2ae1b463295fcae914ed83e3bc3cbc358779d11b03b79
MD5 d591d77a5499d1a5b62ae1d28d43b2e0
BLAKE2b-256 8c090e40f21268be7aba112aa5c48e431c2d820d831e20aff8ee7156afd47e3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page