This tool consists of three functions:
(a) randomuser.py generates a CSV file consisting of every entry from GET request of API.
(b) searchcsv.py searches through id of user and filters results on the terminal window.
(c) sorting.py sorts and generates a CSV file which is a sorted file on the basis of FirstName of all users.
How to use this tools:
- The tools requires following libraries :
requestsandpandas.
To install these dependencies:
pip install -r requirements.txt
To run script which generates CSV file from API , type following:
python3 randomuser.py
A new CSV file will be generated named users.csv in the installation folder.
Ctrl + C to terminate the script.
To read users.csv file and generate individual entry on terminal, type the following:
The result will be displayed if the id is valid and present in csv.
To run script which generates a sorted CSV file on FirstName basis, type following:
python3 sorting.py
A new CSV file will be generated named users-sorted.csv in the installation folder.
-
These scripts generates two CSV files: (a)
users.csv
(b)
users-sorted.csv
Same samples are uploaded with scripts.
This tool is licensed under MIT license. The version of the tool is v0.1.0.
Credits to random-data api for providing free access to their APIs. Credits to AdvancedWare for providing me the opportunity to work on this project.
