No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-10-16 12:37:23 +00:00
.github allow pushing new releases directly 2024-06-09 16:05:55 +02:00
examples feat: Support alt text (#114) 2025-04-28 08:39:10 +02:00
pythorhead feat: aprove/deny application requests from class (#115) 2025-05-26 22:16:48 +02:00
.gitignore Refactoring (#3) 2023-06-16 15:12:47 +02:00
CHANGELOG.md version incremented 2025-10-16 12:37:23 +00:00
LICENSE Initial commit 2023-06-14 18:21:28 +02:00
logo.png fix: improved logo 2023-07-02 16:06:55 +02:00
pyproject.toml version incremented 2025-10-16 12:37:23 +00:00
README.md feat: Allows specifying request timeout (#76) 2023-10-18 18:33:20 +02:00

Pythörhead

A python library for interacting with Lemmy

pythorhead logo

Examples

See working examples in examples/

Exceptions

If you want to raise exceptions on failures instead of returning null, pass raise_exceptions=True to the Lemmy() constructor.

The normal request timeout is 3 seconds. If you want to change this number, you can set it on the constructor uising request_timeout=

Sample Post Usage

from pythorhead import Lemmy

lemmy = Lemmy("https://lemmy.dbzer0.com",request_timeout=2)
lemmy.log_in("username", "password")
community_id = lemmy.discover_community("botart")
lemmy.post.create(community_id, "Hello Lemmy World")

Sample Comment Usage

from pythorhead import Lemmy

lemmy = Lemmy("https://lemmy.dbzer0.com")
lemmy.log_in("username", "password")

# getting the first post id
post_id = lemmy.post.list()[0]["post"]["id"]

# leave a comment
lemmy.comment.create(post_id, "Hello Lemmy World")