Overview
Python Wordpress Api Library
Pywordapi allows a simple way to get data in and out of WordPress over HTTP, using python and Wordpress REST API.
Installation
To install the Pywordapi package:
pip install pywordapi
Usage
Get posts
from pywordapi import Pywordapi
api_url = "https://demo.wp-api.org/"
api = Pywordapi.WpRest(api_url)
results = api.get_posts()
Get categories
from pywordapi import Pywordapi
api_url = "https://demo.wp-api.org/"
api = Pywordapi.WpRest(api_url)
results = api.get_categories()
Variable results will return instance of type list (of dict).
Using proxy
from pywordapi import Pywordapi
api_url = "https://demo.wp-api.org/"
proxy_url = "http://username:password@IP_ADDRESS:PORT"
api = Pywordapi.WpRest(api_url, proxy_url)
results = api.get_posts()