New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apesmit-py2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apesmit-py2

simple Python module to create XML sitemaps

  • 0.01
  • PyPI
  • Socket score

Maintainers
1

.. -- coding: utf-8 --

THIS IS A FORK

The metadata for the Apesmit package by Florian Diesch indicates Python 3 compatibility, but it actually works fine with Python 2. This fork just removes the Python 3-only flag.

What is ApeSmit?

ApeSmit is a very simple Python module to create XML sitemaps as defined at http://www.sitemaps.org. ApeSmit doesn't contain any web spider or something like that, it just writes the data you provide to a file using the proper syntax.

Usage

First we create an instance of SiteMap:

sm=Sitemap(changefreq='weekly')

The changefreq keyword sets a default value for that parameter.

Now we add some URL's to our sitemap:

sm.add('http://www.example.com/')

We may use some parameters:

sm.add('http://www.example.com/news/', changefreq='daily', ... priority=1.0, ... lastmod='1891-1-1')

There's a shortcut for URL's that changed today:

sm.add('http://www.example.org/about.html', lastmod='today')

That's all for now. Next we need a file to write the sitemap in:

out=open('sitemap.xml', 'w')

Now we write our sitemap and then close the file:

sm.write(out) out.close()

And that's the content of our shiny new sitemap::

http://www.example.com/ weekly http://www.example.com/news/ 1891-1-1 daily 1.0 http://www.example.org/about.html 2008-04-03 weekly

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc