pigs-will-fly / py-xml-sitemap-writer Goto Github PK
View Code? Open in Web Editor NEWPython3 package for writing large XML sitemaps with no external dependencies
Home Page: https://pypi.python.org/pypi/xml-sitemap-writer
License: MIT License
Python3 package for writing large XML sitemaps with no external dependencies
Home Page: https://pypi.python.org/pypi/xml-sitemap-writer
License: MIT License
https://stackoverflow.com/a/36967668
from lxml import etree
fname = "streamed.xml"
with open(fname, "w") as f, etree.xmlfile(f) as xf:
attribs = {"tag": "bagggg", "text": "att text", "published": "now"}
with xf.element("root", attribs):
xf.write("root text\n")
for i in xrange(10):
rec = etree.Element("record", id=str(i))
rec.text = "record text data"
xf.write(rec)
https://lxml.de/api/lxml.etree.xmlfile-class.html
<?xml version="1.0"?>
<root text="att text" tag="bagggg" published="now">root text
<record id="0">record text data</record>
<record id="1">record text data</record>
<record id="2">record text data</record>
<record id="3">record text data</record>
<record id="4">record text data</record>
<record id="5">record text data</record>
<record id="6">record text data</record>
<record id="7">record text data</record>
<record id="8">record text data</record>
<record id="9">record text data</record>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated at Sat, 05 Sep 2020 00:52:13 +0200-->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!--5201290 items-->
<sitemap>
<loc>https://elecena.pl/sitemap-001-search.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-002-shops.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-003-pages.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-004-datasheets.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-005-datasheets.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-006-datasheets.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-007-datasheets.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-008-datasheets.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-009-parameters.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://elecena.pl/sitemap-010-parameters.xml.gz</loc>
</sitemap>
</sitemapindex>
And sub-sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated at Sat, 05 Sep 2020 00:34:02 +0200-->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!--8 items-->
<url>
<loc>https://elecena.pl/</loc>
</url>
<url>
<loc>https://elecena.pl/about</loc>
</url>
<url>
<loc>https://elecena.pl/whats-new</loc>
</url>
<url>
<loc>https://elecena.pl/about/shops</loc>
</url>
<url>
<loc>https://elecena.pl/ads</loc>
</url>
<url>
<loc>https://elecena.pl/bot.htm</loc>
</url>
<url>
<loc>https://elecena.pl/stats</loc>
</url>
<url>
<loc>https://elecena.pl/report</loc>
</url>
</urlset>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.