Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

[WIP] python client library for codechef api, generated with swagger

Notifications You must be signed in to change notification settings

termicoder/codechef-client-lib

Repository files navigation

codechef_client

CodeChef API to support different applications.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import codechef_client 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import codechef_client

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import codechef_client
from codechef_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: codechef_auth
codechef_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = codechef_client.ContestProblemsApi()
problem_code = 'problem_code_example' # str | Problem code of the problem, eg. SALARY
contest_code = 'contest_code_example' # str | Contest code of the contest, eg. PRACTICE, COOK97, JAN17
fields = 'fields_example' # str | Possible fields are- problemCode, author, problemName, languagesSupported, sourceSizeLimit,  dateAdded, challengeType, maxTimeLimit, successfulSubmissions, body, totalSubmissions, partialSubmissions, tags.  Multiple fields can be entered using comma. (optional)

try:
    # Get details of a problem.
    api_response = api_instance.contests_contest_code_problems_problem_code_get(problem_code, contest_code, fields=fields)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContestProblemsApi->contests_contest_code_problems_problem_code_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.codechef.com

Class Method HTTP request Description
ContestProblemsApi contests_contest_code_problems_problem_code_get GET /contests/{contestCode}/problems/{problemCode} Get details of a problem.
ContestsApi contests_contest_code_get GET /contests/{contestCode} Get contest details.
ContestsApi contests_get GET /contests Get the list of contests.
CountriesApi country_get GET /country Get the list of countries on codechef.
IDEApi ide_run_post POST /ide/run Runs a code submitted by user.
IDEApi ide_status_get GET /ide/status Get status of submitted code.
InstitutionsApi institution_get GET /institution Get the list of institutions on codechef.
LanguagesApi language_get GET /language Get the list of languages on codechef.
ProblemsApi problems_category_name_get GET /problems/{categoryName} Get the list of problems for given categoryName.
RankingsApi rankings_contest_code_get GET /rankings/{contestCode} Return ranklist for a particular contest.
RatingsApi ratings_contest_type_get GET /ratings/{contestType} Return ratinglist for a particular contest type.
SetsApi sets_add_post POST /sets/add Adds set to the user's account to whom the access token being used belongs.
SetsApi sets_delete_delete DELETE /sets/delete Deletes set from the user's account to whom the access token belongs.
SetsApi sets_get GET /sets/ Get set details for logged in user
SetsApi sets_members_add_post POST /sets/members/add Adds set members to an existing set of the user to whom the access token belongs.
SetsApi sets_members_delete_delete DELETE /sets/members/delete Removes members belonging to a set.
SetsApi sets_members_get_get GET /sets/members/get Get set details for particular sets of the logged in user
SetsApi sets_update_put PUT /sets/update Updates set of the logged in user's account.
SubmissionApi submissions_get GET /submissions/ Get submissions for particular user, problemCode, result and year.
SubmissionApi submissions_submission_id_get GET /submissions/{submissionId} Get details of a submission.
TagsApi tags_problems_get GET /tags/problems Get list of tags for a given problem.
TodoApi todo_add_post POST /todo/add Adds a problem to todo list.
TodoApi todo_delete_all_delete DELETE /todo/delete/all Deletes all the problems added to the todo list.
TodoApi todo_delete_delete DELETE /todo/delete/ Deletes a problem added to the todo list.
TodoApi todo_problems_get GET /todo/problems Gets problems listed in todo.
UsersApi users_get GET /users Get the list of users maximum 20.
UsersApi users_me_get GET /users/me Fetches all the details of logged-in user.
UsersApi users_username_get GET /users/{username} Fetches all the details of a user.

Documentation For Models

Documentation For Authorization

codechef_auth

Author

About

[WIP] python client library for codechef api, generated with swagger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published