Metadata-Version: 2.1
Name: libproton
Version: 3.0.1
Summary: Proton-compliant match scorer library.
Home-page: https://github.com/PeterJCLaw/libproton
Author: Peter Law
Author-email: PeterJCLaw@gmail.com
License: MIT
Project-URL: Issue tracker, https://github.com/PeterJCLaw/libproton/issues
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown
Requires-Dist: PyYAML (<5,>=3.11)

# LibProton

[![CircleCI](https://circleci.com/gh/PeterJCLaw/libproton.svg?style=svg)](https://circleci.com/gh/PeterJCLaw/libproton)

This is a library which simplifies the task of creating
[Proton](https://github.com/PeterJCLaw/proton) compliant scoring scripts.

It supports Python 2.7 and 3.x.

## API

The following is a complete and minimal Proton compliant scorer, and shows
the expected usage of the library.

~~~~ python
#!/usr/bin/env python

import libproton

class Scorer:
    def __init__(self, teams_data, arena_data):
        self._teams_data = teams_data
        self._arena_data = arena_data

    def calculate_scores(self):
        """Main scoring entry point.

           Expected to return a mapping of TLA -> score for each team in
           the input data. Errors either in the input or otherwise should
           be handled by raising exceptions.
        """
        scores = {}
        for tla in self._teams_data.keys():
            scores[tla] = 4
        return scores

    def validate(self, extra_data):
        """An optional additional method to validate the scoresheet.

           If this method is implemented it will be called with the value
           of the ``other`` key from the input. If the key is not present
           then this method will still be called (with ``None``).

           If there are validation errors the this method should raise
           an exception about them.
        """
        pass

if __name__ == '__main__:
    libproton.main(Scorer)
~~~~

## Tests
Run `python setup.py test` or `nosetests` from the root.


