sk364 / codechef-cli

CodeChef Command Line Client.
https://pypi.python.org/pypi/codechefcli
GNU General Public License v3.0
35 stars 36 forks source link

Enhance Response Text Styling #51

Open sk364 opened 4 years ago

sk364 commented 4 years ago

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
sreesh-mallya commented 4 years ago

Hi there! I would like to work on this issue. Could you please give me a elaborated description of what this issue is about?

sk364 commented 4 years ago

@sreesh-mallya Check the issue description.

sk364 commented 4 years ago

Thinking of using library rich to prettify the responses.

sreesh-mallya commented 4 years ago

Great! Would this be of any use here? Should I keep working, or are you taking a look? @sk364. I've started going through trying to understand how it all works.

sk364 commented 4 years ago

Halo looks good to me. We can use it.

Sure, you can keep working. I will be taking a look later.

travis-sauer-oltech commented 4 years ago

@sk364 is @sreesh-mallya still working on this, or could I give this a whirl?

sreesh-mallya commented 4 years ago

@aUsefulMethod I've started to work on this, but haven't done much in the past week. @sk364 please make the call. I can probably get this done this weekend, or if you want @aUsefulMethod to go ahead with this, that's fine by me too. :)

sk364 commented 4 years ago

@sreesh-mallya can you describe the changes that you are doing? @aUsefulMethod, if interested, can either fill the gaps or extend it.

sreesh-mallya commented 4 years ago

@sk364 I'm not sure if I've done something very significant yet. All I've done is used rich.table to print out the search results in helpers.print_response_util. I need to check the tests and see what lines of code is not required anymore, since rich does all the work for creating and printing the table. I was also thinking of using halo as mentioned before.

sreesh-mallya commented 4 years ago

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, or codechefcli problem WEICOM to get the problem description, and so on. We can use click or Typer, I've found them easier to use than argparse.

@sk364 what do you think?

sk364 commented 4 years ago

@sreesh-mallya yeah, we can use subcommands. You can create a separate issue for it.

sreesh-mallya commented 4 years ago

@aUsefulMethod check out this issue.

sreesh-mallya commented 4 years ago

@sk364 There are a few functions for printing tables and styling responses which I think we won't be needing since we're using rich. Shall I go ahead and remove them?

sk364 commented 4 years ago

Yes, go ahead

Jai2305 commented 3 years ago

Hi, I was just curious that in the problems.py . get_description(...) , on line 36 onward the code is defining a list which is storing certain properties of problems like, Name, Author, Date Added and so on image

but then on line 59 code is using .join to which is converting every object in the list into string and returning it as response , image

the problem is, for making tables I think it would be a lot more easier if the data is returned in a dictionary format rather than string so that separate columns can be constructed using the keys of the dictionary and corresponding values can be filled in cell

ajjayymahato commented 1 year ago

Hi there! I would like to work on this issue. Can you please assign this issue to me!