Skip to main content

API wrapper for the pronoundb.org API.

Project description

PronounDB Python API

PyPI PyPI - Python Version PyPI - License

API wrapper for the pronoundb.org API.

Installation

pip install pronoundb

Examples

lookup someone's pronouns by their discord id:

from pronoundb import lookup, Platform

lookup(Platform.DISCORD, 123456789012345678)
# -> {123456789012345678: ["he", "him"]}

lookup someone's pronouns by their minecraft (java) uuid:

from pronoundb import lookup, Platform

lookup(Platform.MINECRAFT, "12345678-1234-1234-1234-123456789012")
# -> {"12345678-1234-1234-1234-123456789012": ["they", "them"]}

lookup multiple users pronouns by their discord id:

from pronoundb import lookup, Platform

lookup(Platform.DISCORD, [123456789012345678, 987654321098765432])
# -> {123456789012345678: ["he", "him"], 987654321098765432: ["she", "her"]}

Supported Platforms

  • Discord
  • GitHub
  • Minecraft (Java)
  • Twitch
  • Twitter

Custom Pronouns (Version 2.0.0)

Beginning with version 2.0.0, you can give the lookup function a list of pronouns to translate them, for example.

from pronoundb import lookup, Platform

lookup(Platform.DISCORD, 123456789012345678, {
    "unspecified": [],
    "he": ["Er", "Ihn"],
    "she": ["Sie", "Ihr"],
    "it": ["Es", "Seine"],
    "they": ["They", "Them"],
    "any": ["Jede"],
    "other": ["Anderes"],
    "ask": ["Frag"],
    "avoid": ["Nutz Name"],
})
# -> {123456789012345678: ["Er", "Ihn"]}

Contributing

Contributions to this library are always welcome and highly encouraged.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pronoundb-2.0.4.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

pronoundb-2.0.4-py3-none-any.whl (4.3 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