Drop-in Replacement of pychallonge

Overview

pychal

Pychal is a drop-in replacement of pychallonge with some extra features and support for new Python versions. Pychal provides python bindings for the CHALLONGE! API.

Differences

The only diffence with the pychallonge is the dictionary keys with dashes are now with undescores for example the key 'created-at' is now 'created_at'.

Requirements

  • iso8601
  • tzlocal
  • pytz
  • requests

Python version support

  • 2.7
  • 3.4+

Installation

For the stable version

pip install pychal

For latest development

pip install -e git+http://github.com/ZEDGR/pychal#egg=pychal

Usage

import challonge

# Tell pychal about your [CHALLONGE! API credentials](http://api.challonge.com/v1).
challonge.set_credentials("your_challonge_username", "your_api_key")

# Retrieve a tournament by its id (or its url).
tournament = challonge.tournaments.show(3272)

# Tournaments, matches, and participants are all represented as normal Python dicts.
print(tournament["id"]) # 3272
print(tournament["name"]) # My Awesome Tournament
print(tournament["started_at"]) # None

# Retrieve the participants for a given tournament.
participants = challonge.participants.index(tournament["id"])
print(len(participants)) # 13

# Start the tournament and retrieve the updated information to see the effects
# of the change.
challonge.tournaments.start(tournament["id"])
tournament = challonge.tournaments.show(tournament["id"])
print(tournament["started_at"]) # 2011-07-31 16:16:02-04:00

See challonge.com for full API documentation.

API Issues

The Challonge API has some issues with the attachments endpoints. The create and update endpoints are not working correctly. When you try to upload an attachment with asset(file) the API returns 500 internal server error. The same happens with asset + description. This problem has been reported to Challonge.

Other problems that I have noticed is that the check in process through the API seems weird. When you undo check in a participant the field 'checked_in' remains True but in the website the participant is correctly not checked in. That's why I haven't write any tests on this.

Fixed by pychal: In the datetime fields the api returns random timezone offsets, pychal convert those to your machine's local time. Also you can set any timezone you want with set_timezone function.

Running the unit tests

Pychal 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/ZEDGR/pychal pychal
$ CHALLONGE_USER=my_user CHALLONGE_KEY=my_api_key python pychal/tests.py
...............................
----------------------------------------------------------------------
Ran 31 tests in 98.176s

OK

Note that several tournaments are created, published, started, and completed over the course of the unit tests. These should be cleaned up by the end, but if any of the tests fail they may not be cleaned up. As long as the basic functions work, you can clean up errant tournaments as follows.

import challonge
challonge.set_credentials("my_user", "my_api_key")
for t in challonge.tournaments.index():
    if t["name"].startswith("pychal"):
        challonge.tournaments.destroy(t["id"])
Add Me To Your Group Enjoy With Me. Pyrogram bot. https://t.me/TamilSupport

SongPlayRoBot 3X Fast Telethon Based Bot ⚜ Open Source Bot 👨🏻‍💻 Demo : SongPlayRoBot 💃🏻 Easy To Deploy 🤗 Click Below Image to Deploy DEPLOY Grou

IMVETRI 850 Dec 30, 2022
This repo contains a small project i've done using PILLOW module in python

This repo contains a small project i've done using PILLOW module in python. I wrote an automated script which generates more than 5k+ unique nfts with 0 hassle in less time.

SasiVatsal 11 Nov 05, 2022
A powerfull Zee5 Downloader Bot With Permeneant Thumbnail Support 💯 With Love From NexonHex

Zᴇᴇ5 DL A ᴘᴏᴡᴇʀғᴜʟʟ Zᴇᴇ5 Dᴏᴡɴʟᴏᴀᴅᴇʀ Bᴏᴛ Wɪᴛʜ Pᴇʀᴍᴇɴᴇᴀɴᴛ Tʜᴜᴍʙɴᴀɪʟ Sᴜᴘᴘᴏʀᴛ 💯 Wɪᴛʜ Lᴏᴠᴇ Fʀᴏᴍ NᴇxᴏɴHᴇx Wʜᴀᴛ Cᴀɴ I Dᴏ ? • ɪ ᴄᴀɴ Uᴘʟᴏᴀᴅ ᴀs ғɪʟᴇ/ᴠɪᴅᴇᴏ ғʀᴏᴍ

