Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taeefnajib/pygentree
A Python package to generate ASCII tree representation of directory structures.
https://github.com/taeefnajib/pygentree
ascii directory directory-tree file-structure files filesystem filetree generate generator python tree
Last synced: about 15 hours ago
JSON representation
A Python package to generate ASCII tree representation of directory structures.
- Host: GitHub
- URL: https://github.com/taeefnajib/pygentree
- Owner: taeefnajib
- License: mit
- Created: 2024-10-24T07:40:28.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-22T16:28:01.000Z (2 months ago)
- Last Synced: 2024-12-23T01:46:58.247Z (about 1 month ago)
- Topics: ascii, directory, directory-tree, file-structure, files, filesystem, filetree, generate, generator, python, tree
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PyGenTree
[![PyPI version](https://img.shields.io/pypi/v/pygentree.svg?style=for-the-badge)](https://pypi.org/project/pygentree/)
[![License](https://img.shields.io/pypi/l/pygentree.svg?style=for-the-badge)](https://github.com/taeefnajib/pygentree/blob/main/LICENSE)
[![Python versions](https://img.shields.io/pypi/pyversions/pygentree.svg?style=for-the-badge)](https://pypi.org/project/pygentree/)A Python package to generate ASCII tree representation of directory structures.
## Requirements
- Python 3.6 or higher
## Installation
```bash
pip install pygentree
```## Usage
```bash
# Basic usage (current directory)
pygentree# Specify a directory
pygentree /path/to/directory# Limit depth level
pygentree -l 2# Sort files and folders
pygentree -s asc # ascending order
pygentree -s desc # descending order
pygentree -s standard # default: folders first, then files# Show only directories
pygentree -d# Ignore hidden files and directories, e.g. .git, .env, etc.
pygentree --ignore-hidden# Exclude specific files or directories (comma-separated)
pygentree -e "node_modules,venv,dist"# Save output to file (default .txt)
pygentree -o tree.txt# Save output in different formats
pygentree -o tree.rst --format rst # Save as reStructuredText
pygentree -o tree.txt --format txt # Save as plain text (default)# Show version
pygentree -v# Show help
pygentree -h
```## Features
- Generate ASCII tree representation of directory structures
- Customize maximum depth level
- Multiple sorting options
- Option to show only directories
- Option to ignore hidden files and directories
- Exclude specific files and directories
- Save output to file in multiple formats (txt, rst)
- Handle permission errors gracefully
- Cross-platform compatibility## Supported Python Versions
- Python 3.6
- Python 3.7
- Python 3.8
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12## License
MIT License