Metadata-Version: 2.4
Name: pluralmind
Version: 2.0.0b1
Summary: Let folks know who's speaking. Pluralmind allows plural folks to share which of their members is sending a message on Twitch.
Author: leahinmoonlight
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Communications :: Chat
Classifier: Typing :: Typed
Requires-Dist: httpx>=0.25.1
Requires-Python: >=3.12
Project-URL: Homepage, https://pluralmind.chat/
Project-URL: Documentation, https://docs.pluralmind.chat
Project-URL: Repository, https://github.com/leahinmoonlight/pluralmind-py.git
Project-URL: Issues, https://github.com/leahinmoonlight/pluralmind-py/issues
Project-URL: Changelog, https://github.com/leahinmoonlight/pluralmind-py/releases
Description-Content-Type: text/markdown

# pluralmind-py

Pluralmind allows plural folks to share which of their system members is sending a message on Twitch. You can learn more about Pluralmind over at [pluralmind.chat](https://pluralmind.chat).

This library is designed to make it fast and simple to add plurality support to your own Python projects (such as TwitchIO bots, custom Twitch tools, etc.).

If you want to add Pluralmind to web-based projects such as chat widgets, check out our [JavaScript library](https://github.com/leahinmoonlight/pluralmind).

[![pypi version](https://img.shields.io/pypi/v/pluralmind?color=ff69b4)](https://pypi.org/project/pluralmind/) [![license](https://img.shields.io/pypi/l/pluralmind?color=ff69b4)](./LICENSE)

## Guides and References

We're still working on our Python documentation, but you may still want to reference the [Pluralmind Docs](https://docs.pluralmind.chat/) for guides, as well as a full [API Reference](https://docs.pluralmind.chat/api/).

This Python library is a very close port of the JavaScript one, so most of the concepts and types still apply.

## Installation

With pip (or your favorite package manager):

```bash
pip install pluralmind
```

(Note: Python 3.12+ is required. Everything is fully typed~!)

## Integrating Pluralmind

<!-- fmt: off -->
```python
from pluralmind import AsyncPluralmindClient, get_proxied_message

client = AsyncPluralmindClient()

# Let's imagine a new message just came in from someone!
# We'll start by pulling up their system's information. You can pass in their numeric Twitch user ID, or their username/handle.
system = await client.get_system('leahinmoonlight')

# Great! Now let's see if this is a proxied message.
pm = get_proxied_message(system, 'L: hihi chat~')
if pm:
    print(pm['member']['name'])  # "Leah"
    print(pm['color'])           # "#eb97ca"
    print(pm['pronouns'])        # "she/her"
    print(pm['body'])            # "hihi chat~" (the proxy was removed)
    # That's it! You can use this data to address this member appropriately.
```
<!-- fmt: on -->

> [!IMPORTANT]
> Be sure to reuse one `AsyncPluralmindClient` instance, rather than creating a new one every time. This will ensure cache management works properly.
