Skip to main content

A simple library to keep track of your progress and history in competitive debating.

Project description

https://badge.fury.io/py/debaterpy.svg? https://badgen.net/github/license/daankoning/debater.py? Documentation Status

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.

Installation

Because the package is available on PyPi simply run the following command to install it:

pip install debaterpy

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_speeches = debaterpy.get_all_speeches(
    record,
    lambda tournament, round, speech: tournament.format == "BP" and round.result == 3
)
>>> winning_speaks = [speech.speak for speech in winning_speeches]
>>> sum(winning_speaks)/len(winning_speaks)
78.88888888888889

Documentation

The documentation lives in the docs directory as well as on ReadTheDocs.

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

debaterpy-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

debaterpy-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file debaterpy-0.1.1.tar.gz.

File metadata

  • Download URL: debaterpy-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for debaterpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7dc24e600ccf6df8763e79fc14d5252f1db7533b346295d6200ebe4dd5fd614d
MD5 3a1bd4f623d893b20697b5c7397c9caf
BLAKE2b-256 95d27b92c1eb22dfafde7b309e90101a2ebb0c47a87f16c9ae23c4b0b14690d2

See more details on using hashes here.

File details

Details for the file debaterpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: debaterpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for debaterpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9415db64b811c764d94a3fbd45f00d22429f28e78d90830aa7ad961a4bbb4c0e
MD5 f95e27bc423655e1e540eb800c41b1e6
BLAKE2b-256 3e0d87b99334915bb84902c46eedc9a1b1fdd7c9094f39628f17fd0e53b6ab64

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