Sitemap library
Project description
Sitemap library for dynamically generating sitemap.xml
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')
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-20191121.tar.gz
(2.3 kB
view hashes)