Introducing utopian-cli - A command-line interface for the Utopian.io API

in #utopian-io7 years ago (edited)

wowow.png

I was recently browsing the development section of Utopian.io and one of the contributions caught my eye: A command line GoDaddy API Implementation (in Python). When I saw this I knew I wanted to make my own CLI, more specifically a Utopian.io CLI, so I started looking for ways to implement one, and ended up deciding to use the Python package Click.

What is the project about?

As mentioned above, it's a command-line interface implemented using the Python package Click. Some more information about it can be found in the README of my GitHub repository! I wanted to implement this because of a few reasons, but the main ones were that I wanted to learn about how to implement a CLI (I still am learning and will improve it along the way) and because I thought it would be useful for myself and other Utopian.io users who use the terminal regularly.

Usage: utopian [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  contributions
  moderators

Currently it allows the user to filter moderators and contributions and print them to the terminal. Below I will show an example of both commands with their respective options!

Moderators

One of the CLI's commands is the "moderators" command. Its options are currently

image.png

which are shown in action in the GIF below

utopian_moderators.gif

Contributions

The other command is the "contributions" command. Its options are currently

image.png

of which some are shown in the GIF below

utopian_contributions.gif

The only option that I didn't show in the GIF is the --reviewed / --unreviewed flag, which is very useful in my opinion and allows you to find e.g. unreviewed Dutch translations (very useful for me)!

Technology stack

I used the following to create the CLI

  • Python3.6 using Click and requests

I haven't tested it with other versions, except Python2.7, and it doesn't work for that. In the future I will look at adding support for multiple versions and actually testing them to see if they work or not.

Roadmap

I don't have any definite plans, but I might make it show the permlink of contributions instead of the title and I will work on adding the rest of the Utopian.io API to the CLI. I will probably think of other things that will help me personally (when moderating for example) and add them as well. I am also hoping people will suggest commands/options/arguments they would like to see implemented, so if you have any, let me know!

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:  

Thank you for the contribution. It has been approved.

Very well documented, very nice touch with the animated gif. I love that purple!

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

@amosbastian, Approve is not my ability, but I can upvote you.

I thought about urls when I was looking into gifs :) maybe an -option to show as permlink could be useful.
that's really looking lovely, gotta check that click's documentation first and I'm finally getting familiar with github. Let's see if I can make it to a PR.

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.18
TRX 0.16
JST 0.029
BTC 76024.68
ETH 2926.23
USDT 1.00
SBD 2.60