GitHub - tjkessler/plemmy: A Python package for accessing the Lemmy API

3 years ago by travis to c/programming

A Python package for accessing the Lemmy API. Contribute to tjkessler/plemmy development by creating an account on GitHub.

Hi everyone,

I’d like to share a project I’ve been working on recently, Plemmy! Plemmy allows you to interact with any Lemmy instance using Python and the LemmyHttp API.

Currently all LemmyHttp functions (POST, PUT, GET) have been implemented.

Feel free to provide feedback or contribute in any way!

clawlor 4 points 3 years ago

create_form(locals()) is so elegant! Each API endpoint is almost entirely described by the method signature alone, about as DRY as can be. Very clever (the good kind!)

path: 0 440533, hotness: undefined, score: 4, children: 0
usernotfound 3 points 3 years ago

Nice! I had created a partial implementation of the API in my own project but I think I'll replace it with yours this weekend :)

path: 0 431308, hotness: undefined, score: 3, children: 1
travis 1 point 3 years ago

I like the idea of a Reddit-Lemmy cross-poster! It should make transitioning to Lemmy a bit easier for those used to seeing more Reddit-like content.

path: 0 431308 453617, hotness: undefined, score: 1, children: 0
bugsmith 3 points 3 years ago

Just checked it out. Big fan of the simplicity you've kept with this. Do you think it would be worth adding in some kind of rate limiting functionality?

path: 0 405404, hotness: undefined, score: 3, children: 2
travis 1 point 3 years ago

I believe rate limits (messages, images, sign-ups etc.) can be defined for a site 1.) on creation using the create_site function and 2.) editing a site using the edit_site function.

path: 0 405404 418504, hotness: undefined, score: 1, children: 1
bugsmith 1 point 3 years ago

I think that is if you are setting the rate limit for a new instance (which I suppose could only be useful when automating instance setup? Otherwise, I don't see a purpose for those endpoints).

What I meant was rate limiting functionality client side. So you can respect the rate limit of whatever instance you are interacting with. Either some kind of token bucket or exponential backoff.

path: 0 405404 418504 439721, hotness: undefined, score: 1, children: 0
programming
programming

@programming.dev

login for more options
28819
3723
3326

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev


go to feed...