Skip to main content

A python library for interacting with Lemmy API

Project description

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")

Project details


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.26.0.tar.gz (187.8 kB view details)

Uploaded Source

Built Distribution

pythorhead-0.26.0-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file pythorhead-0.26.0.tar.gz.

File metadata

  • Download URL: pythorhead-0.26.0.tar.gz
  • Upload date:
  • Size: 187.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pythorhead-0.26.0.tar.gz
Algorithm Hash digest
SHA256 2bbf20ffc073c9741e06678ef0ebbca9281c61d458bd51a5d4707ff0873fdc21
MD5 d8093989db6162f82b16bd68825f9721
BLAKE2b-256 82bcccb38950eb5b2b5c893cc86d2d948b698a4845bf379099a405efb9b82276

See more details on using hashes here.

File details

Details for the file pythorhead-0.26.0-py3-none-any.whl.

File metadata

  • Download URL: pythorhead-0.26.0-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pythorhead-0.26.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ba559a1bba73e8db3bf350c870787d27d5020edd319b6e8ca53938376f60c3
MD5 62c4035f29f42d962c86fa0cb5d4572a
BLAKE2b-256 ce225adff171da4b961e18de01d1276ac90ae55697ac266c6be1b9eedfe95451

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page