References¶
This part of the documentation covers all the interfaces of Splitwise.
Main Interface¶
splitwise has a main class Splitwise. All the functionality is provided via this class.
-
class
splitwise.
Splitwise
(consumer_key, consumer_secret, access_token=None, oauth2_access_token=None, api_key=None)[source]¶ The Splitwise class that provides all the functionality.
-
consumer_key
¶ Consumer Key provided by Splitwise.
Type: str
-
consumer_secret
¶ Consumer Secret provided by Splitwise.
Type: str
-
auth
¶ A request.AuthBase object that defines an auth.
Type: requests.AuthBase
, optional
Parameters: - consumer_key (str) – Consumer Key provided by Spliwise
- consumer_secret (str) – Consumer Secret provided by Splitwise
- access_token (
dict
, optional) – Access Token is a combination of oauth_token and oauth_token_secret - oauth2_access_token (
dict
, optional) – OAuth2 Access Token is a combination of access_token and token_type - api_key (str, optional) – API key provided by Splitwise
-
getOAuth2AuthorizeURL
(redirect_uri, state=None)[source]¶ Provides the Authorize URL for end user’s authentication
Returns: - tuple containing:
- auth_url(str): URL that user should be redirected to for authorization
oauth_token_secret(str): Token secret that should be saved to redeem token
Return type: tuple
-
getAuthorizeURL
()[source]¶ Provides the Authorize URL for end user’s authentication
Returns: - tuple containing:
- auth_url(str): URL that user should be redirected to for authorization
oauth_token_secret(str): Token secret that should be saved to redeem token
Return type: tuple
-
getOAuth2AccessToken
(code, redirect_uri)[source]¶ Provides the OAuth1.0 access token
Parameters: - code (str) – code from the query param after redirect
- redirect_uri (str) – Redirect uri specified while getting code
Returns: - dict containing:
access_token(str): The OAuth 2.0 token
token_type(str): The OAuth 2.0 token type
Return type: dict
-
getAccessToken
(oauth_token, oauth_token_secret, oauth_verifier)[source]¶ Provides the OAuth1.0 access token
Parameters: - oauth_token (str) – The OAuth 1.0 token got from the redirect URL
- oauth_token_secret (str) – The OAuth 1.0 token secret got while generating the auth URL
- oauth_verifier (str) – The OAuth 1.0 token verifier got from the redirect URL
Returns: - dict containing:
oauth_token(str): The OAuth 1.0 token
oauth_token_secret(str): The OAuth 1.0 token secret
Return type: dict
-
setAccessToken
(access_token)[source]¶ Sets the OAuth1.0 access token, this should be done to make any authorized calls
Parameters: access_token ( dict
) –dict containing
oauth_token(str): The OAuth 1.0 token
oauth_token_secret(str): The OAuth 1.0 token secret
-
setOAuth2AccessToken
(access_token)[source]¶ Sets the OAuth2.0 access token, this should be done to make any authorized calls
Parameters: access_token ( dict
) –dict containing
access_token(str): The OAuth 2.0 token
token_type(str): The OAuth 2.0 token type
-
getCurrentUser
()[source]¶ Gets the current authorized user’s data
Returns: CurrentUser object containing user data Return type: splitwise.user.CurrentUser
-
getUser
(id)[source]¶ Gets the friends user’s data given the ids
Parameters: id (long) – ID of the user whose information is needed Returns: User object containing user data Return type: splitwise.user.User
-
updateUser
(user)[source]¶ Updates the user.
:param
splitwise.user.CurrentUser
: User object with atleast id setReturns: - tuple containing:
- user(
splitwise.user.CurrentUser
): Object with User detailerrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
getFriends
()[source]¶ Gets the list of users friends.
Returns: List of Friends Return type: list
ofsplitwise.user.Friend
-
getGroups
()[source]¶ Gets the list of groups a user is part of.
Returns: List of Groups Return type: list
ofsplitwise.group.Group
-
getCurrencies
()[source]¶ Gets the list of curriencies in Splitwise.
Returns: List of Currency Return type: list
ofsplitwise.currency.Currency
-
getCategories
()[source]¶ Gets the list of categories in Splitwise.
Returns: List of Category Return type: list
ofsplitwise.category.Category
-
getGroup
(id=0)[source]¶ Gets the detail of particular group a user is part of.
Parameters: id (long, optional) – ID of the group. Default value is 0, and means non-group expenses Returns: Object representing a group Return type: splitwise.group.Group
-
getExpenses
(offset=None, limit=None, group_id=None, friend_id=None, dated_after=None, dated_before=None, updated_after=None, updated_before=None, visible=None)[source]¶ Gets the list of expenses given parameters.
Parameters: - offset (int, optional) – Number of expenses to be skipped
- limit (int, optional) – Number of expenses to be returned
- group_id (long, optional) – GroupID of the expenses
- friend_id (long, optional) – ID of the friend for which expenses are required
- dated_after (str, optional) – ISO 8601 Date time. Return expenses later that this date
- dated_before (str, optional) – ISO 8601 Date time. Return expenses earlier than this date
- updated_after (str, optional) – ISO 8601 Date time. Return expenses updated after this date
- updated_before (str, optional) – ISO 8601 Date time. Return expenses updated before this date
- visible (bool, optional) – Boolean to show only not deleted expenses
Returns: List of Expense
Return type: list
ofsplitwise.expense.Expense
-
getExpense
(id)[source]¶ Gets the detail of the expense given the expense id.
Parameters: id (long, optional) – ID of the expense. Returns: Object representing an expense Return type: splitwise.expense.Expense
-
createExpense
(expense)[source]¶ Creates a new expense.
Parameters: expense ( splitwise.expense.Expense
) – Splitwise Expense Object.Returns: - tuple containing:
- expense(
splitwise.expense.Expense
): Object with Expense detailerrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
updateExpense
(expense)[source]¶ Updates an existing expense.
Parameters: - expense (
splitwise.expense.Expense
) – Splitwise Expense Object. - id must be set. Include only the fields that should be updated. null fields are ignored (expense) –
Returns: - tuple containing:
expense(
splitwise.expense.Expense
): Object with Expense detailerrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
- expense (
-
deleteExpense
(id)[source]¶ Deletes the expense with given id.
Parameters: id (long) – ID of the expense to be deleted. Returns: - tuple containing:
- success(bool): True if group deleted, False otherwise
errors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
createGroup
(group)[source]¶ Creates a new Group.
Parameters: group ( splitwise.group.Group
) – Splitwise Group Object.Returns: - tuple containing:
- group(
splitwise.group.Group
): Object with Group detailerrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
addUserToGroup
(user, group_id)[source]¶ Adds a user to the group.
Parameters: - user (
splitwise.user.User
) – User to be added - group_id (long) – ID of the group
Returns: - tuple containing:
success(bool): True if group deleted, False otherwise
user(
splitwise.user.Friend
): Object representing added user detailserrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
- user (
-
deleteGroup
(id)[source]¶ Deletes the group with given id.
Parameters: id (long) – ID of the group to be deleted. Returns: - tuple containing:
- success(bool): True if group deleted, False otherwise
errors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
getComments
(expense_id)[source]¶ Get expense comments.
Parameters: expense_id (long) – Expense Id Returns: Object representing a comment Return type: splitwise.comment.Comment
-
createComment
(expense_id, content)[source]¶ Creates a new comment.
Parameters: - expense_id – Expense transaction on which a comment has to be made
- content (comment) – Content of the comment
Returns: - tuple containing:
comment(
splitwise.comment.Comment
): Object with Comment detailerrors(
splitwise.error.SplitwiseError
): Object representing errors
Return type: tuple
-
Modals¶
There are several modal objects in this SDK
User¶
-
class
splitwise.user.
User
(data=None)[source]¶ Contains basic user data.
-
id
¶ ID of the user
Type: long, optional
-
first_name
¶ First name of the user
Type: str, optional
-
last_name
¶ Last name of the user
Type: str, optional
-
email
¶ Email of the user
Type: str, optional
-
registration_status
¶ Registration status of the user
Type: str, optional
-
picture
¶ Profile picture of the user
Type: splitwise.picture.Picture
, optional
Parameters: data ( json
, optional) – JSON object representing user object-
getFirstName
()[source]¶ Returns first name of the user
Returns: First name of the user Return type: str
-
getRegistrationStatus
()[source]¶ Returns registration status of the user
Returns: Registration status of the user Return type: str
-
getPicture
()[source]¶ Returns profile picture of the user
Returns: Picture of the user Return type: splitwise.picture.Picture
-
setFirstName
(first_name)[source]¶ Sets the first name of the user
- Agrs:
- first_name(str): First name of the user
-
-
class
splitwise.user.
CurrentUser
(data=None)[source]¶ Represents the current logged in user.
Inherits:
splitwise.user.User
-
default_currency
¶ Default Currency
Type: str, optional
-
locale
¶ Locale
Type: str, optional
-
date_format
¶ Date format used by the user
Type: str, optional
-
default_group_id
¶ User’s default group id
Type: long, optional
Parameters: data ( json
, optional) – JSON object representing current user object-
getDefaultCurrency
()[source]¶ Returns default currency of the user
Returns: Default currency of the user Return type: str
-
-
class
splitwise.user.
Friend
(data=None)[source]¶ Represents a friend user.
Inherits:
splitwise.user.User
-
balances
¶ List of balances
Type: list
ofsplitwise.balance.Balance
, optional
-
groups
¶ List of groups
Type: list
ofsplitwise.group.FriendGroup
, optional
-
updated_at
¶ ISO 8601 Date time. The last updated date time of user
Type: str, optional
Parameters: data ( json
, optional) – JSON object representing friend user object-
getUpdatedAt
()[source]¶ Returns last updated date of the user
Returns: last updated date of the user Return type: str
-
getBalances
()[source]¶ Returns balances of the user
Returns: List of balances Return type: list
ofsplitwise.balance.Balance
-
getGroups
()[source]¶ Returns balances of the user
Returns: List of groups Return type: list
ofsplitwise.group.Group
-
-
class
splitwise.user.
ExpenseUser
(data=None)[source]¶ Represents a user in an expense.
Inherits:
splitwise.user.User
Paid share for the expense
Type: str, optional
Owed share for the expense
Type: str, optional
-
net_balance
¶ Net balance for the expense
Type: str, optional
Parameters: data ( json
, optional) – JSON object representing user objectReturns paid share of the user
Returns: paid share of the user Return type: str
Returns owed share of the user
Returns: owed share of the user Return type: str
-
getNetBalance
()[source]¶ Returns net balance of the user
Returns: net balance of the user Return type: str
Sets the paid share of the user
Parameters: paid_share (str) – Paid share share of the user
Sets the owed share of the user
Parameters: owed_share (str) – Owed share share of the user
Group¶
-
class
splitwise.group.
Group
(data=None)[source]¶ Represents a splitwise group.
-
id
¶ ID of the group
Type: long, optional
-
name
¶ Name of the group
Type: str, optional
-
updated_at
¶ ISO 8601 Date time. The last updated date time of group
Type: str, optional
-
created_at
¶ ISO 8601 Date time. The created date time of group
Type: str, optional
-
simplify_by_default
¶ Is Simplified expenses by default
Type: bool, optional
-
group_type
¶ Type of the group
Type: str, optional
-
whiteboard
¶ Whiteboard of the group
Type: str, optional
-
invite_link
¶ Invitation link of the group
Type: str, optional
-
country_code
¶ Country of the group
Type: str, optional
-
original_debts
¶ List of original debts
Type: list
ofsplitwise.debt.Debt
, optional
-
simplfied_debts
¶ List of simplfied debts
Type: list
ofsplitwise.debt.Debt
, optional
-
members
¶ List of members of the group
Type: list
ofsplitwise.user.Friend
, optional
Parameters: data ( json
, optional) – JSON object representing group object-
getCreatedAt
()[source]¶ Returns the ISO 8601 create date time of the group
Returns: ISO 8601 create date time of the group Return type: str
-
getUpdatedAt
()[source]¶ Returns the ISO 8601 update date time of the group
Returns: ISO 8601 update date time of the group Return type: str
-
getWhiteBoard
()[source]¶ Returns the whiteboard of the group
Returns: whiteboard of the group Return type: str
-
isSimplifiedByDefault
()[source]¶ Returns if simplified by default
Returns: simplified by default Return type: bool
-
getMembers
()[source]¶ Returns the list of group members
Returns: List of members of the group Return type: list
ofsplitwise.user.Friend
-
getOriginalDebts
()[source]¶ Returns the list of original debts
Returns: List of original debt of the group Return type: list
ofsplitwise.debt.Debt
-
getSimplifiedDebts
()[source]¶ Returns the list of simplified debts
Returns: List of simplified debt of the group Return type: list
ofsplitwise.debt.Debt
-
getInviteLink
()[source]¶ Returns the invitation link of the group
Returns: invitation link of the group Return type: str
-
setType
(group_type)[source]¶ Sets the type of the group
Parameters: group_type (str) – type of the group
-
setGroupType
(group_type)[source]¶ Sets the type of the group
Parameters: group_type (str) – type of the group
-
setWhiteBoard
(whiteboard)[source]¶ Sets the whiteboard of the group
Parameters: whiteboard (str) – whiteboard of the group
-
setCountryCode
(country_code)[source]¶ Sets the country code of the group
Parameters: country_code (str) – country code of the group
-
setMembers
(members)[source]¶ Sets the members of the group
Parameters: members ( list
ofsplitwise.user.Friend
) – list of members of the group
-
addMember
(member)[source]¶ Adds a member to the group
Parameters: member ( splitwise.user.Friend
) – members of the group
-
-
class
splitwise.group.
FriendGroup
(data=None)[source]¶ Simplified Group while representing a Friend.
-
id
¶ ID of the group
Type: long, optional
-
balances
¶ List of balances of the group
Type: list
ofsplitwise.balance.Balance
, optional
Parameters: data ( json
, optional) – JSON object representing group-
getBalances
()[source]¶ Returns the balances of the group
Returns: Balances of the group Return type: list
ofsplitwise.balance.Balance
-
Expense¶
-
class
splitwise.expense.
Expense
(data=None)[source]¶ Expense in Splitwise
-
id
¶ ID of the expense
Type: long, optional
-
group_id
¶ GroupID of the expense
Type: long, optional
-
description
¶ Description of the expense
Type: str, optional
-
repeats
¶ True if expense repeats, false otherwise
Type: bool, optional
-
repeat_interval
¶ Repeat interval of the expense
Type: str, optional
-
email_reminder
¶ True if email reminder is set, false otherwise
Type: bool, optional
-
email_reminder_in_advance
¶ Days of email reminder
Type: int, optional
-
next_repeat
¶ Date of next repeat
Type: str, optional
-
details
¶ Additional details of the expense
Type: str, optional
-
comments_count
¶ Comment count of the expense
Type: int, optional
-
payment
¶ Is payment done
Type: bool, optional
-
creation_method
¶ Creation method
Type: str, optional
-
transaction_method
¶ Transaction method
Type: str, optional
-
transaction_confirmed
¶ Is Transaction confirmed or not
Type: bool, optional
-
cost
¶ Amount of the expense
Type: str, optional
-
currency_code
¶ Currency code of the expense
Type: str, optional
-
created_by
¶ User who created the expense
Type: splitwise.user.User
, optional
-
date
¶ Date of the expense
Type: str, optional
-
created_at
¶ Creation date of the expense
Type: str, optional
-
updated_at
¶ Last updation date of the expense
Type: str, optional
-
deleted_at
¶ Deletion date of the expense
Type: str, optional
-
receipt
¶ Receipt of the expense
Type: splitwise.receipt.Receipt
, optional
-
category
¶ Category of the expense
Type: splitwise.category.Category
, optional
-
updated_by
¶ User who updated the expense
Type: splitwise.user.User
, optional
-
deleted_by
¶ User who deleted the expense
Type: splitwise.user.User
, optional
-
friendship_id
¶ Friendship id of the users in expense
Type: long, optional
-
expense_bundle_id
¶ Expense bundle id of the expense
Type: long, optional
-
repayments
¶ List of repayments expressed as Debt
Type: list
ofsplitwise.debt.Debt
, optional
-
user
¶ List of users with balances
Type: list
ofsplitwise.user.ExpenseUser
, optional
-
transaction_id
¶ Transaction id of the expense
Type: long, optional
Parameters: data ( json
, optional) – JSON object representing expense-
getGroupId
()[source]¶ Returns the GroupID of the expense
Returns: GroupID of the expense Return type: long
-
getDescription
()[source]¶ Returns the Description of the expense
Returns: Description of the expense Return type: str
-
isRepeat
()[source]¶ Returns if expense repeats
Returns: True if expense repeats, False otherwise Return type: bool
-
getRepeatInterval
()[source]¶ Returns the repeat interval of the expense
Returns: Repeat interval of expense Return type: str
-
getEmailReminder
()[source]¶ Returns if email reminder is set
Returns: True if email reminder is set, False otherwise Return type: bool
-
getEmailReminderInAdvance
()[source]¶ Returns the email reminder in advance of the expense
Returns: email reminder in advance of expense Return type: int
-
getNextRepeat
()[source]¶ Returns the next repeat of the expense
Returns: next repeat of expense Return type: str
-
getCommentsCount
()[source]¶ Returns the comment count of the expense
Returns: comment count of expense Return type: int
-
getPayment
()[source]¶ Returns if payment is done in expense
Returns: True if payment done, False otherwise Return type: bool
-
getCreationMethod
()[source]¶ Returns the creation method of the expense
Returns: creation method of expense Return type: str
-
getTransactionMethod
()[source]¶ Returns the transaction method of the expense
Returns: transaction method of expense Return type: str
-
getTransactionConfirmed
()[source]¶ Returns if transaction is confirmed in expense
Returns: True if transaction confirmed, False otherwise Return type: bool
-
getCurrencyCode
()[source]¶ Returns the currency code of the expense
Returns: currency code of expense Return type: str
-
getCreatedBy
()[source]¶ Returns the user who created the expense
Returns: User who created the expense Return type: splitwise.user.User
-
getCreatedAt
()[source]¶ Returns the created at date of the expense
Returns: created at date of expense Return type: str
-
getUpdatedAt
()[source]¶ Returns the updated at date of the expense
Returns: updated at date of expense Return type: str
-
getDeletedAt
()[source]¶ Returns the deleted at date of the expense
Returns: deleted at date of expense Return type: str
-
getReceipt
()[source]¶ Returns the receipt of the expense
Returns: receipt of the expense Return type: splitwise.receipt.Receipt
-
getCategory
()[source]¶ Returns the category of the expense
Returns: category of the expense Return type: splitwise.category.Category
-
getUpdatedBy
()[source]¶ Returns the user who updated the expense
Returns: User who updated the expense Return type: splitwise.user.User
-
getDeletedBy
()[source]¶ Returns the user who deleted the expense
Returns: User who deleted the expense Return type: splitwise.user.User
-
getUsers
()[source]¶ Returns the list of users in the expense along with balance
Returns: list of users in the expense along with balance Return type: list
ofsplitwise.user.ExpenseUser
-
getExpenseBundleId
()[source]¶ Returns the expense bundle id of the expense
Returns: expense bundle id of expense Return type: long
-
getFriendshipId
()[source]¶ Returns the friendship id of the expense
Returns: friendship id of expense Return type: long
-
getRepayments
()[source]¶ Returns the list of repayments
Returns: list of debts Return type: list
ofsplitwise.debt.Debt
-
getReceiptPath
()[source]¶ Returns the receipt of the expense
Returns: path to the receipt file Return type: string
-
getTransactionId
()[source]¶ Returns the transaction id of the expense
Returns: Transaction ID of the expense Return type: long
-
setGroupId
(id)[source]¶ Sets the group id of the expense
Parameters: id (long) – Group ID of the expense
-
setDescription
(desc)[source]¶ Sets the description of the expense
Parameters: desc (str) – description of the expense
-
setPayment
(payment)[source]¶ Sets the payment of the expense
Parameters: payment (bool) – payment of the expense
-
setFriendshipId
(f_id)[source]¶ Sets the friendship id of the expense
Parameters: f_id (long) – friendship id of the expense
-
setCreationMethod
(creation_method)[source]¶ Sets the creation method of the expense
Parameters: creation_method (str) – creation method of the expense
-
setRepeatInterval
(repeat_interval)[source]¶ Sets to repeat the interval of expense
Parameters: repeat_interval (str) – repeat interval of the expense
-
setCurrencyCode
(currency_code)[source]¶ Sets the currency code of the expense
Parameters: currency_code (str) – currency code of the expense
-
setCategory
(category)[source]¶ Sets to category of the expense
Parameters: category ( splitwise.category.Category
) – category of the expense
-
setUsers
(users)[source]¶ Sets to users of the expense
Parameters: users ( list
ofsplitwise.user.ExpenseUser
) – List of users
-
addUser
(user)[source]¶ Add a user to the expense
Parameters: user ( splitwise.user.ExpenseUser
) – user to add to expense
-
setSplitEqually
(should_split=True)[source]¶ Set if expense should be split equally. Note that group_id should be set to use this
Parameters: should_split (bool, optional) – Should the expense be split equally. Default value is True
-
Balance¶
-
class
splitwise.balance.
Balance
(data=None)[source]¶ Balance of an expense/group.
-
currency_code
¶ Currency code of the balance
Type: str
-
amount
¶ Amount of the balance
Type: str
Parameters: data ( json
, optional) – JSON object representing balance-
Debt¶
-
class
splitwise.debt.
Debt
(data=None)[source]¶ Debt of an expense/group.
-
from
¶ UserID of the user who paid
Type: long
-
to
¶ UserID of the user who owes
Type: long
-
amount
¶ Amount of the debt
Type: str
-
currency_code
¶ Currency code of the debt
Type: str, optional
Parameters: data ( json
, optional) – JSON object representing debt-
Picture¶
-
class
splitwise.picture.
Picture
(data=None)[source]¶ Profile picture of the user.
-
small
¶ Link to small size picture
Type: str, optional
-
medium
¶ Link to medium size picture
Type: str, optional
-
large
¶ Link to large size picture
Type: str, optional
Parameters: data ( json
, optional) – JSON object representing picture object-
getSmall
()[source]¶ Returns the link to small size picture of the user
Returns: Link to small size picture of the user Return type: str
-
Receipt¶
-
class
splitwise.receipt.
Receipt
(data)[source]¶ Receipt of an expense.
-
original
¶ Link to original receipt
Type: str
-
large
¶ Link to large size receipt
Type: str
-
Category¶
-
class
splitwise.category.
Category
(data=None)[source]¶ Category in splitwise.
-
id
¶ ID of the category
Type: long
-
name
¶ Name of the category
Type: str
-
subcategories
¶ Subcategories of this category
Type: list
ofsplitwise.category.Category
Parameters: data ( json
, optional) – JSON object representing category object-
getSubcategories
()[source]¶ Returns the list of sub categories for the category
Returns: List of sub categories Return type: list
ofsplitwise.category.Category
-
Currency¶
Comment¶
-
class
splitwise.comment.
Comment
(data=None)[source]¶ Contains comments made on an expense
-
id
¶ Comment Id
Type: long
-
content
¶ Comment posted
Type: string
-
comment_type
¶ User
Type: string
-
relation_type
¶ ExpenseComment
Type: string
-
relation_id
¶ Expense Id
Type: long
-
created_at
¶ Comment creation datetime
Type: datetime
-
deleted_at
¶ Comment deletion datetime
Type: datetime, optional
-
user
¶ Author of the comment
Parameters: data ( json
, optional) – JSON object representing comment object-
getRelationType
()[source]¶ Returns relation type of the comment
Returns: Relation type of the comment Return type: str
-
getCreatedAt
()[source]¶ Returns datetime at which comment was created
Returns: Comment’s creation date Return type: datetime
-
getDeletedAt
()[source]¶ Returns datetime at which comment was deleted
Returns: Comment’s deletion date Return type: datetime
-
getCommentedUser
()[source]¶ Returns commented user’s details
Returns: Commented user object Return type: splitwise.user.User
-
Errors¶
Exceptions¶
SplitwiseBaseException¶
-
class
splitwise.exception.
SplitwiseBaseException
(message=None, http_body=None, http_status=None, http_headers=None)[source]¶ Base exception class for splitwise.
-
message
¶ Exception message
Type: str, optional
-
http_body
¶ HTTP body
Type: str, optional
-
http_status
¶ HTTP status code
Type: int, optional
-
http_headers
¶ Dict containing header key and value
Type: dict
, optional
-
errors
¶ JSON errors
Type: json
, optional
Parameters: - message (str, optional) – Exception message
- http_body (str, optional) – HTTP body
- http_status (int, optional) – HTTP status code
- http_headers (
dict
, optional) – Dict containing header key and value
-
SplitwiseException¶
-
class
splitwise.exception.
SplitwiseException
(message, response=None)[source]¶ Exception based on requests library Response.
Inherits:
splitwise.exception.SplitwiseBaseException
Exception based on requests library Response.
Parameters: - message (str) – Exception message
- response (
requests.Response
, optional) – response object from requests library
SplitwiseUnauthorizedException¶
Exception when request to splitwise is unauthorized
Inherits:
splitwise.exception.SplitwiseException
Exception based on requests library Response.
Parameters: - message (str) – Exception message
- response (
requests.Response
, optional) – response object from requests library
SplitwiseNotAllowedException¶
-
class
splitwise.exception.
SplitwiseNotAllowedException
(message, response=None)[source]¶ Exception when request to splitwise is not allowed
Inherits:
splitwise.exception.SplitwiseException
Exception based on requests library Response.
Parameters: - message (str) – Exception message
- response (
requests.Response
, optional) – response object from requests library
SplitwiseNotFoundException¶
-
class
splitwise.exception.
SplitwiseNotFoundException
(message, response=None)[source]¶ Exception when request to splitwise returns not found
Inherits:
splitwise.exception.SplitwiseBaseException
Exception based on requests library Response.
Parameters: - message (str) – Exception message
- response (
requests.Response
, optional) – response object from requests library