Skip to main content

Sitemap library

Project description

Sitemap library for dynamically generating sitemap.xml

https://img.shields.io/pypi/v/sitemap.svg

Installation

pip install sitemap

Usage

Urlset

from sitemap import Url, Urlset

urlset = Urlset()
url = Url('https://www.example.com/', changefreq='weekly')

urlset.add_url(url)

# urlset.to_string()
urlset.write_xml('sitemap.xml')

Siteindex

from sitemap import Sitemap, Siteindex

siteindex = Siteindex()
sitemap = Sitemap('https://www.example.com/sitemap.xml')

siteindex.add_sitemap(sitemap)

# siteindex.to_string()
siteindex.write_xml('sitemap.xml')

Download files

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

Source Distribution

sitemap-20191121.tar.gz (2.3 kB view hashes)

Uploaded source

Supported by

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