Skip to content

cxmcc/sitemap-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sitemap

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')

About

Sitemap Library in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages