https://github.com/maxhalford/directory-architecture
:file_folder: Mimicking the tree command
https://github.com/maxhalford/directory-architecture
Last synced: 8 months ago
JSON representation
:file_folder: Mimicking the tree command
- Host: GitHub
- URL: https://github.com/maxhalford/directory-architecture
- Owner: MaxHalford
- Created: 2015-06-03T19:44:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-02T16:57:13.000Z (about 10 years ago)
- Last Synced: 2025-03-31T13:37:31.007Z (10 months ago)
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Directory Architecture

Works with Python 3.
When I make tutorials or give reports I like displaying all the files and directories of a project like a cascade. These can be cumbersome to type by hand and so I wrote a small script to generate these automatically, a bit like [tree](http://linux.die.net/man/1/tree).
## Usage
### Basic
```sh
python probe.py example/
```
example
├───┐ static
│ ├───┐ js
│ │ ├─── Leaflet.vector-markers.min.js
│ │ └─── Leaflet.vector-markers.js
│ ├───┐ data
│ │ └─── Toulouse.csv
│ └───┐ css
│ ├─── Leaflet.vector-markers.css
│ └─── Leaflet.vector-markers.css.map
├───┐ lib
│ ├─── __init__.py
│ └─── JCDecaux.py
├───┐ templates
│ └─── index.html
├─── serve.py
└─── update.py
By doing this a markdown file called ``architecture.md`` is saved into the directory that is probed. It ressembles the example above. You can use both absolute and relative paths. You don't have to worry about the `/` at the end.
### Ignoring files with certain extensions
```sh
python probe.py example/ -i js css
```
example
├───┐ static
│ ├───┐ js
│ ├───┐ data
│ │ └─── Toulouse.csv
│ └───┐ css
│ └─── Leaflet.vector-markers.css.map
├───┐ lib
│ ├─── __init__.py
│ └─── JCDecaux.py
├───┐ templates
│ └─── index.html
├─── serve.py
├─── architecture.md
└─── update.py
### Probing to a certain level
```sh
python probe.py example/ -d 0
```
example
├───┐ static
├───┐ lib
├───┐ templates
├─── serve.py
├─── architecture.md
└─── update.py
## To do
- Add filter
- Add prety graphics
## Contact
If you want to implement a new feature please feel free to send me a mail () and I'll be glad to discuss/help.
[Reddit thread](http://www.reddit.com/r/Python/comments/3b2gw1/probing_a_directory_to_extract_the_architecture/)