How to use the splitwise.user.User.__init__ 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
def __init__(self, data=None):
        """
          Args:
              data(:obj:`json`, optional): JSON object representing user object
        """
        if data:
            User.__init__(self, data["user"])

            self.paid_share = data["paid_share"]
            self.owed_share = data["owed_share"]
            self.net_balance = data["net_balance"]
github namaggarwal / splitwise / splitwise / user.py View on Github external
def __init__(self, data=None):
        """
          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))
github namaggarwal / splitwise / splitwise / user.py View on Github external
def __init__(self, data=None):
        """
          Args:
              data(:obj:`json`, optional): JSON object representing current user object
        """
        User.__init__(self, data)
        self.default_currency = data["default_currency"]
        self.locale = data["locale"]
        self.date_format = data["date_format"]
        self.default_group_id = data["default_group_id"]