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
pythorhead-0.25.1.tar.gz
(187.6 kB
view hashes)
Built Distribution
Close
Hashes for pythorhead-0.25.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d31a4bd1f9b56ee0ce1924ce229fc04c9f5a42ce230de8082cfe02a1bacd0a05 |
|
MD5 | 0f180f047e5c1e7fc21f4496ee7ce2f7 |
|
BLAKE2b-256 | 7a6b2c938567ae10c2e2d7d2e26dd7c115990b9892474bb527b813593484f5f6 |