Skip to main content

A python wrapper for the lemmy HTTP API. Forked from plaw by Benjamin Jablonski (benja810)

Project description

Python Lemmy API Wrapper

Build Generate Python Documentation

Like PRAW but for Lemmy

Written using the Lemmy TS library for reference.

Forked from benja810's plaw

Currently, most of the API functions are implemented, but there are likely quite a few bugs. It is a bit difficult to test at the moment without spinning up a new instance.

If you find any bugs, let me know on the issues page

Installation

jplaw can be installed from PYPI through pip:

python -m pip install jplaw

Usage example

This example uses python-dotenv to load secrets from the .env file, which is not strictly necessary.

import jplaw
import dotenv

#Load secrets with dotenv
dotenv.load_dotenv()
my_instance = os.getenv("LEMMY_INSTANCE")
my_username = os.getenv("LEMMY_USERNAME")
my_password = os.getenv("LEMMY_PASSWORD")

lem = jplaw.Lemmy(my_instance, my_username, my_password)

#Print the JSON response from the community list
print(lem.Community.list())

#Print the JSON response from getting a specific community
print(lem.Community.get("test@lemmy.ml"))

Documentation

See the documentation for more information on how to use jplaw.

Roadmap

v0.1.7

  • Work on return types and usability.

v0.1.6

  • Work on testing functions and finding / squashing bugs

Changelog

v0.1.5

  • Fix namespace issues
  • Fix build issues
  • Fix missing instance argument in list communities

v0.1.4

  • Created documentation
    • Versioned documentation for browsing info on previous versions (things will prob change pretty quickly in early releases)
    • Available here
  • Fixed some issues with argument types not using enums properly or missing references
  • Created Emoji class for creating, editing and deleting custom emoji

v0.1.3

  • Moved enums like SortType to submodule jplaw.types
  • Fix missing enum types
  • Rename a large portion of the functions to remove repetition.
    • Decouples naming scheme from Lemmy API
    • Shortens names and removes repetitive naming like "Lemmy.Comment.likeComment()" -> "Lemmy.Comment.like()."

v0.1.2

  • Added majority of the API functions except for image uploading

v0.1.1

  • Getting PyPi package working and added some functions

v0.1

  • Alpha release. After forking from plaw, fork was broken and migrated to this repository from the jplaw repository, as I wanted to do something a little different from having a purely API equivalent library.

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

jplaw-0.1.5.tar.gz (21.3 kB view hashes)

Uploaded Source

Built Distribution

jplaw-0.1.5-py3-none-any.whl (26.1 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