Skip to main content

Add a short description here

Project description

wp-client-aio

WordPress REST API Python Client based on aiohttp library

Installation

pip install wp-client-aio

Usage

Create new client

wp_client = WordpressRestApiClient(
    os.environ.get("URL"),
    os.environ.get("WP_USER"),
    os.environ.get("WP_PASS")
)

Call API

    await asyncio.gather(
        wp_client.get(client, endpoint = 2),
        wp_client.delete(client, endpoint = 3),
        wp_client.get(client),
        wp_client.post(client,
            payload =
                {
                    "title": "Lorem Ipsum",
                    "content": "Lorem ipsum sit amet",
                    "status": "publish"
                }
            ),

        wp_client.patch(client, endpoint=4, payload = {
            "title": "Съешь ещё этих мягких французских булок",
        }),
        wp_client.put(client, endpoint=4,
            payload =
                {
                    "title": "съешь ещё этих мягких французских булок",
                    "content": "Да выпей чаю",
                    "status": "publish"
                }
            ),
    )

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

wp_client_aio-1.0.5.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

wp_client_aio-1.0.5-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

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