A python library for interacting with Lemmy API
Project description
Pythörhead
A python library for interacting with Lemmy
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythorhead-0.30.1.tar.gz.
File metadata
- Download URL: pythorhead-0.30.1.tar.gz
- Upload date:
- Size: 192.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
626b22bf4be0d1895e10f610aab911a4d908d10c3cdc5d87cdeccb2122054bb0
|
|
| MD5 |
9c1e3edc67cfa1c00bcc7bfb96e13aff
|
|
| BLAKE2b-256 |
8b3669d11602f855e7b524f7d9ba6f9868da77d693f6012d20af796eef07d674
|
File details
Details for the file pythorhead-0.30.1-py3-none-any.whl.
File metadata
- Download URL: pythorhead-0.30.1-py3-none-any.whl
- Upload date:
- Size: 55.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9291e115afba7cf33593e3981f82cb18f9bd174021bdf90a89ae708e17a3d7
|
|
| MD5 |
07a9b68b715a11f498215212ad58833f
|
|
| BLAKE2b-256 |
1af937ffff12e71a384db32c532233e79d54d5314d7322749996cb5e8a482508
|