MambuPy.rest.mambutask

Mambu Task objects.

MambuTask holds a task. Look at MambuTask pydoc for further info.

Uses mambugeturl.gettasksurl as default urlfunc

Classes

MambuTask([urlfunc, entid])

A Task from Mambu.

MambuTasks([urlfunc, entid])

A list of Tasks from Mambu.

class MambuPy.rest.mambutask.MambuTask(urlfunc=<function gettasksurl>, entid='', *args, **kwargs)[source]

Bases: MambuStruct

A Task from Mambu.

Don’t instantiate this class directly. It’s mostly used by MambuTasks to configure each of its elements as MambuTask objects. There’s no suitable urlfunc to use to retrieve just a specific transaction from a loan account. In fact, you can look at the code of MambuTasks.convert_dict_to_attrs(), it uses urlfunc and entid = None , so no connection to Mambu will be made, never, for any particular MambuTask object.

__init__(urlfunc=<function gettasksurl>, entid='', *args, **kwargs)[source]

Tasks done here:

Just initializes the MambuStruct.

__module__ = 'MambuPy.rest.mambutask'
__repr__()[source]

Instead of the default id given by the parent class, shows the id, title, dueDate, status of the task.

close(*args, **kwargs)[source]
create(data, *args, **kwargs)[source]

Create a task in Mambu

Parameters -data dictionary with data to send

preprocess()[source]

Preprocessing.

Flattens the object. When .creat[ed]() the data comes on the ‘task’ dictionary inside of the response. Instead, every element of the ‘task’ dictionary is taken out to the main attrs dictionary, since GET response comes in that format.

class MambuPy.rest.mambutask.MambuTasks(urlfunc=<function gettasksurl>, entid='', *args, **kwargs)[source]

Bases: MambuStruct

A list of Tasks from Mambu.

__init__(urlfunc=<function gettasksurl>, entid='', *args, **kwargs)[source]

Initializes a new Mambu object.

Parameters:
  • urlfunc (str) – is the only required parameter. The urlfunc returns a string of the URL to make a request to Mambu. You may read about the valid urlfuncs supported by MambuPy at mambuutil.py

  • entid (str) – is the usual ID of a Mambu entity you like to GET from Mambu. The ID of a loan account, a client, a group, etc. Or the transactions or repayments of certain loan account. It’s an optional parameter because the iterable Mambu objects don’t need an specific ID, just some other filtering parameters supported on the urlfunc function.

If you send a None urlfunc, the object will be configured, but won’t connect to Mambu, never. Useful for iterables that configure their elements but can’t or won’t need Mambu to send further information. See mamburepayment.MambuRepayments for an example of this.

Should you need to add support for more functionality, add them at mambuutuil.

Many other arguments may be sent here to further configure the Mambu object or the response by Mambu REST API:

  • debug flag (currently not implemented, just stored on the object)

  • connect flag, to optionally omit the connection to Mambu (see the init() (with no underscores) method pydoc)

  • data parameter for POST requests (see connect() method pydoc)

  • date_format parameter (see util_date_format() method pydoc)

Also, parameters to be sent to Mambu on the request, such as:

  • limit parameter (for pagination, see connect() method pydoc). If 0 (default) tells connect to auto-paginate. All else is used as given for manual pagination (all along with the offset argument too)

  • offset parameter (for pagination, see connect() method pydoc)

  • fullDetails, accountState and other filtering parameters (see mambuutil pydocs)

  • user, password, url to connect to Mambu, to bypass mambuconfig configurations (see mambuutil pydoc)

__iter__()[source]
__module__ = 'MambuPy.rest.mambutask'
convert_dict_to_attrs(*args, **kwargs)[source]

The trick for iterable Mambu Objects comes here:

You iterate over each element of the responded List from Mambu, and create a Mambu Task object for each one, initializing them one at a time, and changing the attrs attribute (which just holds a list of plain dictionaries) with a MambuTask just created.