Git Product home page Git Product logo

gitsearch's Introduction

GitSearch CLI

Build Status

Gitsearch CLI is a github search tool that enables people to search repositories and get various information about them using Github API

Features

  • Search Github Repositories by given string
  • Sort data in ascending or descending order
  • Ignore desired repositories by name

Project Installation

Without Docker

Gitsearch CLI requires Python3 v3.6+ to run.

Instructions to install the dependencies and start the CLI.

cd gitsearch
pip install --editable .
gitsearch --help

Note: Use gitsearch ---help to make sure that everything worked as desired

Note: you can use cli_test.py file located in the tests folder to test project against various test cases

Docker

Gitsearch CLI is very easy to install and deploy in a Docker container.

cd gitsearch
docker build -t gitsearch --rm .

This will create the gitsearch image and pull in the necessary dependencies.

Once done, run the Docker image as seen in the example

docker run -t -i gitsearch -r arg_name

Verify the deployment by running test search query of your desired repository.

docker run -t -i gitsearch -r teststr

How to use

GitHub CLI is a simple app that can be used to receive Github repositories search information. It enables people to get various information about them using Github API

Note! Gitsearch CLI displays data in table, which is RESPONSIVE to the user's terminal size, as long as user does not use docker, since docker uses simulated terminal and there is no way determinig size of terminal in this case.


CLI call example


Example 1:


Gitsearch CLI acceepts several arguments, let's start with the: -r, --reponame

Note! this is a required argument, which can be used to enter a search string

Let's provide data to the argument ๐Ÿ˜Ž

gitsearch -r repo_name
docker run -t -i gitsearch -r repo_name

In this case API will return:

Example 1

At the end of the screen, for pagination purposes, two options are promoted for a page navigation

  • Use UP, DOWN arrow keys to navigate throught pages

  • Input desired page number by pressing to ":" + page number

Example 1 continuation

Example 2:


To sort data one can use: -s, --sort

this is a optional argument, which can be used to sort data by name in ascending or descending order

Let's provide data to the argument ๐Ÿ˜Ž

gitsearch -r repo_name -s asc
docker run -t -i gitsearch -r repo_name -s asc

In this case API will return sorted data ascending order:

Example 2

let's try to sort data in descending order

gitsearch -r repo_name -s desc
docker run -t -i gitsearch -r repo_name -s desc

Which will give us

Example 2 continuation


Data sorted in descending order

Example 3:


We also can ignore some repositories by using: -i, --ignore

this is a optional argument, which can be used to ignore data by name, or by list of the names

Note! if you want to ignore multiple repositories, you can use "," as a delimiter

Example

  • gitsearch -r repo_name -i name1,name2

Let's provide data to the argument ๐Ÿ˜Ž

For example, if we want to ignore let's say first two elements of the data:

Example 3

We run the command:

gitsearch -r repo_name -i repokemon,meta-learning-lstm
docker run -t -i gitsearch -r repo_name -i repokemon,meta-learning-lstm

Which will result in:

Example 2


License

MIT

Free Software, Hell Yeah!

gitsearch's People

Contributors

michael-malania avatar

Watchers

 avatar

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.