Psycharmers 4 Jan 19, 2022
Pysauce is a Discord bot which utilizes the SauceNAO API to locate the source of images.

Pysauce Pysauce is a Discord bot which utilizes the SauceNAO API to locate the source of images. Use Pysauce has one public instance always running, i

Akira 2 Oct 04, 2022
:electric_plug: Generating short urls with python has never been easier

pyshorteners A simple URL shortening API wrapper Python library. Installing pip install pyshorteners Documentation https://pyshorteners.readthedocs.i

Ellison 351 Jan 03, 2023
I-Spy is a discord and twitter bot 🤖 that keeps a check on usage foul language, hate-speech and NSFW contents

I-Spy is a discord and twitter bot 🤖 that keeps a check on usage foul language, hate-speech and NSFW contents. It is the one stop solution to monitor your discord servers and twitter handles against

Tia Saxena 5 Nov 16, 2022
Project for QVault Hackathon which plays sounds based on the letters of a user's name

virtual_instrument Project for QVault Hackathon which plays sounds based on the letters of a user's name I created a virtual instrument using Python a

Paolo Sidera 2 Feb 11, 2022
Asyncio SDK for Azure Cosmos DB

Asyncio SDK for Azure Cosmos DB. This library is intended to be a very thin asyncio wrapper around the Azure Comsos DB Rest API. It is not intended to have feature parity with the Microsoft Azure SDK

Grant McDonald 4 Dec 04, 2021
A Pythonic wrapper for the Wikipedia API

Wikipedia Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia. Search Wikipedia, get article summaries, get data

Jonathan Goldsmith 2.5k Dec 28, 2022
This bot will send you an email or notify you via telegram & discord if dolar/lira parity breaks a record.

Dolar Rekor Kırdı Mı? This bot will send you an email or notify you via Telegram & Discord if Dolar/Lira parity breaks a record. Mailgun can be used a

Yiğit Göktuğ Budanur 2 Oct 14, 2021
PR Changes Matrix Builder

Pr-changes-matrix-builder - A Github Action that will output a variable to be used in a matrix strategy job based on a PR&'s changes

Kyle James Walker (he/him) 21 Oct 04, 2022
The easiest way to deploy this Bot

How To Host The easiest way to deploy this Bot Update Channe

Isekai Reszz 1 Jan 23, 2022
Moderation and Utility Discord bot.

Qrista An advanced Moderation and Utility Discord bot. Features Uses Hikari and Lightbulb as a command handler Advance Logging & Whole new enviroment

Blaze Camp 2 Jan 11, 2022
Telegram bot/scraper to get the latest NUS vacancy reports.

Telegram bot/scraper to get the latest NUS vacancy reports. Stay ahead of the curve and don't get modrekt.

Chee Hong 1 Jan 08, 2022
An Unofficial API for 1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, and MagnetDL

An Unofficial API for 1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, and MagnetDL

Neeraj Kumar 130 Dec 27, 2022
The simple way of using Imgur.

PyImgur The simple way of using Imgur. You can upload images, download images, read comments, update your albums, message people and more. In fact, yo

Andreas Damgaard Pedersen 120 Dec 06, 2022
🔮 Uncover some followers of a private instagram account

Private Instagram Chaining 🔮 Uncover part of followers of an instagram private account I have this private instagram account julianakhao. I need to g

аэт 69 Dec 17, 2022
Improved file host. Change of interface and storage: 15 GB available.

File hosting v2 Improved file host. Change of interface and storage: 15 GB available. This app now uses the Google API to store, view, and delete file

Sarusman 1 Jan 18, 2022
WikiChecker - Repositorio oficial del complemento WikiChecker para NVDA.

WikiChecker Buscador rápido de artículos en Wikipedia. Introducción. El complemento WikiChecker para NVDA permite a los usuarios consultar de forma rá

2 Jan 10, 2022
Facebook Clooning Tool BD...

Facebook Clooning Tool BD...

Ariyan Ahmed Mamun 2 Feb 16, 2022