How to use the splitwise.balance.Balance function in splitwise

To help you get started, we’ve selected a few splitwise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github namaggarwal / splitwise / splitwise / user.py View on Github external
"""
          Args:
              data(:obj:`json`, optional): JSON object representing friend user object
        """
        User.__init__(self, data)

        if data:
            if 'updated_at' in data:
                self.updated_at = data["updated_at"]
            else:
                self.updated_at = None

            self.balances = []

            for balance in data["balance"]:
                self.balances.append(Balance(balance))

            self.groups = []
            if "groups" in data:
                for group in data["groups"]:
                    self.groups.append(Group.FriendGroup(group))
            else:
                self.groups = None
github namaggarwal / splitwise / splitwise / group.py View on Github external
def __init__(self,data=None):

        self.id = data["group_id"]
        self.balances = []
        for balance in data["balance"]:
            self.balances.append(Balance(balance))