Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Commit

Permalink
Added license, some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ Amos committed Jul 31, 2011
1 parent 3caf169 commit 4de523a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2011, Russ Amos
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,46 @@
Pychallonge provides python bindings for the
[challonge.com](http://challonge.com) [API](http://challonge.com/api).

# License

Pychallonge is BSD licensed.
# Installation

pip install -e git+http://github.com/russ-/pychallonge


# Usage

import challonge

challonge.set_credentials("your_challonge_username", "your_api_key")
tournaments = challonge.tournaments.index()

See [challonge.com](http://challonge.com/api) for full API documentation.

The methods that return objects return dicts of key, value pairs
constructed from the tag and text value of the xml elements. Index
methods return lists of dicts.

for tournament in tournaments:
print(tournament["name"], tournament["url"])

# no return value:
challonge.participants.randomize(tournament["id"])


# Running the unit tests

Pychallonge comes with a set of unit tests. The tests are not comprehensive,
but do utilize each method and verify basic functionality.

In order to test behavior of the python bindings, API calls must be made
to Challonge, which requires a username and api key. To run the tests
with your credentials, set `CHALLONGE_USER` and `CHALLONGE_KEY` appropriately
in your environment.

$ git clone http://github.com/russ-/pychallonge pychallonge
$ CHALLONGE_USER=russminus CHALLONGE_KEY=my_api_key python pychallonge/tests.py
................
----------------------------------------------------------------------
Ran 16 tests in 67.103s

OK

0 comments on commit 4de523a

Please sign in to comment.