Skip to main content

codecov

Quality Gate Status

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.

Table of Contents

Installation

PyKitty requires Python 3.9 or newer. To install the package, run:

pip install pykitty

Usage

  1. Open a kitty on https://kittysplit.de/ and set a username
  2. Once opened, copy the full Kittysplit URL, e.g. https://kittysplit.de/test_kitty/ADLKFJLAKD.../

Create your first expense with the following code (replace <kitty_URL> and <your_username>):

from pykitty import KittySplitAPI

api = KittySplitAPI("<kitty_URL>")
api.select_user("<your_username>")
api.add_expense(
    amount="10.00",
    description="A warm welcome by pykitty!",
)

Get Users

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

api.get_users()  # {"user1": "3451816", "user2": "7167080"}

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

Select User

You have to select an user of the KittySplit. Use the select_user method to set your user:

api.select_user("<your_username>")

Add Expense

To add an expense, use the add_expense method:

api.add_expense(
    amount="10.00",
    description="Lunch",
)

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

With the entry_date parameter, you can specify the date of the expense:

api.add_expense(
    amount="10.00",
    description="Lunch",
    entry_date="2023-03-29",
)

With the weight_mapping parameter, you can specify how much each user should pay for the expense. The sum of the weights must be 1.

api.add_expense(
    amount="10.00",
    description="Lunch",
    weight_mapping={"username1": 0.6, "username2": 0.4},
)

Get Expenses

api.get_expenses()  # list all expenses
api.get_expenses("yours")  # list expenses you paid
api.get_expenses("others")  # list expenses others have paid

Get Single Expense Details

api.get_expense("8233711")  # expense_id can be found in URL

Delete Expense

api.delete_expense("8233711")  # expense_id can be found in URL

Releasing

pyproject.toml holds the package version. Use poetry version patch, poetry version minor, or poetry version major to bump it in a pull request.

Before the first release, create the pypi environment under Settings → Environments in GitHub and allow deployments from tags matching v*. In PyPI project settings, add a GitHub Trusted Publisher with these values.

Field Value
Owner Lars147
Repository pykitty
Workflow name release.yml
Environment name pypi

Merging a version bump into main creates the matching vMAJOR.MINOR.PATCH tag and starts the release. To release 0.4.0, which is already on main, open Actions → Release → Run workflow, select main, and click Run workflow after completing the setup above.

The run for the tag checks the version, builds a wheel and source distribution, tests the package, and uploads both via PyPI Trusted Publishing. It then creates a GitHub Release with generated notes. If dispatch fails, rerun the tag job. If the run for the tag fails, rerun its failed jobs.

License

This project is licensed under the MIT License.

Next Steps (TODO)

  • Parse Kitty URL to extract kitty_id
  • Implement get_expenses method to retrieve all expenses.
  • Add support for deleting expenses.
  • Enhance test coverage.
  • Add support for updating expenses.
  • Document CLI usage.
  • Support for Kittysplit in other languages.

Metadata

Release files for pykitty 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykitty 0.4.0
File Size Uploaded Provenance Actions
pykitty-0.4.0.tar.gz 11.3 kB With provenance Details for pykitty-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pykitty 0.4.0
File Interpreter ABI Platform Actions
pykitty-0.4.0-py3-none-any.whl Python 3 none any Details for pykitty-0.4.0-py3-none-any.whl

Total release size: 22.7 kB

Release files / pykitty-0.4.0.tar.gz

Download URL pykitty-0.4.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9eaf63cbe5fdc11bd2f716541e2393e42a87472f664e7810e587691f7956ab2b
BLAKE2b-256 checksum
How to use checksums
791e5ec91794ed4856bc740bbe0e1bc35969672b1e4221dd3691abfd73d100b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / pykitty-0.4.0-py3-none-any.whl

Download URL pykitty-0.4.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d904e5b18c697b89880d3944ee49ea1649135412d72c70260cf87fa53e4a900b
BLAKE2b-256 checksum
How to use checksums
3ae98ac22cc74b1a14294517e8cbbc8eb10a8671c5cb9e93993b50674ce0eb14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for pykitty 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pykitty-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page