https://github.com/thrzl/perspective
a python library for interacting with google's perspective api
https://github.com/thrzl/perspective
perspective perspective-api python python3
Last synced: 8 months ago
JSON representation
a python library for interacting with google's perspective api
- Host: GitHub
- URL: https://github.com/thrzl/perspective
- Owner: thrzl
- License: mit
- Created: 2023-02-24T02:44:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T00:59:53.000Z (about 2 years ago)
- Last Synced: 2025-04-23T18:13:46.573Z (about 1 year ago)
- Topics: perspective, perspective-api, python, python3
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ð perspective
a strongly typed wrapper for google's perspective api
## ðĶ installation
```sh
pip install perspectiveapi
```
## ðŠī example
### async
```py
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
```py
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)
```