Skip to main content

pylemmy enables simple access to Lemmy's API with Python

Project description

pylemmy

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install pylemmy

Usage

Simple example of running a Python function on new posts, as they are created.

from pylemmy import Lemmy

def process_post(post):
    ...

lemmy = Lemmy(
    lemmy_url="http://127.0.0.1:8536",
    username="lemmy",
    password="lemmylemmy",
    user_agent="custom user agent (by u/USERNAME)",
)

community = lemmy.get_community("test")
for post in community.stream.get_posts():
    process_post(post)

License

pylemmy is distributed under the terms of the MIT license.

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

pylemmy-0.0.8.tar.gz (19.3 kB view hashes)

Uploaded Source

Built Distribution

pylemmy-0.0.8-py3-none-any.whl (18.3 kB view hashes)

Uploaded Python 3

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