Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bloggerkit-0.4.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bloggerkit-0.4.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file bloggerkit-0.4.2.tar.gz.

File metadata

  • Download URL: bloggerkit-0.4.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for bloggerkit-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7e5916436b6dacef0d7aea65835060d8f412543b7486f0a7edc6aa24ba7e69e6
MD5 07b45ababdf0047af08b4f908e128526
BLAKE2b-256 399ddb03c0571de7bcaa38c75cc0cca7e4878d238891b57c655a0ecf779f20b7

See more details on using hashes here.

File details

Details for the file bloggerkit-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bloggerkit-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 86c58e519456854e9323b01396e8a3726b5632e8eb2e60c5cfd8a10837f38c0d
MD5 7f4922b5ea102f16558010d6cc5b6224
BLAKE2b-256 ecb72f7334db5df7e3fd6e203b3eb5a31f72b03855a09fa2a669029df0b6396c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page