First release of Proteus

ced cedric.krier at
Mon Jan 3 20:05:26 CET 2011

Proteus is a Python library to access Tryton [1] server.  (Tryton is a
three-tiers high-level general purpose application platform)

It can be used through XML-RPC or by using trytond as module and
provides an
Active Record pattern enabling you to interact pythonically with your

Its common usages are:
    - scripting for automatic actions
    - scenario testing
    - automatic setup
    - basement for a CLI (with iPython, bpython etc.)
    - basement for a minimal client

Here is some example usage:

At first you import the necessary functions

    >>> from proteus import config, Model, Wizard

Then you can create a database and install the `party` module into it

    >>> config = config.set_trytond(':memory:',
    >>> Module = Model.get('ir.module.module')
    >>> party, = Module.find([('name', '=', 'party')])
    >>> Module.button_install([], config.context)
    >>> Wizard('ir.module.module.install_upgrade').execute('start')

We will then create a party, set her name and even her language

    >>> Party = Model.get('')
    >>> party = Party()
    >>> = 'ham'
    >>> > 0

Notice how addresses (which are a One2Many field for the party model)
handled just like Python list objects:

    >>> Address = Model.get('party.address')
    >>> address = Address()
    >>> party.addresses.append(address)
    >>> party.addresses #doctest: +ELLIPSIS

More on


More information about the Python-announce-list mailing list