Skip to content

a python library for interacting with google's perspective api

License

Notifications You must be signed in to change notification settings

thrzl/perspective

Repository files navigation

💖 perspective

a strongly typed wrapper for google's perspective api

📦 installation

pip install perspectiveapi

🪴 example

async

from perspective import Perspective, Attribute

p = Perspective(key="...")

async def main():
    s = await p.score(
        "your message here", attributes=(Attribute.FLIRTATION, Attribute.SEVERE_TOXICITY)
    )
    print(s.flirtation) 
    print(s.severe_toxicity)

blocking

from perspective.blocking import Perspective, Attribute

p = Perspective(key="...")

def main():
    s = p.score(
        "your message here", attributes=(Attribute.FLIRTATION, Attribute.SEVERE_TOXICITY)
    )
    print(s.flirtation) 
    print(s.severe_toxicity)

About

a python library for interacting with google's perspective api

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages