unrealircd-rpc-py


Nameunrealircd-rpc-py JSON
Version 3.0.2 PyPI version JSON
download
home_pagehttps://github.com/adator85/unrealircd_rpc_py
SummaryPython library for UnrealIRCd json-rpc
upload_time2025-10-19 19:36:42
maintainerNone
docs_urlNone
authoradator
requires_python>=3.10
licenseMIT
keywords unrealircd irc jsonrpc json-rpc ircd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # UNREALIRCD-RPC-PY
![Static Badge](https://img.shields.io/badge/UnrealIRCd-6.2.2%20or%20later-green)
![Static Badge](https://img.shields.io/badge/Python3-3.10%20or%20later-green)
![Static Badge](https://img.shields.io/badge/Requests->=2.25.1-green)
![Static Badge](https://img.shields.io/badge/Websockets->=13.1-green)
![Dynamic JSON Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fadator85%2Funrealircd_rpc_py%2Fmain%2Fversion.json&query=version&label=Current%20Version)
![Static Badge](https://img.shields.io/badge/Maintained-Yes-green)


## Introduction
If you are using Python3, this package can help you to parse all json responses it does all the work for you.

## How to install this package
```bash
    pip3 install unrealircd_rpc_py
```
> [!NOTE]
> I recommend installing a virtual environment and then installing the package within it.

## How to establish the link
### Using requests module
```python
    from unrealircd_rpc_py.ConnectionFactory import ConnectionFactory

    # Define your connection string
    connection_string = {
        'url': 'https://your.irc.domaine.org:8600/api',
        'username':'API_USERNAME',
        'password':'API_PASSWORD'
    }

    # Use the factory to create your connection object
    conn = ConnectionFactory().get('http')
    conn.setup(connection_string)
```
### Using unixsocket method (Local only)
```python
    from unrealircd_rpc_py.ConnectionFactory import ConnectionFactory

    # Define your connection string
    connection_string = {
        'path_to_socket_file': '/path/to/unrealircd/data/rpc.socket'
        }

    # Use the factory to create your connection object
    conn = ConnectionFactory().get('unixsocket')
    conn.setup(connection_string)
```

## How to work with it
This package allows easy interfacing with UnrealIRCd through regular Python3 code, such as:
```python
    # Enjoy the power of JSON-RPC
    User = conn.User
    response = User.get('adator')

    print(f'Nickname: {response.name}')
    print(f'Ip: {response.ip}')

    Channels = rpc.Channel
    response = Channels.list_(_object_detail_level=3)

    for chan in Channels:
        print(f'-' * 16)
        print(f'Channel: {chan.name}')
        print(f'Created on: {chan.creation_time}')
        print(f'Bans: {chan.bans}')
        print(f'Members: {chan.members}')
        print(f'-' * 16)
```
## Object that you can use in a synchrone mode
```python
    # After connecting using one of the methods listed above.
    rpc = conn
    Channel = rpc.Channel
    Name_ban = rpc.Name_ban
    Server_ban_exception = rpc.Server_ban_exception
    Server_ban = rpc.Server_ban
    Spamfilter = rpc.Spamfilter
    Stats = rpc.Stats
    User = rpc.User
    Whowas = rpc.Whowas
    Log = rpc.Log # This feature requires unrealIRCd 6.1.8 or higher

```

### Live Connection using UnixSocket (Local Only)
```python
    from unrealircd_rpc_py.LiveConnectionFactory import LiveConnectionFactory

    # Live Connection (Local only) using unix socket
    liverpc = LiveConnectionFactory().get('unixsocket')
    liverpc.setup({
        'path_to_socket_file': '/path/to/unrealircd/data/rpc.socket',
        'callback_object_instance' : callback_function_instance,
        'callback_method_or_function_name': 'your_method_name'
    })
```
### Live connection using Websocket (Local or Remote)
```python
    from unrealircd_rpc_py.LiveConnectionFactory import LiveConnectionFactory

    # Live Connection (Local Or Remote) using websocket
    liverpc = LiveConnectionFactory().get('http')
    liverpc.setup({
        'url': 'https://your.irc.domaine.org:8600/api',
        'username': 'Your-api-username',
        'password': 'Your-api-password',
        'callback_object_instance' : callback_function_instance,
        'callback_method_or_function_name': 'your_method_name'
    })
```
# Live Connection via unixsocket or websocket
## How to work with
-  Class: see [how_to_use_it_live_class.py](https://github.com/adator85/unrealircd_rpc_py/blob/main/how_to_use_it_live_class.py)
-  Function: see [how_to_use_it_live_func.py](https://github.com/adator85/unrealircd_rpc_py/blob/main/how_to_use_it_live_func.py)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/adator85/unrealircd_rpc_py",
    "name": "unrealircd-rpc-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "Unrealircd, irc, jsonrpc, json-rpc, ircd",
    "author": "adator",
    "author_email": "debian@deb.biz.st",
    "download_url": "https://files.pythonhosted.org/packages/61/be/e7cdc0aaac1ed6c7be2bc6110497cadf15bccbc27cedb362a45c74ac5da8/unrealircd_rpc_py-3.0.2.tar.gz",
    "platform": null,
    "description": "# UNREALIRCD-RPC-PY\r\n![Static Badge](https://img.shields.io/badge/UnrealIRCd-6.2.2%20or%20later-green)\r\n![Static Badge](https://img.shields.io/badge/Python3-3.10%20or%20later-green)\r\n![Static Badge](https://img.shields.io/badge/Requests->=2.25.1-green)\r\n![Static Badge](https://img.shields.io/badge/Websockets->=13.1-green)\r\n![Dynamic JSON Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fadator85%2Funrealircd_rpc_py%2Fmain%2Fversion.json&query=version&label=Current%20Version)\r\n![Static Badge](https://img.shields.io/badge/Maintained-Yes-green)\r\n\r\n\r\n## Introduction\r\nIf you are using Python3, this package can help you to parse all json responses it does all the work for you.\r\n\r\n## How to install this package\r\n```bash\r\n    pip3 install unrealircd_rpc_py\r\n```\r\n> [!NOTE]\r\n> I recommend installing a virtual environment and then installing the package within it.\r\n\r\n## How to establish the link\r\n### Using requests module\r\n```python\r\n    from unrealircd_rpc_py.ConnectionFactory import ConnectionFactory\r\n\r\n    # Define your connection string\r\n    connection_string = {\r\n        'url': 'https://your.irc.domaine.org:8600/api',\r\n        'username':'API_USERNAME',\r\n        'password':'API_PASSWORD'\r\n    }\r\n\r\n    # Use the factory to create your connection object\r\n    conn = ConnectionFactory().get('http')\r\n    conn.setup(connection_string)\r\n```\r\n### Using unixsocket method (Local only)\r\n```python\r\n    from unrealircd_rpc_py.ConnectionFactory import ConnectionFactory\r\n\r\n    # Define your connection string\r\n    connection_string = {\r\n        'path_to_socket_file': '/path/to/unrealircd/data/rpc.socket'\r\n        }\r\n\r\n    # Use the factory to create your connection object\r\n    conn = ConnectionFactory().get('unixsocket')\r\n    conn.setup(connection_string)\r\n```\r\n\r\n## How to work with it\r\nThis package allows easy interfacing with UnrealIRCd through regular Python3 code, such as:\r\n```python\r\n    # Enjoy the power of JSON-RPC\r\n    User = conn.User\r\n    response = User.get('adator')\r\n\r\n    print(f'Nickname: {response.name}')\r\n    print(f'Ip: {response.ip}')\r\n\r\n    Channels = rpc.Channel\r\n    response = Channels.list_(_object_detail_level=3)\r\n\r\n    for chan in Channels:\r\n        print(f'-' * 16)\r\n        print(f'Channel: {chan.name}')\r\n        print(f'Created on: {chan.creation_time}')\r\n        print(f'Bans: {chan.bans}')\r\n        print(f'Members: {chan.members}')\r\n        print(f'-' * 16)\r\n```\r\n## Object that you can use in a synchrone mode\r\n```python\r\n    # After connecting using one of the methods listed above.\r\n    rpc = conn\r\n    Channel = rpc.Channel\r\n    Name_ban = rpc.Name_ban\r\n    Server_ban_exception = rpc.Server_ban_exception\r\n    Server_ban = rpc.Server_ban\r\n    Spamfilter = rpc.Spamfilter\r\n    Stats = rpc.Stats\r\n    User = rpc.User\r\n    Whowas = rpc.Whowas\r\n    Log = rpc.Log # This feature requires unrealIRCd 6.1.8 or higher\r\n\r\n```\r\n\r\n### Live Connection using UnixSocket (Local Only)\r\n```python\r\n    from unrealircd_rpc_py.LiveConnectionFactory import LiveConnectionFactory\r\n\r\n    # Live Connection (Local only) using unix socket\r\n    liverpc = LiveConnectionFactory().get('unixsocket')\r\n    liverpc.setup({\r\n        'path_to_socket_file': '/path/to/unrealircd/data/rpc.socket',\r\n        'callback_object_instance' : callback_function_instance,\r\n        'callback_method_or_function_name': 'your_method_name'\r\n    })\r\n```\r\n### Live connection using Websocket (Local or Remote)\r\n```python\r\n    from unrealircd_rpc_py.LiveConnectionFactory import LiveConnectionFactory\r\n\r\n    # Live Connection (Local Or Remote) using websocket\r\n    liverpc = LiveConnectionFactory().get('http')\r\n    liverpc.setup({\r\n        'url': 'https://your.irc.domaine.org:8600/api',\r\n        'username': 'Your-api-username',\r\n        'password': 'Your-api-password',\r\n        'callback_object_instance' : callback_function_instance,\r\n        'callback_method_or_function_name': 'your_method_name'\r\n    })\r\n```\r\n# Live Connection via unixsocket or websocket\r\n## How to work with\r\n-  Class: see [how_to_use_it_live_class.py](https://github.com/adator85/unrealircd_rpc_py/blob/main/how_to_use_it_live_class.py)\r\n-  Function: see [how_to_use_it_live_func.py](https://github.com/adator85/unrealircd_rpc_py/blob/main/how_to_use_it_live_func.py)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for UnrealIRCd json-rpc",
    "version": "3.0.2",
    "project_urls": {
        "Homepage": "https://github.com/adator85/unrealircd_rpc_py"
    },
    "split_keywords": [
        "unrealircd",
        " irc",
        " jsonrpc",
        " json-rpc",
        " ircd"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8384f2d55dd7188c1c55bf40c7fe0ca8fb096310150b58df5e66582c370330c0",
                "md5": "c9317e1e66c76819e47dfbb7c7215405",
                "sha256": "47c7b609b9a1779ba6cee7f9c5f00f3491642f270005e2c337b49069a5a0ea19"
            },
            "downloads": -1,
            "filename": "unrealircd_rpc_py-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9317e1e66c76819e47dfbb7c7215405",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 43344,
            "upload_time": "2025-10-19T19:36:41",
            "upload_time_iso_8601": "2025-10-19T19:36:41.464970Z",
            "url": "https://files.pythonhosted.org/packages/83/84/f2d55dd7188c1c55bf40c7fe0ca8fb096310150b58df5e66582c370330c0/unrealircd_rpc_py-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "61bee7cdc0aaac1ed6c7be2bc6110497cadf15bccbc27cedb362a45c74ac5da8",
                "md5": "bb50862cdf28a2a472898d91792de096",
                "sha256": "b8687d6d640f675a51e2d0e815ac8249667ec639c5a550651b3dba3fa4515cdd"
            },
            "downloads": -1,
            "filename": "unrealircd_rpc_py-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "bb50862cdf28a2a472898d91792de096",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 27956,
            "upload_time": "2025-10-19T19:36:42",
            "upload_time_iso_8601": "2025-10-19T19:36:42.424059Z",
            "url": "https://files.pythonhosted.org/packages/61/be/e7cdc0aaac1ed6c7be2bc6110497cadf15bccbc27cedb362a45c74ac5da8/unrealircd_rpc_py-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-19 19:36:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adator85",
    "github_project": "unrealircd_rpc_py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "unrealircd-rpc-py"
}
        
Elapsed time: 4.03907s