Skip to main content

Converter for WordPress eXport RSS (WXR) files into Markdown files

Project description

wxr2md - Convert WXR Files into Markdown

Convert WordPress exPort RSS (WXR) files to Markdown files with YAML frontmatter.

Installation

Install using pip,

pip install wxr2md

Usage

usage: wxr2md [-h] [--output OUTPUT] [--no-frontmatter] [--title-in-body] [--date-in-body] input

Convert WordPress eXport RSS (WXR) into Markdown files

positional arguments:
  input             path to the WXR file to be converted

options:
  -h, --help        show this help message and exit
  --output OUTPUT   output directory, defaults to 'out/' in the current working directory
  --no-frontmatter  don't add YAML frontmatter to the markdown file
  --title-in-body   add title in the markdown body as an h1 element
  --date-in-body    print date at the start of the markdown body

Output

By default, the script will output to out/ folder in the current working directory.

The markdown file output is as follows. The frontmatter mostly follows the frontmatter properties of Hugo, except for id.

---
id: 1
title: Hello, world!
type: post
date: 1970-01-01 12:34:56
lastmod: 1980-02-02 01:02:03
categories:
  - a category
  - another category
tags:
  - my tag
  - your tag
draft: true
---

# Hello, world! <!-- If passing in --title-in-body argument -->

_Mon 01 Jan 1970, 12:34_ <!-- If passing in --date-in-body argument -->

This is the content of the blog post. Perhaps there are a few sentences here.

Limitations:

  • only tested with WXR version 1.2 and a limited set of exports, so might not be compatible for all WXR files
  • date and lastmod is in local timezone and does not include timezone data
  • blog information is not outputed anywhere (e.g. description, url, etc.)
  • no option to customise the output file names and folder structures

Building

This package uses poetry for dependency management and packaging. See their documentation for setup and usage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxr2md-0.3.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wxr2md-0.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file wxr2md-0.3.0.tar.gz.

File metadata

  • Download URL: wxr2md-0.3.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for wxr2md-0.3.0.tar.gz
Algorithm Hash digest
SHA256 68d1085ca6f1955bfe0ac4c14dabdcc093ade889b02324ac1b0e2b8ac78e8062
MD5 c67cbe40209167ff986e8e59add62d0b
BLAKE2b-256 2cf6135b1d2ede16ce192d4b18c77b3e3b1413ee02f5d026e0f895071b7566b9

See more details on using hashes here.

File details

Details for the file wxr2md-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wxr2md-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for wxr2md-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7424612f724422a7761697e2f0fc892ab1ddaa4a8999de6e2ea0969f788a1ea6
MD5 248cd7495c30facba1e0aa333f0eea52
BLAKE2b-256 f30761bee2161707c97ee2046f9517a1e9307453fdd8d4714028386e09aea86f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page