Skip to main content

treeGen - A directory Tree Generator

Simple Python CLI App to generate a directory tree for a given path

Current TaskList

  • Add support for sorting files and directories
  • Add icons and colors to the tree diagram
  • Set up the application to publish it as an open source project

Run the App

To run treGen, you need to download the source code. Then open a terminal or command-line window and run the following steps:

  1. Create and activate a Python virtual environment
$ cd rptree_project/
$ python -m venv ./venv
$ source venv/bin/activate
(venv) $
  1. Run the application
(venv) $ python tree.py /path/to/directory/

Note: The -h or --help option provides help on how to use RP Tree.

To take a quick test on treGen, you can use the sample home/ directory provided along with the application's code and run the following command:br

(venv) $ python tree.py ../hello/

../hello/ │ ├── hello/ │ ├── init.py │ └── hello.py │ ├── tests/ │ └── test_hello.py │ ├── requirements.txt ├── setup.py ├── README.md

That's it! You've generated a nice directory tree diagram.

Current Features

If you run treGen with a directory path as an argument, then you get the full directory tree printed on your screen. The default input directory is your current directory.

treGen also provides the following options:

  • -v, --version shows the application version and exits
  • -h, --help show a usage message
  • -d, --dir-only generates a directory-only tree
  • -o, --output-file generates a tree and save it to a file in markdown format

Release History

  • 0.1.0
  • 1.0.0
  • 2.0.0
    • Serious breaking issues with console scripts
  • 3.0.0
    • Finally got the setup.py to work xD
  • 4.0.0
    • A work in progress

About the Author + Original Fork Address

Leodanis Pozo Ramos - Email: leodanis@realpython.com A fork from https://github.com/realpython/materials/tree/master/directory-tree-generator-python

Metadata

Release files for treGen 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for treGen 3.0.0
File Interpreter ABI Platform
treGen-3.0.0-py3.9.egg Legacy Egg format - - Details

Release files / treGen-3.0.0-py3.9.egg

Download URL treGen-3.0.0-py3.9.egg
Size 7.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
d7c7ac8d47f2ed0c6ce6719baf3283ed5efd8031ce878b41fc4204917e3970ac
BLAKE2b-256 checksum
How to use checksums
c10b346351845e5198200fa016d3517ac58e7602000c41e4855d8d582f0f334a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

3.0.0 This release

1 release file

2.2.5

2 release files

2.2.2

1 release file

2.2.1

1 release file

2.2.0

2 release files

2.1.1

1 release file

2.1.0

2 release files

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page