Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.770s · 23.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.3s · import 0.658s · 24MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Splitwise
✓ from splitwise import Splitwise
✗ import splitwise
splitwise is a module; the class is Splitwise.
Expense
✓ from splitwise.expense import Expense
Initialize the SDK and fetch the current user.
from splitwise import Splitwise
splt = Splitwise(consumer_key='YOUR_KEY', consumer_secret='YOUR_SECRET')
# For OAuth2, use access token
# splt = Splitwise(consumer_key='YOUR_KEY', consumer_secret='YOUR_SECRET', access_token='ACCESS_TOKEN')
print(splt.getCurrentUser())
Debug
Known issues
breakingIn v2.0.0, OAuth2 support was added. The constructor signature changed: OAuth1 uses consumer_key/consumer_secret, OAuth2 also requires access_token.fixUpdate code to match new constructor signature. For OAuth1, use setAccessToken() after authorization.
affects: <2.0.0 -> >=2.0.0
breakingIn v3.0.0, updateExpense() and getExpenses() were fixed. Behavior may have changed from v2.x.fixReview expense update and expense listing logic after upgrading.
affects: 2.x -> 3.0.0
gotchaThe SDK does not support Splitwise OAuth2 token refresh automatically. If your access token expires, you must re-authorize.fixImplement token refresh logic yourself by catching authorization errors and re-authorizing.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'splitwise'
Using import splitwise instead of from splitwise import Splitwise.
fixUse: from splitwise import Splitwise
splitwise.SplitwiseException: Invalid consumer key or consumer secret
Consumer key/secret are incorrect or swapped with API key.
fixEnsure you are using the correct consumer key and secret from your Splitwise app settings.
AttributeError: 'Splitwise' object has no attribute 'getExpenses'
Using an older version (<3.0.0) where getExpenses was broken or not available.
fixUpgrade to splitwise>=3.0.0: pip install --upgrade splitwise
Upgrade
Version history
3.0.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
No dependency data recorded yet.