A toolkit for interacting with the Google Blogger API
Project description
Bloggerkit
A Python toolkit for interacting with the Google Blogger API.
Installation
pip install bloggerkit
Usage
from bloggerkit import BloggerClient
# Replace with your credentials
API_KEY = "YOUR_API_KEY"
BLOG_ID = "YOUR_BLOG_ID"
client = BloggerClient(API_KEY, BLOG_ID)
posts = client.list_posts()
if posts and "items" in posts:
for post in posts["items"]:
print(post['title'], post['url'])
## Features
* `list_posts()`: Retrieves a list of all posts in the blog.
* `create_post(title, content)`: Creates a new post with the given title and content.
* `get_post(post_id)`: Retrieves a specific post by its ID.
* `update_post(post_id, title, content)`: Updates an existing post with the given ID, title, and content.
* `delete_post(post_id)`: Deletes a post with the given ID.
## Usage
```python
from bloggerkit import BloggerClient
# Replace with your credentials
API_KEY = "YOUR_API_KEY"
BLOG_ID = "YOUR_BLOG_ID"
client = BloggerClient(API_KEY, BLOG_ID)
# List posts
posts = client.list_posts()
if posts and "items" in posts:
for post in posts["items"]:
print(post['title'], post['url'])
# Create a new post
new_post = client.create_post("My New Post", "Content of my new post.")
if new_post:
print(f"New post created: {new_post['url']}")
# Get a specific post
post = client.get_post("POST_ID") # Replace with the actual post ID
if post:
print(f"Post title: {post['title']}")
# Update a post
updated_post = client.update_post("POST_ID", "Updated Title", "Updated content.") # Replace with the actual post ID
if updated_post:
print(f"Post updated: {updated_post['url']}")
# Delete a post
client.delete_post("POST_ID") # Replace with the actual post ID
print("Post deleted successfully.")
Note: Make sure to replace YOUR_API_KEY, YOUR_BLOG_ID, and POST_ID with your actual API key, blog ID, and post ID. It's recommended to store your API key in a secure way, such as using environment variables.
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 bloggerkit-0.3.0.tar.gz.
File metadata
- Download URL: bloggerkit-0.3.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cf431491daab0a4b7a0d4c59dd4e38a3a11e828e6c40af7f5b07f1faf451bf2
|
|
| MD5 |
fdf5ffdb50dd425929ab5acde25aa520
|
|
| BLAKE2b-256 |
b6d6538fc0052627ce8828a654284beb858286bba3cd50dfb115f0c74aa3841a
|
File details
Details for the file bloggerkit-0.3.0-py3-none-any.whl.
File metadata
- Download URL: bloggerkit-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bac5f75342318fd33cda1399e7252422adbb4894cef3d7455ab6df9559b5a8ba
|
|
| MD5 |
1636d0c03ec890991349163ed72d6bdb
|
|
| BLAKE2b-256 |
137cf09b8de95af62e3e5d1954b5c3065d61a3361806124fa8dc2dc5abc7a315
|