Skip to content

Latest commit

 

History

History
110 lines (76 loc) · 2.59 KB

README.md

File metadata and controls

110 lines (76 loc) · 2.59 KB

42 Student Search

42 Search Student

42 Student Search is a user command interface that helps you search for information from 42 Network students

  • have the student id
  • hit enter
  • voilà!

Installation

42 Student Search requires Python v3.6+ and Pip v9.0.1+ to run properly

$ git clone https://github.com/caio-vinicius/42StudentSearch student-search
$ cd student-search

Linux

Install the dependencies required with

$ ./scripts/install_requirements.sh

Docker

$ ./scripts/docker_start.sh

Usage

To run the script and see the user information you have to

$ cd app
$ ./student_search.py foobar

So probably you will see the output on your terminal

example_output_42searchstudent

The first time that you run with a specific id the script will store cache about the request, so next time you run will be much more faster. If you do not want the cache to be consulted and need new information, you can do:

$ ./student_search.py --no-cache foobar

So the process will take a little longer compared to the cache, but it's worth it If you want to clear the cache and just that, without making another request, you can with

$ ./student_search.py --clean-cache foobar

If you want a bunch of unformatted information of a user you can

$ ./student_search.py --all foobar

If you want more options, you can try

Argument Role
--help, -h show this help message and exit
--clean-cache delete local cache files
--no-cache, -n do not use cache, redo the request
--raw, -r show information in raw, without a table
--photo, -p show intra url image and exit
--all output all data to stdout in json

Unit Test

$ cd tests/

You can run multiple tests at once

$ ./test.py

When you do this, the test will consider a "random" list of student ids and perform the search for information for each student.
There are 3 lists (0, 1 and 2). The default is 1, you can choose between these three like this

$ ./test.py 3 

You can pass multiple users if you specify id one after the other and each one will be consulted too

$ ./test.py id benny xitope

Summary

Argument Role
list 0, 1 and 2 to ids list
id ids to test

License

MIT