https://github.com/retiolus/lemmy.py
Python wrapper for the Lemmy API. Based the official Lemmy TS library.
https://github.com/retiolus/lemmy.py
bot fediverse lemmy lemmy-bot lemmy-ui python wrapper
Last synced: 9 days ago
JSON representation
Python wrapper for the Lemmy API. Based the official Lemmy TS library.
- Host: GitHub
- URL: https://github.com/retiolus/lemmy.py
- Owner: retiolus
- Created: 2023-06-17T16:28:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T07:57:57.000Z (almost 2 years ago)
- Last Synced: 2025-05-11T13:22:12.459Z (13 days ago)
- Topics: bot, fediverse, lemmy, lemmy-bot, lemmy-ui, python, wrapper
- Homepage: https://codeberg.org/retiolus/Lemmy.py
- Size: 2.93 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lemmy.py
**The source code for this project is hosted on Codeberg: https://codeberg.org/retiolus/Lemmy.py**
Python wrapper for the [Lemmy](https://github.com/LemmyNet/lemmy) API. Based on the official [Lemmy TS library](https://github.com/LemmyNet/lemmy-js-client).
```bash
pip install Lemmy.py
``````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.")
```