Skip to main content

sitemapr

sitemapr is a Python library designed to generate and save sitemaps for websites. It allows for the creation of detailed sitemaps with customizable parameters, making it easier for search engines to crawl and index web pages efficiently.

Features

  • Generate sitemaps with dynamic URL parameters.
  • Split large sitemaps into chunks to comply with sitemap index specifications.
  • Customizable base URLs for sitemaps and websites.

Installation

SiteMapr can be easily installed using pip. Ensure you have pip installed and run the following command:

pip install sitemapr

This command will download and install SiteMapr along with its dependencies.

Quick Start

Here's how to quickly generate a sitemap for your website using SiteMapr:

  1. Define Your Pages: First, define the pages you want to include in your sitemap, including any dynamic path or query parameters.

  2. Create a SiteMapr Instance: Initialize SiteMapr with your website's base URL and the pages you've defined.

  3. Save Your Sitemap: Choose a directory and save your sitemap, specifying chunk sizes if needed.

Example

from sitemapr import Page, Param, SiteMapr

# Define the pages of your site
pages = [
    Page(
        path="",
        query_params=[
            Param(name="page", values=["home", "about", "contact"]),
            Param(name="sort", values=["asc", "desc"]),
        ],
    ),
    Page(
        path="/blog",
        query_params=[
            Param(name="page", values=["1", "2", "3"]),
            Param(name="sort", values=["asc", "desc"]),
        ],
    ),
    Page(
        path="/blog/{id}",
        path_params=[Param(name="id", values=["1", "2", "3"])],
    ),
]

# Initialize SiteMapr with your website's base URL and the defined pages
sitemapr = SiteMapr(base_url="https://example.com", pages=pages)

# Save the sitemap to the specified directory
sitemapr.save("/path/to/your/sitemap/directory")

License

sitemapr is released under the MIT License. See the LICENSE file for more details.

Metadata

Release files for sitemapr 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sitemapr 0.1.0
File Size Uploaded
sitemapr-0.1.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sitemapr 0.1.0
File Interpreter ABI Platform
sitemapr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / sitemapr-0.1.0.tar.gz

Download URL sitemapr-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5ba6589f1b5628523fb2501316d166007c1b01c8b7857862d94a956e06829d5f
BLAKE2b-256 checksum
How to use checksums
fc0005448a4ab4f302c6f92cb03ec28c35e44e63ec07707fd0249a15ea363f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure

Release files / sitemapr-0.1.0-py3-none-any.whl

Download URL sitemapr-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa0cea2c22e552b29adab5bdcda7d2415083db2baa7f068639bb46094d4dcce2
BLAKE2b-256 checksum
How to use checksums
050f7b3a405d19e26047f5162a4bbb77809dae8e8b6308acd4b3e901d8545189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page