Add a script that prints a directory as an ASCII tree, like the Unix tree command.
Why
Best small exercise in recursion there is — and the output is immediately satisfying. It also pairs with the "Repository Structure" section of our README, which is currently maintained by hand.
Suggested file
scripts/directory_tree.py
What it should do
- Usage:
python scripts/directory_tree.py . --max-depth 2
- Print the tree with
├──, └──, │ connectors.
- Skip noise by default:
.git, __pycache__, .ipynb_checkpoints, .DS_Store.
Example output
Python-for-beginners/
├── data/
│ └── sample.txt
└── scripts/
└── directory_tree.py
Acceptance criteria
Inspiration
Directory_Tree_Generator from Awesome-Python-Scripts.
Good first issue — comment below to get assigned.
Add a script that prints a directory as an ASCII tree, like the Unix
treecommand.Why
Best small exercise in recursion there is — and the output is immediately satisfying. It also pairs with the "Repository Structure" section of our README, which is currently maintained by hand.
Suggested file
scripts/directory_tree.pyWhat it should do
python scripts/directory_tree.py . --max-depth 2├──,└──,│connectors..git,__pycache__,.ipynb_checkpoints,.DS_Store.Example output
Acceptance criteria
--max-depthrespected; standard library only (pathlib/os,argparse).Inspiration
Directory_Tree_Generator from Awesome-Python-Scripts.
Good first issue — comment below to get assigned.