Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Another data-structure very commonly used in the world of coding are TREE's, for example:
In this case, we will use the Tree Hierarchy concept to scan and browse through a group of files in a computer.
Do not clone this repository.
a) If using Gitpod (recommended) you can clone the boilerplate by clicking here.
b) If working locally type the following command from your command line:
1https://github.com/4GeeksAcademy/flask-rest-hello
1$ pipenv install --python 3
1$ pipenv shell
1$ python src/app.py
1$ python src/test.py
💡 Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>
), and upload the code to your new repository using add
, commit
and push
.
Given the set of files under the data-files
folder, please write a program that creates a JSON file called report.json that outputs the following report:
1{ 2 "levels": 3, 3 "total_files_found": 5, 4 "files_found": ["file_one.csv", "file_two.json"], 5 "file_extentions_found": ["csv", "json"], 6 "total_folders_found": 3, 7 "folders_found": ["folder_one","folder_tow"], 8 "links_found": 12, 9 "broken_links_found": 4, 10}
Report explanation:
Property | Description |
---|---|
levels | Number of connections between the top node and the lowest node |
total_files_found | how many files were found, folders don't count |
files_found | the name of each of the files found, without folders |
file_extentions_found | a non-repeated list of the file extensions found inside the tree |
total_folders_found | total amount of folders found, files don't count |
Links found | How many URL's were found starting with http or https |
broken_links_found | How many of the links were broken (you have to do a GET request and check for 404) |
python get files in folder
on google.python file is directory
to check if a file is a directory or not.python find all links in string
python get file extension
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request
Difficulty
easy
Average duration
8 hrs
Technologies
Python
The Command Line
Data Structures
File Hierarchy
http Request