Library for using the API for PyWeb AI Moderator.
Project description
PyWebSolutions API Python Library
This is a Python library for interacting with the PyWeb Moderator API. The library provides both synchronous and asynchronous methods for making requests to the PyWeb Moderator API, allowing you to easily integrate PyWebSolutions functionality into your Python applications.
Usage
Synchronous API:
import pyweb_moderator_api
text = "Example text"
with pyweb_moderator_api.SyncAPI(token="your_api_token") as client:
result = client.getClass(text=text, model="bert")
text_class = result.text_class
time_taken = result.time_taken
confidence = result.confidence
unique_id = result.unique_id
balance = result.balance
label = result.label
print(f"Класс текста: {text_class}\nМетка: {label}\nБыло потрачено времени: {time_taken}\nТочность: {confidence}\nИдентификатор: {unique_id}\nОставшийся баланс: {balance}")
Asynchronous API:
import pyweb_moderator_api
import asyncio
async def main():
text = "Example text"
async with pyweb_moderator_api.AsyncAPI(token="your_api_token") as client:
result = await client.getClass(text=text, model="bert")
text_class = result.text_class
time_taken = result.time_taken
confidence = result.confidence
unique_id = result.unique_id
balance = result.balance
label = result.label
print(f"Класс текста: {text_class}\nМетка: {label}\nБыло потрачено времени: {time_taken}\nТочность: {confidence}\nИдентификатор: {unique_id}\nОставшийся баланс: {balance}")
asyncio.run(main())
Replace "your_api_token" with your actual API key from telegram bot https://t.me/RuModeratorAI_API_Bot.
API endpoint URL: http://pywebsolutions.ru:30 API documentation: http://pywebsolutions.ru:30/docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyweb_moderator_api-1.2.0.tar.gz
.
File metadata
- Download URL: pyweb_moderator_api-1.2.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c553ccaac7193d2efcb9953842f8f4e8d4f76887e7071c2221172129fd5898bc |
|
MD5 | c6b2d3cd05a80c77bb2a12face30822d |
|
BLAKE2b-256 | 774d9c154d75c3b0186a521a280aeb2a52456d8036fc16e525689dd8c605c657 |
File details
Details for the file pyweb_moderator_api-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyweb_moderator_api-1.2.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 571eb3486796f55da27460493222db4c333a4586e0fec6c92826978fc93f6c83 |
|
MD5 | adc49143d39d11181242580dad344a70 |
|
BLAKE2b-256 | a22690ffd8690c7c35806435cbdc0dcb0a2a9d3f44bd6025de22191a64d79707 |