russ- / pychallonge Goto Github PK
View Code? Open in Web Editor NEWPython bindings for the CHALLONGE! API
Home Page: http://challonge.com/api
License: BSD 2-Clause "Simplified" License
Python bindings for the CHALLONGE! API
Home Page: http://challonge.com/api
License: BSD 2-Clause "Simplified" License
great module! thank you.
is attachments on the roadmap?
http://api.challonge.com/v1/documents/match_attachments/index
What's the correct way of providing timezone for start_time?
When I use:
datetime.datetime(int(year), int(month), int(day), int(hours), int(minutes), 0, 0, tzinfo=pytz.timezone('Europe/London'))
it defaults to -05.00 timezone anyway.
binary_params is fine for POST, but won't work for GET.
When you add them, urllib makes it a POST request.
Hi, I was exploring this API, and I could find a good was to extract data from an Organization not just a Member. I was wondering if there is anything you can do to make this possible?
I am unable to get the list of matches for tournaments that are still pending. Is this something that is prevented by Challonge itself?
should be (api.py):
CHALLONGE_API_URL = "api.challonge.com/v1/"
Looks like this test case is failing...
(pychallonge-2.7.14) ~/projects/russell/challonge/pychallonge$ CHALLONGE_USER=russellvt CHALLONGE_KEY=$(cat ../api.key) python ./tests.py
...........EE......
======================================================================
ERROR: test_index_filter_by_created (__main__.TournamentsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./tests.py", line 65, in test_index_filter_by_created
created_after=datetime.datetime.now().date() - datetime.timedelta(days=1))
File "/home/russell/projects/russell/challonge/pychallonge/challonge/tournaments.py", line 6, in index
return api.fetch_and_parse("GET", "tournaments", **params)
File "/home/russell/projects/russell/challonge/pychallonge/challonge/api.py", line 79, in fetch_and_parse
doc = ElementTree.parse(fetch(method, uri, params_prefix, **params))
File "/home/russell/projects/russell/challonge/pychallonge/challonge/api.py", line 63, in fetch
response = opener.open(req)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
(pychallonge-2.7.14) ~/projects/russell/challonge/pychallonge$ CHALLONGE_USER=russellvt CHALLONGE_KEY=$(cat ../api.key) python ./tests.py
...........EE......
[...]
======================================================================
ERROR: test_index_filter_by_state (__main__.TournamentsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./tests.py", line 54, in test_index_filter_by_state
ts = challonge.tournaments.index(state="pending")
File "/home/russell/projects/russell/challonge/pychallonge/challonge/tournaments.py", line 6, in index
return api.fetch_and_parse("GET", "tournaments", **params)
File "/home/russell/projects/russell/challonge/pychallonge/challonge/api.py", line 79, in fetch_and_parse
doc = ElementTree.parse(fetch(method, uri, params_prefix, **params))
File "/home/russell/projects/russell/challonge/pychallonge/challonge/api.py", line 63, in fetch
response = opener.open(req)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/russell/.pyenv/versions/2.7.14/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
----------------------------------------------------------------------
pip install -e git+http://github.com/russ-/pychallonge#egg=pychallonge
Obtaining pychallonge from git+http://github.com/russ-/pychallonge#egg=pychallonge
Cloning http://github.com/russ-/pychallonge to c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge
ERROR: Command errored out with exit status 1:
command: 'c:\users\adrien\pycharmprojects\flaskproject\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\setup.py'"'"'; _
file_='"'"'c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code
, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Adrien\AppData\Local\Temp\pip-pip-egg-info-hudrk2z0'
cwd: c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge
Complete output (11 lines):
Traceback (most recent call last):
File "", line 1, in
File "c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\setup.py", line 2, in
import challonge
File "c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\challonge_init_.py", line 4, in
from challonge import tournaments, matches, participants
File "c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\challonge\tournaments.py", line 1, in
from challonge import api
File "c:\users\adrien\pycharmprojects\flaskproject\venv\src\pychallonge\challonge\api.py", line 2, in
import iso8601
ModuleNotFoundError: No module named 'iso8601'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
py --version
Python 3.9.0
Does pychallonge work with Python 3.3? I keep getting this error when trying to install
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "E:\pychallonge\src\pychallonge\setup.py", line 2, in <module>
import challonge
File ".\challonge\__init__.py", line 4, in <module>
import tournaments, matches, participants
ImportError: No module named 'tournaments'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "E:\pychallonge\src\pychallonge\setup.py", line 2, in <module>
import challonge
File ".\challonge\__init__.py", line 4, in <module>
import tournaments, matches, participants
ImportError: No module named 'tournaments'
I have successfully installed and used pychallonge with Python 2.7
The participant creation seems broken, I can use everything else in the api except the challonge.participants.create() method. I call it with the correct url and a simple name but get the following error:
"ChallongeException: Participant parameters are required"
Removing or adding parameters results in the error:
"TypeError: create() takes exactly 2 arguments (1 given)"
I'm using 3.6.2 pyenv on anyenv.
[5:50:17]~ >> pip install -e git+https://github.com/russ-/pychallonge
Could not detect requirement name, please specify one with #egg=
[5:50:29]~ >> pip install --e git+https://github.com/russ-/pychallonge#egg=pychallonge
zsh: no matches found: git+https://github.com/russ-/pychallonge#egg=pychallonge
[5:50:29]~ >>
and same error at miniconda on Windows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.