Skip to main content

Python client for the Spliit expense sharing application API. Fork of guysoft/SpliitApi.

Project description

Spliit API Client

A Python client for interacting with the Spliit expense sharing application API.

This project is a fork of guysoft/SpliitApi, with additional features and improvements.

Installation

pip install spliit-api-client

Usage

from spliit.client import Spliit

# Initialize the client with your group ID
client = Spliit(group_id="your_group_id")

# Get group details
group = client.get_group()
print(f"Group: {group['name']}")

# Get participants
participants = client.get_participants()
print("Participants:", participants)

# Add an expense
expense = client.add_expense(
    title="Dinner",
    paid_by="participant_id",  # ID of the person who paid
    paid_for=[
        ("participant1_id", 50),  # Each participant gets 50 shares
        ("participant2_id", 50),
    ],
    amount=5000,  # Amount in cents (50.00)
    notes="Great dinner!"  # Optional notes
)

# Get all expenses
expenses = client.get_expenses()
for expense in expenses:
    print(f"\n{expense['title']} - {expense['amount']/100:.2f} {group['currency']}")
    print(f"Paid by: {expense['paidBy']['name']}")

# Get specific expense details
expense_details = client.get_expense("expense_id")

# Remove an expense
client.remove_expense("expense_id")

Features

  • Get group details and participants
  • Add expenses with even or custom splits
  • Add notes to expenses
  • Get expense details
  • Remove expenses
  • List all expenses in a group

Development

To set up for development:

# Clone the repository
git clone https://github.com/makp0/spliit-api-client.git
cd spliit-api-client

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spliit_api_client-0.1.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spliit_api_client-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file spliit_api_client-0.1.0.tar.gz.

File metadata

  • Download URL: spliit_api_client-0.1.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for spliit_api_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 81fb430421e1e2251b146d10a242030b0150745d09191e1426b68504a8cc41e4
MD5 835fd238a007a0c2701d3473ba360943
BLAKE2b-256 fb9538cb3866eceaa9672a7886cef17388c2c062aa2fa13754d34af2a2d2aa95

See more details on using hashes here.

File details

Details for the file spliit_api_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spliit_api_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c0acdad185b1918c9bab2f35b6c7ed993b610a04fc200cf58b179f86ff3190b
MD5 35157898b4e9e750d89436e828f8479b
BLAKE2b-256 a78e7a61530d56a6c35e59b8855f3614d3746e25ed01f3773babf8b157c7d956

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page