Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcanuy/sitemap-builder
Generate sitemaps from programmatically collected URLs.
https://github.com/marcanuy/sitemap-builder
pip python sitemap sitemap-generator
Last synced: 3 months ago
JSON representation
Generate sitemaps from programmatically collected URLs.
- Host: GitHub
- URL: https://github.com/marcanuy/sitemap-builder
- Owner: marcanuy
- License: mit
- Created: 2018-08-26T14:31:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T01:18:06.000Z (7 months ago)
- Last Synced: 2024-10-06T19:16:48.528Z (4 months ago)
- Topics: pip, python, sitemap, sitemap-generator
- Language: Python
- Homepage: https://pypi.org/project/sitemap-builder/
- Size: 43.9 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Sitemap Builder
Generate sitemaps from programmatically collected URLs.
# Features
- Adheres to Sitemap Protocal as defined at https://www.sitemaps.org/protocol.html
- Generates an index that points to compressed sitemaps files
- each generated sitemap won't have more than the allowed amount (50.000 URLs)
- jinja2 templates# Install
~~~
pip install sitemap-builder
~~~# Usage
1. Import
~~~
from sitemap import Sitemap
~~~2. Initialize
~~~
sitemap = Sitemap()
~~~3. Add urls to process them later:
~~~
sitemap.add_item("dummy-page")
sitemap.add_item("another-page")
sitemap.add_item("category/foo-bar")
~~~4. Generate sitemap index and files
~~~
sitemap.generate()
~~~# Example:
Generated files:
~~~
.
├── sitemap.xml
└── sitemaps
├── sitemap-0.xml.gz
├── sitemap-1.xml.gz
├── sitemap-2.xml.gz
└── sitemap-3.xml.gz
~~~# Development
## Crete virtualenv
~~~
virtualenv -p /usr/bin/python3.6 ~/.virtualenvs/sitemap-builder
~~~Activate it
~~~
workon sitemap-builder
make install
~~~