Quickstart
This guide will get you up and running with PadelKit. You'll learn how to install the package and start using the Court Geometry and Scoring modules.
Installation
To install PadelKit, simply use pip. The library is designed to be lightweight and has zero external dependencies by default.
pip install padelkit
Basic Usage
Once installed, you can easily import the necessary classes to start mapping a court or tracking a match.
Working with Court Geometry
You can instantiate a standard FIP padel court and query for coordinates.
from padelkit import PadelCourt
# Instantiate a standard 20x10 court
court = PadelCourt.fip_standard()
# Get the coordinates of the center of the net
net_center = court.point("NET_CENTER")
print(f"Net center: {net_center}")
# Output: Net center: (0.0, 0.0)
Tracking Match Score
You can use the scoring module to track a match's state using the event-sourcing architecture.
from padelkit import Match, TeamId
# Initialize a new match wrapper
match = Match()
# Team A wins the first point
match.history.add_point(TeamId.A)
# Print the cleanly formatted current state
print(match.history.get_current_score())
Next steps
Now that you have a basic understanding of PadelKit, you can dive deeper into the specific API documentation for each module.