🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

sitemap

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemap

Sitemap library

20191121
Maintainers
1

sitemap

Sitemap library for dynamically generating sitemap.xml

.. image:: https://img.shields.io/pypi/v/sitemap.svg :target: https://pypi.python.org/pypi/sitemap

Installation

.. code:: bash

pip install sitemap

Usage

Urlset ^^^^^^

.. code:: python

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 ^^^^^^^^^

.. code:: python

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

Keywords

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts