pyweb-moderator-api


Namepyweb-moderator-api JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/pywebsol
SummaryLibrary for using the API for PyWeb AI Moderator.
upload_time2024-03-22 12:48:57
maintainerNone
docs_urlNone
authorpywebsol
requires_python>=3.6
licenseNone
keywords antispam moderator ai api pyweb pywebsol
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### 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:

```python
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:

```python
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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pywebsol",
    "name": "pyweb-moderator-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "antispam moderator ai api pyweb pywebsol",
    "author": "pywebsol",
    "author_email": "pywebsolutions.ru@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/77/4d/9c154d75c3b0186a521a280aeb2a52456d8036fc16e525689dd8c605c657/pyweb_moderator_api-1.2.0.tar.gz",
    "platform": null,
    "description": "### PyWebSolutions API Python Library\n\nThis 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.\n\n## Usage\nSynchronous API:\n\n```python\nimport pyweb_moderator_api\n\ntext = \"Example text\"\n\nwith pyweb_moderator_api.SyncAPI(token=\"your_api_token\") as client:\n    result = client.getClass(text=text, model=\"bert\")\n\ntext_class = result.text_class\ntime_taken = result.time_taken\nconfidence = result.confidence\nunique_id = result.unique_id\nbalance = result.balance\nlabel = result.label\n\nprint(f\"\u041a\u043b\u0430\u0441\u0441 \u0442\u0435\u043a\u0441\u0442\u0430: {text_class}\\n\u041c\u0435\u0442\u043a\u0430: {label}\\n\u0411\u044b\u043b\u043e \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: {time_taken}\\n\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c: {confidence}\\n\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: {unique_id}\\n\u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0431\u0430\u043b\u0430\u043d\u0441: {balance}\")\n```\n\nAsynchronous API:\n\n```python\nimport pyweb_moderator_api\nimport asyncio\n\nasync def main():\n    text = \"Example text\"\n\n    async with pyweb_moderator_api.AsyncAPI(token=\"your_api_token\") as client:\n        result = await client.getClass(text=text, model=\"bert\")\n\n    text_class = result.text_class\n    time_taken = result.time_taken\n    confidence = result.confidence\n    unique_id = result.unique_id\n    balance = result.balance\n    label = result.label\n\n    print(f\"\u041a\u043b\u0430\u0441\u0441 \u0442\u0435\u043a\u0441\u0442\u0430: {text_class}\\n\u041c\u0435\u0442\u043a\u0430: {label}\\n\u0411\u044b\u043b\u043e \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: {time_taken}\\n\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c: {confidence}\\n\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: {unique_id}\\n\u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0431\u0430\u043b\u0430\u043d\u0441: {balance}\")\n\nasyncio.run(main())\n```\n\nReplace \"your_api_token\" with your actual API key from telegram bot https://t.me/RuModeratorAI_API_Bot.\n\nAPI endpoint URL: http://pywebsolutions.ru:30\nAPI documentation: http://pywebsolutions.ru:30/docs\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Library for using the API for PyWeb AI Moderator.",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/pywebsol",
        "Telegram": "https://t.me/RuModeratorAI_API_Bot"
    },
    "split_keywords": [
        "antispam",
        "moderator",
        "ai",
        "api",
        "pyweb",
        "pywebsol"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a22690ffd8690c7c35806435cbdc0dcb0a2a9d3f44bd6025de22191a64d79707",
                "md5": "adc49143d39d11181242580dad344a70",
                "sha256": "571eb3486796f55da27460493222db4c333a4586e0fec6c92826978fc93f6c83"
            },
            "downloads": -1,
            "filename": "pyweb_moderator_api-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "adc49143d39d11181242580dad344a70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4359,
            "upload_time": "2024-03-22T12:48:56",
            "upload_time_iso_8601": "2024-03-22T12:48:56.111473Z",
            "url": "https://files.pythonhosted.org/packages/a2/26/90ffd8690c7c35806435cbdc0dcb0a2a9d3f44bd6025de22191a64d79707/pyweb_moderator_api-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "774d9c154d75c3b0186a521a280aeb2a52456d8036fc16e525689dd8c605c657",
                "md5": "c6b2d3cd05a80c77bb2a12face30822d",
                "sha256": "c553ccaac7193d2efcb9953842f8f4e8d4f76887e7071c2221172129fd5898bc"
            },
            "downloads": -1,
            "filename": "pyweb_moderator_api-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c6b2d3cd05a80c77bb2a12face30822d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3227,
            "upload_time": "2024-03-22T12:48:57",
            "upload_time_iso_8601": "2024-03-22T12:48:57.195693Z",
            "url": "https://files.pythonhosted.org/packages/77/4d/9c154d75c3b0186a521a280aeb2a52456d8036fc16e525689dd8c605c657/pyweb_moderator_api-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 12:48:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyweb-moderator-api"
}
        
Elapsed time: 3.86147s