Someone’s started a Python wrapper around the lemmy API
https://github.com/db0/pythorhead (@db0)
Could make writing bots and other tools easier and quicker.
Someone’s started a Python wrapper around the lemmy API
3 years ago by maegul to c/fediverse
Someone’s started a Python wrapper around the lemmy API
https://github.com/db0/pythorhead (@db0)
Could make writing bots and other tools easier and quicker.
Do you like garlic bread?
I'd love to write a bot for my own community. I used to use praw, when reddit was a thing.
Can you see your wrapper being used this way? If so, is it ready for this yet? If so, is there any example code or docs on this?
Thanks for your work, it's very much appreciated.
Yes there isn't a reason not to use it as a bot. We don't have all the API endpoints yet as we add them usually as we need them, but if you need one we don't have, just open a PR or send an issue and we'll handle it.
I think that this question from my non bot account has not reached you:
@carlesmu@lemmygrad.ml wrote:
Thanks for the wrapper :)
Two questions:
Where can I find the relation between languages and the languages_id ints?
When I log in into a lemmy instance I check the protected member _requestor.nodeinfo to detect if the problem it’s the connection or the user/password:
lemmy = Lemmy(instance) if not lemmy.log_in(user, password): if not lemmy._requestor.nodeinfo: raise LemmyException(f"Sorry, cannot connect to lemmy instance {instance}.") raise LemmyException( f"Sorry, cannot login {user} into {instance}. Bad user or wrong password." )There is a better way to validate it?
There is also plemmy https://github.com/tjkessler/plemmy
@maegul @db0@lemmy.dbzer0.com @fediverse @fediversenews I'm also on hachyderm.io as well ;)
"someone"
@lemmy.ml
A community dedicated to fediverse news and discussion.
go to feed...
@lemmy.ml
A community dedicated to fediverse news and discussion.
go to feed...
Hey everyone, "someone" here, AMA :D
save