Metadata-Version: 2.4
Name: sitemap-tester
Version: 0.1.3
Summary: A fast CLI tool to audit sitemaps for HTTP status codes and canonical tag mismatches.
Project-URL: Homepage, https://github.com/Mayank170906/sitemap-tester
Project-URL: Repository, https://github.com/Mayank170906/sitemap-tester
Project-URL: Issues, https://github.com/Mayank170906/sitemap-tester/issues
Author-email: Mayank Choudhary <mayankchoudharysept17@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Mayank Choudhary
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: audit,canonical,cli,crawler,seo,sitemap
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Requires-Python: >=3.8
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: lxml>=5.1.0
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# Sitemap Tester 🔍

[![PyPI version](https://img.shields.io/pypi/v/sitemap-tester.svg)](https://pypi.org/project/sitemap-tester/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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.