Skip to content

This collection of Python scripts generates a tree-like structure of a project directory. Initially inspired by the need to document an ASP.NET Core project, it can be adapted for various directories by adjusting the folders and file types to include or exclude.

License

Notifications You must be signed in to change notification settings

ChromuSx/DirectoryStructureExporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Directory Structure Exporter

Directory Structure Exporter Logo

GitHub Sponsors Ko-fi Buy Me a Coffee PayPal

A comprehensive desktop application for visualizing, filtering, and exporting directory structures in various formats. Built with Python and PyQt6, offering an intuitive graphical interface and powerful filtering options.

Development Note: This project was entirely developed and tested using Claude 4 (Sonnet), Anthropic's latest AI model. Claude 4 demonstrates advanced code architecture, multi-file project management, and sophisticated GUI development capabilities, showcasing state-of-the-art AI-assisted software development.

🌟 Key Features

πŸ“ Multi-Format Export

  • TXT: Plain text format for quick viewing
  • HTML: Navigable web page with CSS styling
  • JSON: Structured format for programmatic processing
  • XML: Markup format for integration with other systems

πŸŽ›οΈ Advanced Filtering System

  • Excluded directories: Customizable list of folders to ignore (e.g., .git, node_modules)
  • Excluded files: Specific filtering for unwanted files (e.g., .gitignore, thumbs.db)
  • Included extensions: Targeted selection for specific file types (e.g., .py, .js, .css)
  • Size filters: Customizable file size ranges
  • Temporal filters: Filtering by creation and modification dates
  • Regular expressions: Advanced patterns for precise filtering

πŸ“‹ Preset Management

  • Save and load predefined configurations
  • Customizable preset system for different projects
  • Import/export configurations in JSON format

🌍 Multi-language Support

  • Italian (default)
  • English
  • French
  • German
  • Spanish

🎨 Customizable Interface

  • Light/dark/system themes
  • Interactive tree view with lazy loading
  • Real-time search functionality
  • Drag & drop directory selection
  • Context menus for quick actions

πŸ› οΈ Project Architecture

directory-structure-exporter/
β”œβ”€β”€ main.py                      # Application entry point
β”œβ”€β”€ build.py                     # Executable build script
β”œβ”€β”€ core/                        # Main business logic
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ exporter.py             # Export engine
β”‚   β”œβ”€β”€ filters.py              # Filtering system
β”‚   └── config_manager.py       # Configuration and preset management
β”œβ”€β”€ ui/                         # User interface
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ main_window.py          # Main window
β”‚   β”œβ”€β”€ export_tab.py           # Export tab
β”‚   β”œβ”€β”€ filters_tab.py          # Advanced filters tab
β”‚   └── config_tab.py           # Configuration tab
β”œβ”€β”€ utils/                      # Utilities and services
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ file_utils.py           # File operations
β”‚   β”œβ”€β”€ path_utils.py           # Path management
β”‚   β”œβ”€β”€ directory_scanner.py    # Asynchronous directory scanning
β”‚   β”œβ”€β”€ resources.py            # Resource management (icons, assets)
β”‚   └── translation_manager.py  # Translation system
└── translations/               # Translation files (optional)

πŸš€ Installation and Usage

Prerequisites

  • Python 3.8 or higher
  • PyQt6

Installing Dependencies

pip install PyQt6

Running the Application

python main.py

Building Executable

To create a standalone executable file:

# Install PyInstaller if not present
pip install pyinstaller

# Run the build script
python build.py

The executable will be available in dist/DirectoryStructureExporter.exe

πŸ“– User Guide

1. Basic Export

  1. Open the "Export" tab
  2. Select a directory using the "Browse..." button or drag & drop
  3. Choose the output file path and format
  4. Click "Export"

2. Filter Configuration

In the "Filters" tab you can set:

  • File sizes: Size ranges in bytes
  • Dates: Creation and modification filters
  • Apply filters: Enable/disable filter application

3. Configuration Management

The "Configuration" tab allows you to:

  • Add/remove excluded directories
  • Manage specific files to exclude
  • Configure included extensions
  • Use regular expressions for complex patterns
  • Save custom presets

4. Regular Expression Examples

  • ^temp - Folders starting with "temp"
  • backup$ - Files ending with "backup"
  • .*\.tmp$ - Files with .tmp extension
  • ^data_\d+$ - Patterns like "data_123"

βš™οΈ Advanced Configuration

Configuration Files

Settings are automatically saved through QSettings. Presets are stored in JSON files for portability.

Preset Customization

{
  "excluded_dirs": [".git", ".vs", "node_modules"],
  "excluded_files": [".gitignore", "thumbs.db"],
  "included_file_extensions": [".py", ".js", ".css"],
  "min_file_size": 0,
  "max_file_size": "inf"
}

Performance

  • Lazy Loading: Progressive loading for large directories
  • Asynchronous Scanning: Responsive interface during processing
  • Caching: Optimization for repeated operations

πŸ”§ Development

Adding New Languages

  1. Modify utils/translation_manager.py
  2. Add language code to available_languages
  3. Insert translations in the _translations dictionary

Extending Filters

To add new filter types:

  1. Modify core/filters.py for logic
  2. Update ui/filters_tab.py for interface
  3. Extend core/config_manager.py for persistence

New Export Formats

  1. Add method in core/exporter.py
  2. Update interface in ui/export_tab.py
  3. Test with various directory structures

πŸ› Troubleshooting

Common Issues

  • Permission errors: Run as administrator for system directories
  • Large files: Set appropriate size limits
  • Slow performance: Use filters to reduce the number of processed files

Logging and Debug

The application shows status messages in the bottom bar and informative dialogs for critical operations.

πŸ“„ License

Project developed for educational and commercial use. Check the license file for specific details.

🀝 Contributing

Contributions welcome! For improvement proposals:

  1. Fork the project
  2. Implement changes
  3. Test thoroughly
  4. Submit a pull request

πŸ’– Support the Project

This project is completely free and open source. If you find it useful and would like to support its continued development and updates, consider making a donation. Your support helps keep the project alive and motivates me to add new features and improvements!

GitHub Sponsors Ko-fi Buy Me a Coffee PayPal

Every contribution, no matter how small, is greatly appreciated! ❀️

πŸ“ž Support

For issues, bug reports, or feature requests, use the repository's issue system.


Developed entirely with Claude 4 (Sonnet) - Showcasing AI-powered software development

About

This collection of Python scripts generates a tree-like structure of a project directory. Initially inspired by the need to document an ASP.NET Core project, it can be adapted for various directories by adjusting the folders and file types to include or exclude.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages