Skip to main content

The unofficial Kittysplit wrapper for Python.

Project description

PyKitty

This Python SDK allows you to interact with KittySplit to manage expenses in a group. You can fetch a list of users, select a user and add expenses.

Installation

To install the package, use the following command:

pip install pykitty

Usage

  1. Open a kitty on https://kittysplit.de/
  2. Once opened, you can extract your kitty_id from the URL, e.g. test_kitty/ADLKFJLAKD.../ in https://kittysplit.de/test_kitty/ADLKFJLAKD.../

Create an instance of the KittySplitAPI class with the Kitty ID:

from pykitty import KittySplitAPI
api = KittySplitAPI("your_kitty_id")

Get Users

To fetch a list of users, use the get_users method:

users = api.get_users()

This will return a dictionary with usernames as keys and user IDs as values.

Select User

To select a user, use the select_user method:

api.select_user("username")

This method will set the selected_viewing_party_id attribute to the ID of the specified user.

Add Expense

To add an expense, use the add_expense method:

api.add_expense(
    amount="10.00",
    description="Lunch",
    entry_date="2023-03-29",
    weight_mapping={"username1": 0.6, "username2": 0.4},  # optional, if not specified, expense will be split evenly
)

This method will add a new expense with the specified details.

License

This project is licensed under the MIT License.

Next Steps (TODO)

  • Add Kitty URL parser to extract kitty_id and language from any kittysplit URL
  • Implement get_expenses method to retrieve all expenses.
  • Add support for updating and deleting expenses.
  • Document CLI usage.

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

pykitty-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pykitty-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pykitty-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.7.6 Darwin/22.4.0

File hashes

Hashes for pykitty-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7def83c47b4e256b2d5996e817580ccb196cd8a111ddf11c00f6b9cb9da0713
MD5 80f1a3855d150a51ab50bc8962dd4c13
BLAKE2b-256 5431850068445cd28a75a9ad008ecdd77d1a9cffccc3969ce8bfb2c0c072ade8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pykitty-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.7.6 Darwin/22.4.0

File hashes

Hashes for pykitty-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a0fe7b6f476b0af517e669856158c278c1b6e495cb4ecaa3cabf41ca3ecddf8
MD5 e6428a3ca21d54ef46490b8be2e1f7a3
BLAKE2b-256 415de63960eb64cb5efe4f9d8604231df63968e318298a5c95bd7426a2c9483c

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