Giter Club home page Giter Club logo

codechef-cli's Introduction

CodeChef CLI PyPI version Build Status

A command-line tool for querying and submitting problems on CodeChef.

Features

  • Search & submit problems
  • Search solutions
  • Search users, ratings, tags and teams

Requirements

Installation

pip install codechefcli

Usage

# See full list of options:
codechefcli --help

# Login to CodeChef
codechefcli --login

# Get problem description:
codechefcli --problem WEICOM

# Get contests:
codechefcli --contests

# Submit a problem:
codechefcli --submit WEICOM /path/to/solution/file C++

Linting & Testing

# run tests
pytest -v

# lint
isort
flake8 . --max-line-length=100

codechef-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

codechef-cli's Issues

Review OS Compatability

Should be compatible with:

  • macOS (versions: 10.13.x, 10.14.x, 10.15.x)
  • Ubuntu (versions: 16.x, 18.x, 20.x)
  • Windows (versions: 10)

Non-exhaustive list of checks:

  • Should install without exploding
  • All tests should pass
  • Login-Logout should create-delete cookies on the set path
  • Should be able to use pager module without exploding
  • Output formatting should be the same across all OS
  • Input formatting and usage should be the same across all OS

Enhance Response Text Styling

Responses from various options require styling as to enhance the UI/UX.

Example (output of --search option):

This prints out a table with headers as capitals. Could print out as bold, title-cased. Also, in rows it could print out the Code in different color.

NAME                                                 CODE       SUCCESSFUL SUBMISSION   ACCURACY   

MEX-ception                                          TOTEM      7                       32.26

ImportError: cannot import name color_text

Hi, I am using homebrew 1.6.8, and I did this:

$ pip install codechefcli
Collecting codechefcli
  Downloading https://files.pythonhosted.org/packages/cc/e1/f36711898abc0fa1801623ef49b1e592f5089601d87cccfa7eb600257ed3/codechefcli-0.3-py2.py3-none-any.whl (45kB)
    100% |████████████████████████████████| 51kB 45kB/s
Collecting BeautifulSoup4 (from codechefcli)
  Downloading https://files.pythonhosted.org/packages/a6/29/bcbd41a916ad3faf517780a0af7d0254e8d6722ff6414723eedba4334531/beautifulsoup4-4.6.0-py2-none-any.whl (86kB)
    100% |████████████████████████████████| 92kB 88kB/s
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages (from codechefcli) (2.7.0)
Installing collected packages: BeautifulSoup4, codechefcli
Successfully installed BeautifulSoup4-4.6.0 codechefcli-0.3

when
$ codechefcli --help
I got this:

Traceback (most recent call last):
  File "/usr/local/bin/codechefcli", line 7, in <module>
    from codechefcli.__main__ import main
  File "/usr/local/lib/python2.7/site-packages/codechefcli/__main__.py", line 6, in <module>
    from .problems import (get_contests, get_description, get_ratings,
  File "/usr/local/lib/python2.7/site-packages/codechefcli/problems.py", line 13, in <module>
    from .utils.helpers import (color_text, get_session, html_to_list,
ImportError: cannot import name color_text

Using subcommands instead of using options

I've some suggestions too: How about using subcommands instead of using options for logging in, getting the problem description, listing contests, and submitting code?

Maybe something like:

  • codechefcli login to login
  • codechefcli problem WEICOM to get the problem description
  • codechefcli problem --level easy or codechefcli problem --search easy to search for problems based on difficulty
  • codechefcli contests to list contests
  • codechefcli submit WEICOM /path/to/solution/file C++ to submit a solution. Maybe we can use options here.

How about we use typer, instead of argparse?

Originally posted by @sreesh-mallya in #51 (comment)

Shell completion scripts

Hi!

Could we possible have some shell completion scripts please?

I might be able to look into it eventually, though if anyone has experience with these, might be smoother ride.

Handling Images in Problem Description

Currently, if there are image(s) in a problem description, nothing is displayed where the image is supposed to be.

Example: codechefcli --problem ZUBTRCNT compare with ZUBTRCNT Problem - Codechef

This can be handled either by
A.) prompting user to download the images found in description, or
B.) providing image url (possibly, in different color) in the description where the image is supposed to be.

Temporary Page down

Page Down Error
Sometimes(like today) due to too many requests pages( like today it was the rating page), the page is taken down, which is causing exceptions in catching the json(JSONDecodeError).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.