No description
Find a file
2023-08-03 16:34:25 +00:00
docs working on docs 2023-06-21 09:52:48 +02:00
lemmy fix 'reponse' vars and unify spacing in user.py 2023-08-03 10:17:11 -04:00
.gitignore package to PyPI 2023-06-20 23:33:20 +02:00
.readthedocs.yaml added requirements for readthedocs 2023-06-21 09:09:37 +02:00
pyproject.toml package to PyPI 2023-06-20 23:33:20 +02:00
README.md Update 'README.md' 2023-06-26 06:22:05 +00:00

Lemmy.py

This project now supports all the Lemmy API methods, so I'm going to concentrate on the development of https://github.com/db0/pythorhead, another wrapper for Lemmy's API that support images upload, for example.

Python wrapper for the Lemmy API. Based on the official Lemmy TS library.

pip install Lemmy.py
from lemmy import Lemmy

# Login to your account
lemmy = Lemmy("https://lemmy.ml")
lemmy.log_in("username_or_email", "password")

# Get a community ID
community_id = lemmy.discover_community("community_name")

# Get all posts from a community by ID
community_posts = lemmy.post.list(community_id=community_id)

# Get the modlog of your server
modlog = lemmy.modlog.get()

# Post a new publication on a community
lemmy.post.create(community_id=community_id, name="First Post!", body="This is the first community post.")