Plemmy: a Python package for accessing the Lemmy API
Plemmy allows you to interact with any Lemmy instance using Python and the LemmyHttp API.
WARNING: Plemmy is still in development and needs testing!
Installation
For the most up-to-date version of Plemmy, clone and install from the repository:
git clone https://github.com/Fedihosting-Foundation/plemmy
cd plemmy
python -m pip install .
A PyPI repository is updated whenever a new version is available:
python -m pip install plemmy
Basic usage
Interact with a Lemmy instance using the LemmyHttp object:
from plemmy import LemmyHttp
# create object for Lemmy.world, log in
srv = LemmyHttp("https://lemmy.world")
srv.login("<username_or_email>", "<password>")
Access specific communities:
from plemmy.responses import GetCommunityResponse
# obtain community, parse JSON
api_response = srv.get_community(name="Lemmy")
response = GetCommunityResponse(api_response)
# community info
community = response.community_view.community
print(community.name)
print(community.actor_id)
print(community.id)
# list community moderators
for person in response.moderators:
print(person.moderator.name, person.community.name)
Create a post:
from plemmy.responses import PostResponse
# create post, parse JSON
api_response = srv.create_post(community.id, "Test post please ignore", "Body text")
response = PostResponse(api_response)
# post info
post = response.post_view.post
print(post.creator_id)
print(post.community_id)
print(post.name)
print(post.body)
Full documentation is on its way, but in the meantime check out our source code and some examples.
Reporting issues, making contributions, etc.
Don't hesitate to report a bug or unexpected results! Want to contribute? Make a pull request. Contact @tjkessler with any questions.
Metadata
Release files for plemmy 0.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plemmy-0.4.8.tar.gz | 22.9 kB | Without provenance | Details for plemmy-0.4.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plemmy-0.4.8-py3-none-any.whl | Python 3 | none | any | Details for plemmy-0.4.8-py3-none-any.whl |
Total release size: 46.6 kB
Release files / plemmy-0.4.8.tar.gz
| Download URL | plemmy-0.4.8.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0e908004fddb68f305a5ebb656aff8eb922bb4acafadfc51746ee5d75e55bb3
|
|
BLAKE2b-256 checksum How to use checksums |
f15fa40db23187586d452a76503cc5dc4164cfee7a828012e23e367e3f9ca18f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / plemmy-0.4.8-py3-none-any.whl
| Download URL | plemmy-0.4.8-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42c70ae786696754cf95015509fc69f2ba2173ccdd0fe8d17cfe4aaaf431631c
|
|
BLAKE2b-256 checksum How to use checksums |
c67589defd9d6df66d0c7b4477ce0840a064eb6e8f1ce386cac4ccf15aaed3f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Security for plemmy 0.4.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.