GetRepo-py
It is a test task for the Back-End Developer role vacancy in a company Noxtton.
GetRepo-py is a command line client that queries GitHub API and searches repositories by given arguments.
I completed every task (including bonus ones).
tasks:
- The client should accept a search string, query GitHub API for repositories and display the results.
- In addition to the search word, the client should accept two optional parameters.
- Ignore Parameter will ignore repositories, where the name of the repository includes the provided string.
- Sort Parameter will sort results by repository name in Ascending or Descending order.
- Solution needs to be documented in Markdown format.
- Add unit tests to your solution.
- Log all search requests in a separate log file.
- Provide a Docker file to build your solution as a Docker Image. Include building and running instructions in the documentation.
😃
):
I also added some features (to get bonus points for creativity - You can specify a programming language to query repos by it.
- Additional sorts. sort and order are separated.
- There are 4 sort options: by number of stars, forks, help-wanted-issues and last updated date.
- And you can choose to sort in ascending or descending order.
- There are 4 sort options: by number of stars, forks, help-wanted-issues and last updated date.
- You can specify how many results you want to get.
- Colored terminal to make it prettier/more visible.
- Before adding unit tests I accessed GitHub API with Postman and got specific (static) urls and test json data that is stored in the jsonTest folder. I tested my function with that.
- In addition to a log file that is fully dynamic, you can choose to save results to the json file, that is stored in the SavedJSON folder.
I have used following libraries:
requests
json
colorama
logging
unittest
Docker
At first build docker image:
docker build -t getrepo .
then run container:
docker run -t -i getrepo