{"id":20624491,"url":"https://github.com/n3tc4t/python-xrpl-websocket","last_synced_at":"2025-10-24T15:47:50.543Z","repository":{"id":55618639,"uuid":"220718114","full_name":"N3TC4T/python-xrpl-websocket","owner":"N3TC4T","description":"XRPL Python Websocket Client","archived":false,"fork":false,"pushed_at":"2021-08-10T19:46:54.000Z","size":56,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T18:45:49.834Z","etag":null,"topics":["python","ripple","websocket","xrp-ledger"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N3TC4T.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-09T23:44:51.000Z","updated_at":"2024-01-19T10:26:49.000Z","dependencies_parsed_at":"2022-08-15T04:40:15.521Z","dependency_job_id":null,"html_url":"https://github.com/N3TC4T/python-xrpl-websocket","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3TC4T%2Fpython-xrpl-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3TC4T%2Fpython-xrpl-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3TC4T%2Fpython-xrpl-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N3TC4T%2Fpython-xrpl-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N3TC4T","download_url":"https://codeload.github.com/N3TC4T/python-xrpl-websocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249081606,"owners_count":21209728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","ripple","websocket","xrp-ledger"],"created_at":"2024-11-16T12:33:00.642Z","updated_at":"2025-10-24T15:47:45.520Z","avatar_url":"https://github.com/N3TC4T.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nXRPL Websocket\n==============\n\n.. image:: https://readthedocs.org/projects/xrpl-websocket/badge/?version=latest\n    :target: https://xrpl-websocket.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://badge.fury.io/py/xrpl-websocket.svg\n    :target: https://badge.fury.io/py/xrpl-websocket\n\n================\n      \nWebsocket client for rippled with reconnecting feature, support both python 2 and 3\n\nInstallation\n============\n\nVia pip:\n\n.. code-block:: bash\n\n    pip install xrpl_websocket\n    \nExamples\n========\n\nShort-lived connection\n----------------------\nSimple example to send a payload and wait for response\n\n.. code:: python\n\n    import json\n\n    from xrpl_websocket import Client\n\n    if __name__ == \"__main__\":\n        # create instance\n        client = Client()\n\n        # connect to the websocket\n        client.connect(nowait=False)\n\n        # send server info command\n        resp = client.send(command='server_info')\n\n        print(\"Server Info:\")\n        print(json.dumps(resp, indent = 4))\n\n        # close the connection\n        client.disconnect()\n\nMore advanced: Custom class\n---------------------------\nYou can also write your own class for the connection, if you want to handle the nitty-gritty details yourself.\n\n.. code:: python\n\n    class Example(Client):\n        def __init__(self):\n            super(self.__class__, self).__init__(\n                log_level=logging.ERROR,\n                server=\"wss://xrpl.ws\"\n            )\n\n            # connect to the websocket\n            self.connect()\n\n        def on_transaction(self, data):\n            print(json.dumps(data, indent = 4))\n\n        def on_ledger(self,data):\n            print('on_ledger')\n\n        def on_open(self, connection):\n            print(\"Connection is open\")\n\n            print(\"Subscribe to ledger transactions\")\n            self.subscribe_transactions()\n\n\n        def on_close(self):\n            print(\"on_close\")\n\n        def subscribe_transactions(self):\n            self.send({\n                'command': 'subscribe',\n                'streams': ['transactions']\n            })\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3tc4t%2Fpython-xrpl-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn3tc4t%2Fpython-xrpl-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn3tc4t%2Fpython-xrpl-websocket/lists"}