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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cd_wp_api-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 186cc53cd6316889063ab665cecea12d85a7cb9c931baa3d7f64034f7ed2e5d7 |
|
MD5 | da0f0e9a77c414986aa6d5ec7293f3ea |
|
BLAKE2b-256 | 233c33d5be936d1e003e5d6e757c34ef3be6d852a08420c510687c5195b9b22c |