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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cd_wp_api-0.0.1.tar.gz.
File metadata
- Download URL: cd_wp_api-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80e5326fbd2b4c473d2b056e7ee486a782b237c575089c193895cab08c89218
|
|
| MD5 |
5b69698ecc8e8fb70e63943777819b81
|
|
| BLAKE2b-256 |
82b99653d19344dbc987860f167a9c56d4eacd1b6cbb8512ebb7272bb796ccb2
|
File details
Details for the file cd_wp_api-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cd_wp_api-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
186cc53cd6316889063ab665cecea12d85a7cb9c931baa3d7f64034f7ed2e5d7
|
|
| MD5 |
da0f0e9a77c414986aa6d5ec7293f3ea
|
|
| BLAKE2b-256 |
233c33d5be936d1e003e5d6e757c34ef3be6d852a08420c510687c5195b9b22c
|