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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythorhead-0.28.0-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythorhead-0.28.0.tar.gz
  • Upload date:
  • Size: 190.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pythorhead-0.28.0.tar.gz
Algorithm Hash digest
SHA256 8c5677c7ebb57da2b1749d448ea00282d0e2da7a6d29a6165a66e8a6e468289b
MD5 38ab8e050c781e7897c97776ccd2fadf
BLAKE2b-256 1d9745320158246e7b487d985c1b0e534c03ba2fbc37d841bbd960e8d27a8aab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythorhead-0.28.0-py3-none-any.whl
  • Upload date:
  • Size: 53.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pythorhead-0.28.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4ae2733fea561e6580b7c4df5763cc85112b8bc811d32036d10779eaf4b6e3e
MD5 bee7db987bf6a66d1a50e609e37650ec
BLAKE2b-256 c989337fb9d59ddc79704917da86735ba09a88cefbeea3e7772aba5e47d1d1d5

See more details on using hashes here.

Supported by

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