WRaThioN


NameWRaThioN JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/KimEJ/WRaThioN
SummaryWRaThioN: WRTN Client For Python
upload_time2023-10-19 09:02:57
maintainer
docs_urlNone
authorkimuj5090
requires_python>=3
licenseMIT
keywords wrtn wrathion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # WRaThioN: WRTN Client For Python

> [!WARNING]
> This is an **unofficial** client.
> This package **does not** take into account [WRTN](https://wrtn.ai)'s terms and conditions.
> Any dispute with WRTN regarding the terms and conditions is **entirely your responsibility**.

## Installation

```bash
$ pip install WRaThioN
```

## Usage

## Requirements
- Python3 or newer
- [WRTN Account](https://wrtn.ai)

## Get Cookies

To use WRaThioN, you need a refresh token and an id called '__w_id' in the cookie.

You can retrieve cookies from [WRTN](https://wrtn.ai) as follows:
1. Go to [WRTN](https://wrtn.ai).
1. Log in with your WRTN account.
1. Open developer tools in your browser (usually by pressing 'F12').
1. You can view all cookies associated with 'https://wrtn.ai' by selecting the 'Application' tab and clicking on the 'Cookies' option.
1. Find the '__w_id' and 'refresh_token' cookies and click on them to expand their details.
1. Copy the value of each cookie.

## Use Prompt

```bash
$ python3 -m WRaThioN --help
usage: WRaThioN.py [-h] [--token TOKEN] [--id ID]

WRTN AI Prompt

options:
  -h, --help     show this help message and exit
  --token TOKEN  refresh token
  --id ID        wrtn id(__w_id)
```

## Example

```python
from WRaThioN import WRaThioN
import argparse

def main() -> None:
    client = WRaThioN(args.token, args.id)

    client.create_chat()
    while True:
        prompt = input("You: ")

        if prompt == "!reset":
            client.create_chat()
            continue
        elif prompt == "!exit":
            client.delete_chat()
            break

        print("Bot: ", end="", flush=True)
        response = client.chat(prompt)
        print(response['message']['content'], end="", flush=True)
        print("\n")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='WRTN AI Prompt')
    parser.add_argument('--token', type=str, help='refresh token')
    parser.add_argument('--id', type=str, help='wrtn id(__w_id))')

    args = parser.parse_args()
    
    main()
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/KimEJ/WRaThioN",
    "name": "WRaThioN",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "WRTN,WRaThioN",
    "author": "kimuj5090",
    "author_email": "kimuj5090@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# WRaThioN: WRTN Client For Python\r\n\r\n> [!WARNING]\r\n> This is an **unofficial** client.\r\n> This package **does not** take into account [WRTN](https://wrtn.ai)'s terms and conditions.\r\n> Any dispute with WRTN regarding the terms and conditions is **entirely your responsibility**.\r\n\r\n## Installation\r\n\r\n```bash\r\n$ pip install WRaThioN\r\n```\r\n\r\n## Usage\r\n\r\n## Requirements\r\n- Python3 or newer\r\n- [WRTN Account](https://wrtn.ai)\r\n\r\n## Get Cookies\r\n\r\nTo use WRaThioN, you need a refresh token and an id called '__w_id' in the cookie.\r\n\r\nYou can retrieve cookies from [WRTN](https://wrtn.ai) as follows:\r\n1. Go to [WRTN](https://wrtn.ai).\r\n1. Log in with your WRTN account.\r\n1. Open developer tools in your browser (usually by pressing 'F12').\r\n1. You can view all cookies associated with 'https://wrtn.ai' by selecting the 'Application' tab and clicking on the 'Cookies' option.\r\n1. Find the '__w_id' and 'refresh_token' cookies and click on them to expand their details.\r\n1. Copy the value of each cookie.\r\n\r\n## Use Prompt\r\n\r\n```bash\r\n$ python3 -m WRaThioN --help\r\nusage: WRaThioN.py [-h] [--token TOKEN] [--id ID]\r\n\r\nWRTN AI Prompt\r\n\r\noptions:\r\n  -h, --help     show this help message and exit\r\n  --token TOKEN  refresh token\r\n  --id ID        wrtn id(__w_id)\r\n```\r\n\r\n## Example\r\n\r\n```python\r\nfrom WRaThioN import WRaThioN\r\nimport argparse\r\n\r\ndef main() -> None:\r\n    client = WRaThioN(args.token, args.id)\r\n\r\n    client.create_chat()\r\n    while True:\r\n        prompt = input(\"You: \")\r\n\r\n        if prompt == \"!reset\":\r\n            client.create_chat()\r\n            continue\r\n        elif prompt == \"!exit\":\r\n            client.delete_chat()\r\n            break\r\n\r\n        print(\"Bot: \", end=\"\", flush=True)\r\n        response = client.chat(prompt)\r\n        print(response['message']['content'], end=\"\", flush=True)\r\n        print(\"\\n\")\r\n\r\nif __name__ == \"__main__\":\r\n    parser = argparse.ArgumentParser(description='WRTN AI Prompt')\r\n    parser.add_argument('--token', type=str, help='refresh token')\r\n    parser.add_argument('--id', type=str, help='wrtn id(__w_id))')\r\n\r\n    args = parser.parse_args()\r\n    \r\n    main()\r\n```\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "WRaThioN: WRTN Client For Python",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/KimEJ/WRaThioN"
    },
    "split_keywords": [
        "wrtn",
        "wrathion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d871c67c2e9071e7aefff1848f1c73a2716c52c20ce1f0508b925f41364fb2fa",
                "md5": "64b05aaf7779426e2d0b9698e20dbdb2",
                "sha256": "e330339ea4dbef36a59ea4a129840853dbe4f0fba1a9149161d39e85839639e9"
            },
            "downloads": -1,
            "filename": "WRaThioN-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64b05aaf7779426e2d0b9698e20dbdb2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 4625,
            "upload_time": "2023-10-19T09:02:57",
            "upload_time_iso_8601": "2023-10-19T09:02:57.669713Z",
            "url": "https://files.pythonhosted.org/packages/d8/71/c67c2e9071e7aefff1848f1c73a2716c52c20ce1f0508b925f41364fb2fa/WRaThioN-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-19 09:02:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KimEJ",
    "github_project": "WRaThioN",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "wrathion"
}
        
Elapsed time: 0.12476s