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.1.tar.gz (4.2 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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sitemap_tester-0.1.1.tar.gz
Algorithm Hash digest
SHA256 303ab748cb85517df6d063e4ca9a256ec922fca6f5a4dec636f8dc9e5cf216b2
MD5 1403faefa0a8d5437e3ab34e46415d5e
BLAKE2b-256 9fdfce305462fe6bbd25f40fe01e96bd6855d8d960b6e9b2dabdcf1ef8d27880

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sitemap_tester-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71d8bad33be69174e951804d2e691edf0630e2e77d5d5016ea0ae962d644bf65
MD5 d7dad529b916130d7702ed636e2d9988
BLAKE2b-256 f84eb9d96b914d3173edd8eb6ad9f0f92b096b7b3588b9f769ce0133319ab8e4

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