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.33.0.tar.gz (193.6 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.33.0-py3-none-any.whl (57.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythorhead-0.33.0.tar.gz
  • Upload date:
  • Size: 193.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pythorhead-0.33.0.tar.gz
Algorithm Hash digest
SHA256 217cb952b96633379508acb6b896fd33d93047db96090624d593b4824179e93e
MD5 5a7170dad452ace3229c893386c0c267
BLAKE2b-256 215d4cb9f46e37e37ce4abbeb2d47e73cca25cc4102c05928d21cfbe94ba8dc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythorhead-0.33.0-py3-none-any.whl
  • Upload date:
  • Size: 57.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pythorhead-0.33.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9668805e87cbfe2dc91696fe551250f23d6ac238b2e9b5f09df2fe7da0265934
MD5 508d7afebb471446a5a29b124c31aad6
BLAKE2b-256 22b06043050934b3425b51faaba72faeb2175647e108762af002e985948dab10

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