Skip to main content

aioxmlrpc

https://github.com/mardiros/aioxmlrpc/actions/workflows/tests.yml/badge.svg https://codecov.io/gh/mardiros/aioxmlrpc/branch/master/graph/badge.svg?token=BR3KttC9uJ

Asyncio version of the standard lib xmlrpc

aioxmlrpc.client, which works like xmlrpc.client but uses coroutines, has been implemented.

aioxmlrpc.client is based on httpx for the transport, and just patch the necessary from the python standard library to get it working.

aioxmlrpc.server, which works much like xmlrpc.server, but runs on the asyncio event loop and handles remote procedure calls (RPC) using both regular functions and coroutines.

aioxmlrpc.server is based on starlette and uvicorn for handling HTTP.

Installation

aioxmlrpc is available on PyPI, it can simply be installed with your favorite tool, example with pip here.

pip install aioxmlrpc

The server dependencies is installed using the extra syntax.

pip install "aioxmlrpc[server]"

Getting Started

Client

This example show how to print the current version of the Gandi XML-RPC api.

import asyncio
from aioxmlrpc.client import ServerProxy


async def print_gandi_api_version():
    api = ServerProxy('https://rpc.gandi.net/xmlrpc/')
    result = await api.version.info()
    print(result)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(print_gandi_api_version())
    loop.stop()

Run the example

uv run examples/gandi_api_version.py

Server

This example show an exemple of the server side.

import asyncio
from aioxmlrpc.server import SimpleXMLRPCServer


class Api:
   def info(self):
      return "1.0.0"

   async def sleep(self):
      await asyncio.sleep(1)
      return "done"


async def main():
   server = SimpleXMLRPCServer(("0.0.0.0", 8080))
   server.register_instance(Api(), allow_dotted_names=True)
   await server.serve_forever()


if __name__ == "__main__":
   asyncio.run(main())

Metadata

Release files for aioxmlrpc 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioxmlrpc 0.10.0
File Size Uploaded
aioxmlrpc-0.10.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioxmlrpc 0.10.0
File Interpreter ABI Platform
aioxmlrpc-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / aioxmlrpc-0.10.0.tar.gz

Download URL aioxmlrpc-0.10.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b948cd8e256240ed3f1bc1288f79a90d30c754e915962d0d6d6a17e93337452b
BLAKE2b-256 checksum
How to use checksums
26c41c823de8353cd67f59470d46b606b447d22f69be135432afd91a9bf6bc0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.24.0 CPython/3.12.10 Linux/6.8.0-1021-azure

Release files / aioxmlrpc-0.10.0-py3-none-any.whl

Download URL aioxmlrpc-0.10.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
334ea045e4475bf30a768e77ef299e104f7fac42dd7e28d995dc714e7d94b82e
BLAKE2b-256 checksum
How to use checksums
053b7b25e15be0e6a4855ecfad93f5c959606d1df2f6c4c247fb8ff7afe0bf2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.24.0 CPython/3.12.10 Linux/6.8.0-1021-azure

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page