Skip to main content

Backup your Wordpress post to GitHub or local

Project description

wpexport

This small python package backup your Wordpress post to GitHub. It convert the html to Markdown with pypandoc. For the api interaction, I uses the two packages gitpython and python-wordpress-xmlrpc. So you have to install this dependence, if you wand to install it from source.

quick start

Install wpexport:

pip install wpexport

It uses pandoc for the formatting. you may have to install it manually.

sudo apt install pandoc

More information https://pandoc.org/installing.html

Set up your settings:

python -m wpexport --setup

and when you have to input all the parameters. After that it will save the parameters in the file ~.wpexport.conf. Notice that your passwords are in this file.

Now you are ready to have some fun.

python -m wpexport

command line arguments

This command export all your post to the GitHub repo. If you didn't like the config file, you can pass the parameter throw the terminal. Use the name of the parameter as the command option. The command option will always override the config file. For axample you cann uses the config file for all parametes exclude the password. And then pass the password throw the command line.

python -m wpexport --wp_pw 1234

the config file

You can also uses another config file. For the setup as well as the backup function.

python -m wpexport --config "/path/to/your/config.json"

The config file is a basic json file. You can look into it and change the values, if you like.

only local export

If you didn't like GitHub, only export it to your local machine.

python -m wpexport --output "/path/to/your/export"

how does it work?

Coming soon.

development

Clone repo:

git clone https://github.com/axju/wpexport.git

Create virtual environment and update dev-tools:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade wheel pip setuptools twine

Install wpexport:

pip install -e .

Publish the packages:

python setup.py sdist bdist_wheel
twine upload dist/*

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

wpexport-0.0.2a1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

wpexport-0.0.2a1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file wpexport-0.0.2a1.tar.gz.

File metadata

  • Download URL: wpexport-0.0.2a1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for wpexport-0.0.2a1.tar.gz
Algorithm Hash digest
SHA256 9533b433a042e8ec0cead7b443bf606f0892b97a547e3acd203f3a8d29bd2cd1
MD5 92887759b1a53093170ccbc8c1f784b7
BLAKE2b-256 ed0d8e86265d0883bac05cd0fb3b73ce6ce8d2ef583a093fd3a60060fc92a3b9

See more details on using hashes here.

File details

Details for the file wpexport-0.0.2a1-py3-none-any.whl.

File metadata

  • Download URL: wpexport-0.0.2a1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for wpexport-0.0.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 65748ada085e565f642eb135da35abb1dabc9ef3179bf259e31b28bcd93719c3
MD5 4cd0ef2de95669b63e57623e8654111f
BLAKE2b-256 a4d4680bfe6993b94635df6e7b1f7227a6daf4bf316c41e81ac814b6c9431517

See more details on using hashes here.

Supported by

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