Python Decorators #5

Open
opened 2026-04-19 12:49:55 +00:00 by sch · 3 comments
sch commented 2026-04-19 12:49:55 +00:00 (Migrated from codeberg.org)

DeltaChat

Project "deltabot-cli-py" provides Python Decorators to facilitate the utilization of module "deltachat2" to realize automated services.

https://github.com/deltachat-bot/deltabot-cli-py (decorators)

https://github.com/adbenitez/deltachat2 (decorators)

XMPP

Project "slixbot" provides Python Decorators to facilitate the utilization of module "slixmpp" to realize automated services.

https://codeberg.org/nicoco/slixbot (decorators)

https://codeberg.org/poezio/slixmpp (no decorators)

I created something similar, which was not yet realized into Python Decorators.

https://git.xmpp-it.net/sch/Slixfeed/src/branch/master/src/slixfeed/interface/xmpp

ActivityPub

This is my current implementation with Longwei, and I intend to extend it further in project Slixfeed.

https://git.xmpp-it.net/sch/Rivista/src/branch/main/src/rivista/interface/activitypub

It might be good to either create a new project, as with "slixbot"; or, to add such "wrappers" in project Longwei itself, as with "deltachat2".

### DeltaChat Project "deltabot-cli-py" provides Python Decorators to facilitate the utilization of module "deltachat2" to realize automated services. https://github.com/deltachat-bot/deltabot-cli-py (decorators) https://github.com/adbenitez/deltachat2 (decorators) ### XMPP Project "slixbot" provides Python Decorators to facilitate the utilization of module "slixmpp" to realize automated services. https://codeberg.org/nicoco/slixbot (decorators) https://codeberg.org/poezio/slixmpp (no decorators) I created something similar, which was not yet realized into Python Decorators. https://git.xmpp-it.net/sch/Slixfeed/src/branch/master/src/slixfeed/interface/xmpp ### ActivityPub This is my current implementation with Longwei, and I intend to extend it further in project Slixfeed. https://git.xmpp-it.net/sch/Rivista/src/branch/main/src/rivista/interface/activitypub It might be good to either create a new project, as with "slixbot"; or, to add such "wrappers" in project Longwei itself, as with "deltachat2".
marvin8 commented 2026-04-19 20:35:27 +00:00 (Migrated from codeberg.org)

Interesting idea... I'll have to take some time to look more into this.

Interesting idea... I'll have to take some time to look more into this.
marvin8 commented 2026-05-15 06:15:08 +00:00 (Migrated from codeberg.org)

I am starting to look at this.

Before I decide on scope and approach, it would help to understand what you're actually trying to build in Slixfeed (or wherever you'd use this).

A few questions:

  1. What events do you care about? Mentions, all notifications, home-timeline updates, something else?

  2. What does your ideal API look like? For example, is this what you have in mind:

    @bot.on_notification("mention")
    async def handle_mention(notification):
        ...
    

    Or would a lower-level async iterator be sufficient:

    async for event in client.stream_user():
        ...
    
  3. Polling or streaming? The Mastodon streaming API uses SSE (Server-Sent Events). Is that what you'd want, or are you thinking of a polling helper that periodically checks for new notifications?

  4. Existing code? You mentioned similar functionality was created but not yet turned into decorators in Slixfeed — is there code we could look at to understand the pattern you're after?

I am starting to look at this. Before I decide on scope and approach, it would help to understand what you're actually trying to build in Slixfeed (or wherever you'd use this). A few questions: 1. **What events do you care about?** Mentions, all notifications, home-timeline updates, something else? 2. **What does your ideal API look like?** For example, is this what you have in mind: ```python @bot.on_notification("mention") async def handle_mention(notification): ... ``` Or would a lower-level async iterator be sufficient: ```python async for event in client.stream_user(): ... ``` 3. **Polling or streaming?** The Mastodon streaming API uses SSE (Server-Sent Events). Is that what you'd want, or are you thinking of a polling helper that periodically checks for new notifications? 4. **Existing code?** You mentioned similar functionality was created but not yet turned into decorators in Slixfeed — is there code we could look at to understand the pattern you're after?
sch commented 2026-05-27 12:12:01 +00:00 (Migrated from codeberg.org)
  1. I do not know. I suppose, that "direct message", "mention", and "respond" be useful; yet, there are intentions to utilize ActivityPub for messaging.
  2. Higher level seems to be that which most people are interested at; yet, I would also prefer lower level, when needed.
  3. I do not know; I sippose, that this is possible for the developers to choose or do on their own by creating a task;
  4. Yes. DeltaChat.
1. I do not know. I suppose, that "direct message", "mention", and "respond" be useful; yet, there are intentions to utilize ActivityPub for messaging. 2. Higher level seems to be that which most people are interested at; yet, I would also prefer lower level, when needed. 3. I do not know; I sippose, that this is possible for the developers to choose or do on their own by creating a task; 4. Yes. DeltaChat. * https://github.com/adbenitez/deltachat2 * https://github.com/deltachat-bot/deltabot-cli-py
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/longwei#5
No description provided.