campaignmonitor/createsend-python

Add default parameters for various API calls

elidickinson opened this issue · 1 comments

Just a suggestion: working with this API has a bit of a learning curve. One easy way to improve the situation would be to add default values to parameters that aren't actually required.

For example, if I just want to change a subscriber's name, it looks something like:

    subscriber.update(None,my_new_name,[],False)

And I had to go study the function to figure out that the first parameter is None because I don't want to change the email, but the third is an empty set because it expects a dictionary for custom fields. Yuck.

It sure would be nice if the update() function defaulted to assuming you always want to change everything about the subscriber at once so I could just do:

    subscriber.update(name=my_new_name)

Same goes for many similar functions. Would there be interest in a pull request?

Hey Eli,

Thanks for the feedback. This library is just designed to map as directly as possible to the Campaign Monitor API itself, but I can definitely see the advantage and elegance of providing default parameters.

Pull requests are obviously welcome, as long as the guidelines for contributing are followed.

Cheers,
James