Skip to main content

Developer tools for compmodels.org.

Project description

Comp-Developer-Toolkit

compdevkit tests your model's functions against the COMP criteria. If your functions pass the compdevkit tests, then you can be reasonably sure that the functions will work on COMPmodels.org.

COMP Developer toolkit also provides a helper command for retrieving your COMP API token.

Install compdevkit

pip install compdevkit

Set up the comp directory

$ cdk-init

Test your functions

from compdevkit import FunctionsTest

import matchups

def test_get_parameters():
    ta = FunctionsTest(
        get_inputs=matchups.get_inputs,
        validate_inputs=matchups.validate_inputs,
        run_model=matchups.get_matchup,
        ok_adjustment={"matchup": {"pitcher": [{"value": "Max Scherzer"}]}},
        bad_adjustment={"matchup": {"pitcher": [{"value": "Not a pitcher"}]}}
    )
    ta.test()

Get your COMP API token

$ cdk-token --username myuser --password mypass
Token: your-token-here

Run the tests

py.test compconfig -v

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

compdevkit-1.6.1.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

compdevkit-1.6.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page