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.5.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

compdevkit-1.5.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file compdevkit-1.5.0.tar.gz.

File metadata

  • Download URL: compdevkit-1.5.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for compdevkit-1.5.0.tar.gz
Algorithm Hash digest
SHA256 4e2c8cf2f7a9ec9a533de9a1ba457e954f5c3952e173cdcb52892d907d819e59
MD5 0dc5e8461edfe427850acc6b857521b0
BLAKE2b-256 fe59bd03a7db7fd7373ca35c8d6ebae3ca1065ad5b14c3310711d7fa1ae40ae3

See more details on using hashes here.

File details

Details for the file compdevkit-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: compdevkit-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for compdevkit-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49b629d41b3046364dc351a1c7fcb8aea03509ee593ca430e5132694853887b3
MD5 cb0499a74db8ddee85b6741776e5a69e
BLAKE2b-256 a2e928acdac1630808555a48be71aa9939adaa4d97f2dd73dfcd93ef05b92626

See more details on using hashes here.

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