Interface to the WCF's results database
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
wcf
.envrc
.gitignore
LICENSE
README.rst
environment.yml
setup.py

README.rst

wcf -- World Curling Federation Database Interface

Note: this package is not officially endorsed or supported by the WCF

Pull tournament and game data from the World Curling Federation's results site, using requests. Requires an active and stable internet connection.

This package was originally created to supplement my needs of pulling the data while I was waiting for official API access. It also includes accessing the results database through official means.

API

Official access to the WCF's results database must be obtained prior to using the official API to access the information. Access follows standard REST conventions. Create a credentials.json file as follows:

{
    "Username": "user",
    "Password": "something+else"
}

The file can either be placed in the same directory, or you can pass the path to the file to WCF.API() as an argument. The data is returned as a formatted JSON response, as each use case of the data could require different portions of the response. Since development was directed by what I needed, not the entire API is implemented.

Usage is as follows:

import wcf

conn = wcf.API().connect()
# alternatively:
# conn = wcf.API('credentials/wcf.json')
# conn.connect()
draws = conn.get_draws_by_tournament(555)

Testing

Testing requires that you have a credentials file located in this directory. The test suite can be run with:

py.test --cov=wcf