news / Developer

RPC made even easier

The KDE client provides libraries that developers can use to create applications while relying on the OpenObject server for data storage and management. This article focuses on the RPC library.

XML-RPC is straightforward to use from Python, but Net-RPC offers better performance. Koo’s RPC library hides the underlying protocol and provides a simple interface, including asynchronous queries that keep the user interface responsive while requests run in the background.

The API was undergoing cleanup at the time, including renaming the old ktiny namespace to Koo (KDE OpenObject).

A synchronous example:

```python import Koo.Rpc session = Koo.Rpc.Session() session.login('http://admin:admin@localhost:8069', 'database')

Or: session.login('socket://admin:admin@localhost:8069', 'database')

session.call('/object', 'execute', 'res.partner', 'search', [('name', 'ilike', 'NaN')]) session.logout() ```

GUI applications can instead use asynchronous calls so that network operations do not block the interface.