Skip to main content
# sitemap_python
A Python utility for building sitemaps.

## Usage

### Generate sitemap

```
import datetime
import sitemap.generator as generator

sitemap = generator.Sitemap()
sitemap.add("http://www.example.com",
lastmod=datetime.datetime.now(),
changefreq="monthly",
priority="1.0")
sitemap_xml = sitemap.generate()


sitemap_index = generator.Sitemap(type='sitemapindex')
sitemap_index.add("http://www.example.com/sitemap01.xml",
lastmod=datetime.datetime.now(),
sitemap_index_xml = sitemap_index.generate()
```


### Ping search engine
Currently support ping Google and Bing.

```
import sitemap.ping as ping

ping.ping("google", "http://www.example.com/sitemap.xml")
ping.ping_urls("bing", ["http://www.example.com/sitemap.xml")
```

### Push url to Baidu
Related document available [at here](http://zhanzhang.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14).

```
import sitemap.baidu as baidu
bp = baidu.BaiduPush("http://www.example.com", "<YOUR_KEY>")
bp.add("http://www.example.com/example.html")
bp.flush()
```

Metadata

Release files for sitemap_python 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sitemap_python 0.1.0
File Size Uploaded Provenance Actions
sitemap_python-0.1.0.tar.gz 2.6 kB Without provenance Details for sitemap_python-0.1.0.tar.gz

Release files / sitemap_python-0.1.0.tar.gz

Download URL sitemap_python-0.1.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
347a5521c7c205fd0cccb14b02329705f144f4c61a35150d4c69e89b55719c70
BLAKE2b-256 checksum
How to use checksums
81c05bd227e68a7f7a8f033ca0f08917da03508d1e2d117e39d8b84e49c08de5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sitemap_python 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page