How to use the splitwise.category.Category 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 / expense.py View on Github external
self.next_repeat = data["next_repeat"]
            self.details = data["details"]
            self.comments_count = data["comments_count"]
            self.payment = data["payment"]
            self.creation_method = data["creation_method"]
            self.transaction_method = data["transaction_method"]
            self.transaction_confirmed = data["transaction_confirmed"]
            self.cost = data["cost"]
            self.currency_code = data["currency_code"]
            self.created_by = User(data["created_by"])
            self.date = data["date"]
            self.created_at = data["created_at"]
            self.updated_at = data["updated_at"]
            self.deleted_at = data["deleted_at"]
            self.receipt = Receipt(data["receipt"])
            self.category = Category(data["category"])

            if data["updated_by"] is not None:
                self.updated_by = User(data["updated_by"])
            else:
                self.updated_by = None

            if data["deleted_by"] is not None:
                self.deleted_by = User(data["deleted_by"])
            else:
                self.deleted_by = None

            if "friendship_id" in data:
                self.friendship_id = data["friendship_id"]
            else:
                self.friendship_id = None
github namaggarwal / splitwise / splitwise / __init__.py View on Github external
def getCategories(self):
        """ Gets the list of categories in Splitwise.

        Returns:
            :obj:`list` of :obj:`splitwise.category.Category`: List of Category
        """
        content = self.__makeRequest(Splitwise.GET_CATEGORY_URL)
        content = json.loads(content)
        categories = []

        if "categories" in content:
            for c in content["categories"]:
                categories.append(Category(c))

        return categories
github namaggarwal / splitwise / splitwise / category.py View on Github external
def __init__(self,data=None):
        if data:
            self.id = data["id"]
            self.name = data["name"]
            self.subcategories = []
            if "subcategories" in data:
                for sub in data["subcategories"]:
                    self.subcategories.append(Category(sub))