Skip to main content

a python wrapper for google's perspective api

Project description

💖 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.all())
    )
    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.all())
    )
    print(s.flirtation) 
    print(s.severe_toxicity)

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

perspectiveapi-1.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perspectiveapi-1.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file perspectiveapi-1.1.0.tar.gz.

File metadata

  • Download URL: perspectiveapi-1.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for perspectiveapi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 20aba1e1f1e4ae507df45d2fc6111175c8ad1c0e80dfe40c97fecfe27fd17066
MD5 0f0ab80e061ab0a30f4293545912194a
BLAKE2b-256 69daa8507d2ca382bb2e751818a4252a0fd7b453a68efa546e7c21c9e7624f43

See more details on using hashes here.

File details

Details for the file perspectiveapi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: perspectiveapi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for perspectiveapi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b12fff4fbc7403eaa52b018c0fbc407fcd7ddddbf5d5ac8aafab0274f11785
MD5 a1df3039c0775a65bfcca387181491a3
BLAKE2b-256 32792d784e16d84632a2e1f3fc2d68fee28a63c10e8def79137c76da88204e86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page