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.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: wpexport-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f4ff735925c7c7e0263a918c3c11ed4ecb3409eb9034cf087737e48c8bc9f7a0
MD5 ae57fbd248cfd9f84debe6b2025f25a4
BLAKE2b-256 a521418dca0ebd23c2fa552c6d0f8d24f37811ab147144a0c2327729ccd6a613

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wpexport-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 131a8a03700c08c3256951a0e897a0b628d01f3ced46732ef6f3c8203957156a
MD5 346d9bc13cb6b27fba752cf46ea073e6
BLAKE2b-256 3fcc6d4a4d7ef82c26f8b7647248cd7f9f688b790f1df2e898968f1a80713e1c

See more details on using hashes here.

Supported by

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