A simple library to keep track of your progress and history in competitive debating.
Project description
A simple library to keep track of your progress and history in competitive debating.
The library is largely meant to interface with DebaterJSON and as such provides a significant number of functions and classes to analyse and manipulate these records.
Usage
Instantiating objects is really simple, assuming you have a valid DebaterJSON string loaded in data it only takes two lines of code to generate an object from them.
>>> import debaterpy >>> record = debaterpy.Record.from_json(data)
In fact, this method should cover the vast majority of use cases for generating records. In case more control over record creation (e.g. for generating test data or fetching a record from an external source) most classes are standard python dataclasses and as such offer fine programmatic control.
Having a Record object in memory it is incredibly simple to do even relatively complex manipulations. For example, in order to get a speaker’s average speaks in rounds where their team won, do:
>>> winning_rounds = debaterpy.get_all_rounds(record, lambda x, y: y.result == 3) >>> winning_speaks = [round.speeches[0].speak for round in winning_rounds] >>> sum(winning_speaks)/len(winning_speaks) 78.88888888888889
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
Built Distribution
Hashes for debaterpy-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d6c8b0c4f5ec953dc9e526b7db9d3442c4700afd2e26aa01f2ea2234c6a2a94 |
|
MD5 | 082586f78f3b3015944e6de69945e22e |
|
BLAKE2b-256 | 7bc14739a708e0499ceeb683200871663501d6b052361781ac74ec8083a36eb0 |