codechef-cli
codechef-cli copied to clipboard
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
Hi there! I would like to work on this issue. Could you please give me a elaborated description of what this issue is about?
@sreesh-mallya Check the issue description.
Thinking of using library rich to prettify the responses.
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.
Halo looks good to me. We can use it.
Sure, you can keep working. I will be taking a look later.
@sk364 is @sreesh-mallya still working on this, or could I give this a whirl?
@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. :)
@sreesh-mallya can you describe the changes that you are doing? @aUsefulMethod, if interested, can either fill the gaps or extend it.
@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.
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?
@sreesh-mallya yeah, we can use subcommands. You can create a separate issue for it.
@aUsefulMethod check out this issue.
@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?
Yes, go ahead
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
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 ,
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
Hi there! I would like to work on this issue. Can you please assign this issue to me!