New release - utopian-cli 0.4.2

in #utopian-io6 years ago (edited)

terminal.png

A few days ago I released utopian-cli 0.3.1, and now I'm back again with the new and improved utopian-cli 0.4.2. I've added quite a lot of features in this update, so I will try and condense it as much as possible and give an overview of everything below! Use the following command to upgrade if you have already installed it

pip install utopian --upgrade

otherwise use the command to install it

pip install utopian

Features overview

The "performance" command has been updated; I've added a few options and also changed/updated already existing ones. I've also added the new command "project" which allows you to see an overview of a project on GitHub! In general I've also cleaned up the code a bit, removed some duplicate code and made some functions more dynamic (can see all the changes here).

I will go over all the changes one by one below! You can also check out the usage of all commands on the README.

Improved features

Performance

I've changed the account argument to an option (it's obviously still required). It can now also take multiple accounts, which you can easily specify like this for example: -a amosbastian -a roj. This gives an overview of all the given accounts combined. After implementing support for multiple accounts I also added the --supervisor option, which allows you to see an overview of a supervisor's team, like so

supervisor_overview.gif

I also added the ability to sort the returned tables using the --sort option. This option can take the following three options: accepted, rejected and total. An example of sorting by rejected and accepted respectively is shown in the GIF below

sort_table.gif

Of course there is also error checking for everything that I added. It makes sure the given accounts are all moderators / supervisors, if that account type was specified respectively. As mentioned above I also removed some functions after I combined them into a somewhat more dynamic function. This cleaned up the code a bit (there is still a lot of cleaning up left to do!), making it a bit easier to add commands in the future. The new documentation for the "performance" command can be found here.

New features

Project

I added the command "project" which allows you to see an overview of a project, e.g. utopian-io/utopian.io. This has similar options as the "performance" command, but instead of specifying an account you can specify a GitHub repository. Just like the "performance" command you can then specify a date or an amount of days using the --date and --days options respectively. The default table is an overview of the contributions to that project per category, with their total reviewed contributions, total accepted contributions and total rejected contributions respectively (and of course the reward)!

image.png

There is also a --details option that allows you to see an overview of the contributors of a project. Of course there is also a --limit option which allows you to limit the --details table to the top N contributors.

image.png

Finally I added the options --sort, --author and --category. The --sort option lets you to sort the table by accepted contributions, rejected contributions and total contributions. The --author option lets you sort a project by authors, so you only see an overview of contributions made by them. The --category option lets you sort a project by categories, so you only see an overview of contributions made to that category. An example of these options is shown in the image below

image.png

The documentation for the "project" command can be found here.


How was it implemented?

For the new "project" command I use the GitHub API to get the project's ID. I can then use this ID to get the contributions made to it from the Utopian.io API. After this it simply checks the options to see which functions it needs to execute (like filtering by authors for example), and once this is done it uses the same functions as the "performance" command to show the table. For the "performance" command's option --supervisor I create a supervisor's team simply by looking at who each moderator's referrer is. Since both commands support multiple authors I also had to change some code around so this would work, but it was pretty straight-forward to do so. If anyone wants to know how something was implemented specifically then just check the code or ask in the comments and I'll get back to you!

Roadmap

Still the same as last time! I'm definitely getting more used to using Click so my coding efficiency has gone up a lot, so whenever I think of something to implement it goes pretty quick and all kinds of new ideas pop into my head! Will have to see what the next thing that pops into my head will be...

How to contribute?

  1. Fork the repository
  2. Create a feature branch with git checkout -b your-feature
  3. Code and document your feature
  4. Commit your changes with git commit -m "add my features"
  5. Push to your branch with git push origin your-feature
  6. Create a new pull request

Anything you can add to the project is valuable to me, be it bug reports, suggestions etc. so please don't hesitate!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

YASS!
Today I wished I was able to use it on my mobile, (is there a way to port it on iPhone :D)
It really answers to my questions.. And I'm thankful for adding "projects" into it. _o_

Maybe someday haha.

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Great work @amosbastian.

Thanks for the kind words!

Hey @amosbastian I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.029
BTC 63351.43
ETH 3495.50
USDT 1.00
SBD 2.53