ERPpeek is a versatile tool that can be used both as an interactive Command-line Interface (CLI) and as a Python library, with a more convenient API than the one provided by xmlrpclib. It is available from the PyPi index and can be installed with the following:

$ pip install -U erppeek

On a Unix system, if you are installing it system wide, you might need to prepend sudo to the command.

The ERPpeek library provides a programming interface, wrapping around xmlrpclib, which is similar to the programming interface we have for the server-side code.

Our point here is to provide a glimpse of what the ERPpeek library has to offer, and not to provide a full explanation of all its features.

We can start by reproducing our first steps with xmlrpclib using the erppeek as follows:

>>> import erppeek
>>> api = erppeek.Client('http://localhost:8069', 'todo','admin', 'admin')
>>> api.common.version()
>>> api.count('res.partner', [])
>>> api.search('res.partner', [('country_id', '=', 'be'),      ('parent_id', '!=', False)])
>>> api.read('res.partner', [44], ['id', 'name', 'parent_id'])

As you can see, the API calls use fewer arguments and are similar to the server-side counterparts.

But ERPpeek doesn't stops here, and also provides a representation for models. We have the following two alternative ways to get an instance for a model, either using the model() method or accessing it as a camel case attribute name:

>>> m = api.model('res.partner')
>>> m = api.ResPartner

Now we can perform actions on that model as follows:

>>> m.count([('name', 'like', 'Packt%')])
1
>>> m.search([('name', 'like', 'Packt%')])
[44]

It also provides client-side object representation for records as follows:

>>> recs = m.browse([('name', 'like', 'Packt%')])
>>> recs
<RecordList 'res.partner,[44]'>
>>> recs.name
['Packt Publishing']

As you can see, erppeek library goes a long way from plain xmlrpclib, and makes it possible to write code that can be reused server side with little or no modification.