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.

Files for sitemap, version 20191121
Filename, size File type Python version Upload date Hashes
Filename, size sitemap-20191121.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page