{"id":13769715,"url":"https://github.com/Fedihosting-Foundation/plemmy","last_synced_at":"2025-05-11T02:33:16.178Z","repository":{"id":176409120,"uuid":"655493582","full_name":"Fedihosting-Foundation/plemmy","owner":"Fedihosting-Foundation","description":"A Python package for accessing the LemmyHttp API","archived":false,"fork":false,"pushed_at":"2024-08-03T13:17:24.000Z","size":187,"stargazers_count":46,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-03T21:10:02.697Z","etag":null,"topics":["api","lemmy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fedihosting-Foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-19T02:45:36.000Z","updated_at":"2024-09-29T06:55:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e729cc0b-e25e-4cd3-b85a-3195885ccf4e","html_url":"https://github.com/Fedihosting-Foundation/plemmy","commit_stats":null,"previous_names":["tjkessler/plemmy","lemmyworld/plemmy","fedihosting-foundation/plemmy"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fedihosting-Foundation%2Fplemmy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fedihosting-Foundation%2Fplemmy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fedihosting-Foundation%2Fplemmy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fedihosting-Foundation%2Fplemmy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fedihosting-Foundation","download_url":"https://codeload.github.com/Fedihosting-Foundation/plemmy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225004657,"owners_count":17405656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","lemmy"],"created_at":"2024-08-03T17:00:30.778Z","updated_at":"2024-11-17T05:31:26.607Z","avatar_url":"https://github.com/Fedihosting-Foundation.png","language":"Python","funding_links":[],"categories":["Projects"],"sub_categories":["Libraries"],"readme":"# Plemmy: a Python package for accessing the Lemmy API\n\n\u003cimg src=\"https://github.com/Fedihosting-Foundation/plemmy/blob/main/img/plemmy.png\" alt=\"drawing\" width=\"325\"/\u003e\n\n[![GitHub version](https://badge.fury.io/gh/Fedihosting-Foundation%2Fplemmy.svg)](https://badge.fury.io/gh/Fedihosting-Foundation%2Fplemmy)\n[![PyPI version](https://badge.fury.io/py/plemmy.svg)](https://badge.fury.io/py/plemmy)\n[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://raw.githubusercontent.com/Fedihosting-Foundation/plemmy/master/LICENSE.txt)\n\nPlemmy allows you to interact with any Lemmy instance using Python and the [LemmyHttp API](https://join-lemmy.org/api/classes/LemmyHttp.html).\n\n**WARNING:** Plemmy is still in development and needs testing!\n\n## Installation ##\n\nFor the most up-to-date version of Plemmy, clone and install from the repository:\n\n```\ngit clone https://github.com/Fedihosting-Foundation/plemmy\ncd plemmy\npython -m pip install .\n```\n\nA PyPI repository is updated whenever a new version is available:\n\n```\npython -m pip install plemmy\n```\n\n## Basic usage ##\n\nInteract with a Lemmy instance using the _LemmyHttp_ object:\n\n```python\nfrom plemmy import LemmyHttp\n\n# create object for Lemmy.world, log in\nsrv = LemmyHttp(\"https://lemmy.world\")\nsrv.login(\"\u003cusername_or_email\u003e\", \"\u003cpassword\u003e\")\n```\n\nAccess specific communities:\n\n```python\nfrom plemmy.responses import GetCommunityResponse\n\n# obtain community, parse JSON\napi_response = srv.get_community(name=\"Lemmy\")\nresponse = GetCommunityResponse(api_response)\n\n# community info\ncommunity = response.community_view.community\nprint(community.name)\nprint(community.actor_id)\nprint(community.id)\n\n# list community moderators\nfor person in response.moderators:\n    print(person.moderator.name, person.community.name)\n```\n\nCreate a post:\n```python\nfrom plemmy.responses import PostResponse\n\n# create post, parse JSON\napi_response = srv.create_post(community.id, \"Test post please ignore\", \"Body text\")\nresponse = PostResponse(api_response)\n\n# post info\npost = response.post_view.post\nprint(post.creator_id)\nprint(post.community_id)\nprint(post.name)\nprint(post.body)\n```\n\nFull documentation is on its way, but in the meantime check out our source code and some [examples](https://github.com/Fedihosting-Foundation/plemmy/tree/main/examples).\n\n## Reporting issues, making contributions, etc. ##\n\nDon't hesitate to report a bug or unexpected results! Want to contribute? Make a pull request. Contact [@tjkessler](https://github.com/tjkessler) with any questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFedihosting-Foundation%2Fplemmy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFedihosting-Foundation%2Fplemmy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFedihosting-Foundation%2Fplemmy/lists"}