Skip to content

pylemmy enables simple access to Lemmy's API with Python

License

Notifications You must be signed in to change notification settings

dcferreira/pylemmy

Repository files navigation

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.

About

pylemmy enables simple access to Lemmy's API with Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages