Now that we know the different components of a model, it is time to examine how they can be practically defined. This section examines a python definition of a model, and the next section will show how this can be done equivalently in a xml-file.
A PyModel is a python module that defines a variable model that is of type PyModel.Model. Objects of type Model collect all information about their entities, as a list of objects of type Entity. Similarly, entities collect objects defining attributes and relationships. A model instance may also define bi-directional relationships as associations. The python classes for each of these is described below. To reduce boilerplate code, PyModels allow defaults to be specified for all values. Furthermore, sub-types for frequently used constructs are provided, and others may of course be defined as necessary.