Skip to main content

A small wrapper around wordpress-api package for noobs.

Project description

README for cd_wp_api Package Description The cd_wp_api package is designed for interacting with WordPress APIs, providing a convenient way to access and manipulate WordPress data programmatically. This package simplifies the process of connecting to the WordPress API, performing CRUD operations, and handling WordPress-specific data structures.

Features WordPress API Integration: Functions for connecting to the WordPress API. CRUD Operations: Create, read, update, and delete WordPress resources. Data Handling: Tools to handle and parse data returned from WordPress. (Note: Specific functions and their parameters should be listed here.)

Installation To install the cd_wp_api package, use the following command:

bash Copy code pip install cd_wp_api Usage Connecting to the WordPress API python Copy code from cd_wp_api import WPAPI

Initialize the API

wp_api = WPAPI('your_wordpress_site_url', 'username', 'password') Creating a New Post python Copy code post_data = { 'title': 'My New Post', 'content': 'Content of the post', 'status': 'publish' } response = wp_api.create_post(post_data) Scheduling a Post python Copy code from datetime import datetime, timedelta

Schedule a post for 1 day later

future_date = datetime.now() + timedelta(days=1) scheduled_post = { 'title': 'Future Post', 'content': 'This post is scheduled for the future.', 'status': 'future', 'date': future_date.isoformat() # ISO 8601 format } response = wp_api.create_post(scheduled_post) Adding Tags/Keywords to a Post python Copy code post_data_with_tags = { 'title': 'Post with Tags', 'content': 'This is a post with tags.', 'status': 'publish', 'tags': ['tag1', 'tag2', 'tag3'] # List of tags or tag IDs } response = wp_api.create_post(post_data_with_tags) Documentation For more documentation, please go to Code Docta.

Versioning To check the current version of the package:

python Copy code from cd_wp_api import version print(version) Contribution Contributions are welcome. Please follow the coding standards and write tests for new features.

License This package is licensed under [appropriate license, e.g., MIT].

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

cd_wp_api-0.0.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

cd_wp_api-0.0.1-py3-none-any.whl (5.7 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