wpparser
This library parses Wordpress xml based exports into a simple python dictionary.
How it works
The library uses ElementTree to traverse through the export file.
Usage
import wpparser
data = wpparser.parse("./blog.wordpress.2014-09-26.xml")
>>> {"blog": {"tagline": "Tagline",...
What it returns
It returns a well formatted dict, containing the following datatypes:
Blog: The general blog information, such as tagline, site url.
Authors: A list with the different authors.
Categories: The categories in use, organized as a nested array.
Tags: A list with the different tags.
Posts: An array that contains all posts, the post object might also contain the different comments belonging to the post.
Example:
{
"blog": {
"tagline": "Tagline",
"site_url": "http://marteinn.se/blog",
"blog_url": "http://marteinn.se/blog",
"language": "en-US",
"title": "Marteinn / Blog"
},
"authors: [{
"login": "admin",
"last_name": None,
"display_name": "admin",
"email": "martin@marteinn.se",
"first_name": None}
],
"categories": [{
"parent": None,
"term_id": "3",
"name": "Action Script",
"nicename": "action-script",
"children": [{
"parent": "action-script",
"term_id": "20",
"name": "Flash related",
"nicename": "flash-related",
"children": []
}]
}],
"tags": [{
"term_id": "1",
"slug": "bash",
"name": "Bash"
}],
"posts": [{
"creator": "admin",
"excerpt": None,
"post_date_gmt": "2014-09-22 20:10:40",
"post_date": "2014-09-22 21:10:40",
"post_type": "post",
"menu_order": "0",
"guid": "http://marteinn.se/blog/?p=828",
"title": "Post Title",
"comments": [{
"date_gmt": "2014-09-24 23:08:31",
"parent": "0",
"date": "2014-09-25 00:08:31",
"id": "85929",
"user_id": "0",
"author": u"Author",
"author_email": None,
"author_ip": "111.111.111.111",
"approved": "1",
"content": u"Comment title",
"author_url": "http://example.com",
"type": "pingback"
}],
"content": "Text",
"post_parent": "0",
"post_password": None,
"status": "publish",
"description": None,
"tags": ["tag"],
"ping_status": "open",
"post_id": "1",
"link": "http://www.marteinn.se/blog/slug/",
"pub_date": "Mon, 22 Sep 2014 20:10:40 +0000",
"categories": ["category"],
"is_sticky": "0",
"post_name": "slug"
}]
}
Installation
wpparser can easily be installed through pip.
$ pip install wpparser
Contributing
Want to contribute? Awesome. Just send a pull request.
License
wpparser is released under the MIT License.
Metadata
Release files for wpparser 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wpparser-1.1.2.tar.gz | 6.5 kB | Without provenance | Details for wpparser-1.1.2.tar.gz |
Release files / wpparser-1.1.2.tar.gz
| Download URL | wpparser-1.1.2.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c295368467345fbde9ef0f26e32cf74e53735b6e1cc1f35c3d2933ff8a4d4277
|
|
BLAKE2b-256 checksum How to use checksums |
0049dc7ad78129af2c8b1f815adc1db1f60d8147f079e24ac28ad1daebb1ff8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for wpparser 1.1.2
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.