Skip to main content

A simple blogger library

Project description

Python Simple Blogger library (simple_blogger)

This is simple library to make simple blog project with Python. The library is distributed under the MIT license and can be downloaded and used by anyone.


How to install

To install, you can use the command:

pip3 install simple_blogger

Or download the repository from GitHub


Simplest Blogger

Use simplest blogger to generate and post simple messages

Wisher example

Uses Deepseek engine to generate a wish text and sends it to Telegram channel. Adds tag #haveaniceday to all posts.

blogger = SimplestBlogger(
    builder = PostBuilder(
            message_builder=ContentBuilder(
                generator=DeepSeekTextGenerator(system_prompt='You are the most optimistic human in the world'),
                prompt_builder=IdentityPromptBuilder(f"Wish a nice day to the World, use emojies")
            )
        ),
    posters = [
            TelegramPoster(processor=TagAdder(['#haveaniceday']))
        ]
)
blogger.post()

A slightly more complicated horoscope example

Sends pisces hororoscope for tomorrow to Telegram Channel and VK group.

class HoroscopeBlogger(SimplestBlogger):
    def __init__(self, sign):
        tomorrow = datetime.today() + timedelta(days=1)
        builder = PostBuilder(
            message_builder=ContentBuilder(
                generator=DeepSeekTextGenerator(system_prompt='You are a professional astrologist'),
                prompt_builder=IdentityPromptBuilder(f"Make a a horoscope on {tomorrow.strftime('%Y-%m-%d')} for '{sign}', use emojies, use less than 300 words")
            )
        )
        processor = TagAdder(['#horoscope', '#astrology', f"#{sign}"])
        posters = [
            TelegramPoster(processor=processor),
            VkPoster(processor=processor)
        ]
        super().__init__(builder, posters)

pisces_blogger = HoroscopeBlogger(sign='pisces')
pisces_blogger.post()

Environment variables

Library uses dall-e-3 model to generate images and deepseek-chat to generate texts by default and sends publications to telegram channels. It needs following environment variables:

  • BLOGGER_BOT_TOKEN
  • OPENAI_API_KEY
  • DEEPSEEK_API_KEY

Yandex generators needs following environment variables:

  • YC_API_KEY
  • YC_FOLDER_ID

From the developer

There are(or will be) more examples of using this library in sibling repos on GitHub

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

simple_blogger-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

simple_blogger-0.1.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file simple_blogger-0.1.0.tar.gz.

File metadata

  • Download URL: simple_blogger-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for simple_blogger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4b77ecabe2cc8917a1a9d11edca82169275e8cb251de0f5004995c47da7aab15
MD5 084456cd0b5394d8db0a1ff00e7c7b37
BLAKE2b-256 c7c9a654c8b8348e6c9482b0c423f47ea32dd6ee4bc9ce20c8fe57a4b3b86a3d

See more details on using hashes here.

File details

Details for the file simple_blogger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simple_blogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for simple_blogger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04b9f4284751b23262e079b4f1a0c6afc31249dd0e3af8637275140555e9811f
MD5 bcdc9432571d57b1755dc44b7840f5d8
BLAKE2b-256 c6ffffc18621ff648848114e0e78db7e4b0822e3ed697949f52a7ba3de0221fb

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