'Tables are available as attributes by name, e.g., Database.persons.'

def __getattr__(self, k):

    if (k in self.__dict__['tables']):
        return self.__dict__['tables'][k]
    if (k in self.__dict__):
        return self.__dict__[k]
    raise AttributeError(("'Database'    object    has    no    attribute    '%s'" % k))
