Skip to content

dblarons/pysitemap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySitemap

A Python library for generating a sitemap

Latest Version

The latest version of this project (without the image or mobile extensions) can be found at http://github.com/vitalvas/pysitemap.

The latest version of my fork is available at https://github.com/midnightdev/pysitemap

Installation

To get the full extension, you need to download the source.

To install pysitemap without the image or video extensions, use pip.

  • Option 1 : Install via pip ::
pip install pysitemap
  • Option 2 : If you have downloaded the source ::
python setup.py install

Documentation

Basic use

from pysitemap import SiteMap
from datetime import datetime

site = SiteMap()
site.add(
	loc='http://example.com/webhp', 
	lastmod=datetime.now(), 
	changefreq='weekly',
	priority=0.5
)

print site.to_string()

Image Extension

from pysitemap import SiteMap
from datetime import datetime

image_site = SiteMap(domain='http://example.com')
image_site.add(
    loc='http://example.com/webhp',
    image_loc='http://example.com/webhp/my_image.png',
    caption='This is a caption',
    geo_location='London, England',
    image_title='Awesome Image',
    license='http://example.com/license.txt'
)

print image_site.to_string()

How to produce a Sitemap for a mobile site:

Mobile Extension

mobile_site = SiteMap(domain='http://m.example.com', mobile=True)

Reporting Bugs

Please report the bugs at github issue tracker. https://github.com/vitalvas/pysitemap/issues

Author

VitalVas source@vitalvas.com

Vitaliy Vasilenko

Extension Author

dblarons aaron.h.smith@vanderbilt.edu

Aaron Smith

About

Mobile and image extensions for the pysitemap library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%