Python wrapper for PluralKit's API.
Project description
pluralkit.py
Python wrapper for PluralKit's API.
Currently supports PluralKit's v1.0 API.
Installing
Python 3.6 or higher is required.
# linux/macOS
python3 -m pip install -U pluralkit
# windows
py -3 -m pip install -U pluralkit
Quick examples
Provided a system's authorization token, the examples below print the system description and list the system's members.
Async usage
pluralkit.py was created with discord.py in mind, and so the default implementation is asynchronous.
from pluralkit import Client
import asyncio
pk = Client("token") # your token here
async def main():
system = await pk.get_system()
print(system.description)
members = pk.get_members()
async for member in members:
print(f"{member.name} (`{member.id}`)")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Synchronous usage
Blocking execution may be specified with the client argument async_mode=False
.
from pluralkit import Client
pk = Client("token", async_mode=False)
system = pk.get_system()
print(system.description)
members = pk.get_members()
for member in members:
print(f"{member.name} (`{member.id}`)")
Token
The client can be used without one's PluralKit authorization token, but it's required for editing one's system or members or for accessing one's private system or member info.
Links
- PyPI link
- Latest build of the docs
- pluralkit.py Discord support server
- PluralKit support server
- PluralKit's API
Todo
- Tidy up error handling
- Test timezone mechanics
- Prepare for API v2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pluralkit-0.0.7.tar.gz
(32.2 kB
view hashes)
Built Distributions
pluralkit-0.0.7-py3.9.egg
(45.3 kB
view hashes)
pluralkit-0.0.7-py3-none-any.whl
(20.3 kB
view hashes)
Close
Hashes for pluralkit-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e59085711cb73a5e36584a0caa77b3f9a7b6fdafc13659144a4cfccedeb4a925 |
|
MD5 | 179ac0c9969828bd847eeee9353aff5d |
|
BLAKE2b-256 | e66b40071fdea808d9365e98823425d7b1a4d071c8985a8d1d4466b66289a292 |