larzsitemap
Grow a sitemap.xml the way a real site actually does.
Parses what's already listed, adds only the genuinely new URLs, leaves everything else untouched - ported from a real production job that adds newly-published pages to a live sitemap.xml. Pairs with indexnow: add a URL to the sitemap, then indexnow.submit_urls() it.
larzscript pkg install sitemap
What you get
- Diffs against existing <loc> entries - no duplicates
- Idempotent - re-adding an existing URL is a no-op
- build() for a fresh sitemap from scratch
- Pairs directly with indexnow
Try it
import "sitemap" as sitemap
let xml_text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <url><loc>https://example.com/</loc></url>\n</urlset>\n"
let result = sitemap.add_urls(xml_text, ["https://example.com/", "https://example.com/blog/new-post/"], {"changefreq": "monthly", "priority": "0.7"})
print("added:", result["added"])Output
added: [https://example.com/blog/new-post/]
Why it's in the Larz Stack
larzsitemap is a real Larzscript package (larzscript pkg install sitemap) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.