Skip to main content

A CLI tool to generate ASCII tree representation of a project structure.

Project description

Indastructa

Indastructa is a convenient CLI tool for quickly creating a clear ASCII tree of your project's file structure.

Perfect for documentation, technical reviews, architecture discussions, or blog posts.


Key Features

  • Clear Output: Generates a beautiful and easy-to-read ASCII tree.
  • Automatic Saving: The result is automatically saved to a project_structure.txt file in the project root.
  • Smart Exclusions: By default, it ignores unnecessary files and folders (such as .git, venv, __pycache__, .idea, and others).
  • Integration with .gitignore: Automatically reads rules from .gitignore and .dockerignore to exclude everything unrelated to source code.
  • Flexible Configuration: Allows specifying target folder, limiting scan depth, and adding custom exclusions and inclusions via command-line arguments.

Installation

You can install indastructa from PyPI or TestPyPI.

Stable Version (from PyPI)

This is the recommended way to install the latest stable release.

pip install indastructa

Development Version (from TestPyPI)

To install the latest pre-release version from our test repository:

pip install --index-url https://test.pypi.org/simple/ indastructa

How to Use

Basic Usage

To scan the current directory, simply run the command:

indastructa

The result will be printed to the console and saved to project_structure.txt.

Specifying a Path

You can scan any directory by providing a relative or absolute path:

# Scan a subdirectory
indastructa ./src

# Scan a directory using an absolute path
indastructa C:\Users\YourUser\Projects\MyProject

Advanced Usage

You can combine flags to customize the output.

  • Limit scan depth with --depth:

    indastructa --depth 2
    
  • Exclude files and folders with --exclude (use quotes for multiple patterns):

    indastructa --exclude "*.md,docs,build"
    
  • Force include files with --include to show them even if they are in .gitignore:

    indastructa --include .env
    
  • Save to a different file with -o or --output:

    indastructa -o custom_structure.md
    
  • Perform a dry run with --dry-run to see the output without saving the file:

    indastructa --dry-run
    

Full Example

Here is a complex example combining all options:

indastructa ./src --depth 3 --exclude "*.pyc" --include ".env" -o src_structure.txt

Exclusion Logic

indastructa uses a filtering system with the following priority:

  1. --include rules: Patterns passed via --include have the highest priority. If a file matches, it will always be shown.
  2. Built-in rules: A default set of common exclusions like .git, venv, __pycache__, etc.
  3. Rules from .gitignore and .dockerignore: Automatically loaded from your project.
  4. --exclude rules: Patterns passed via --exclude.

Future Ideas

For more advanced feature ideas, see the FUTURE_FEATURES.md file in this repository.

  • Selectable ignore files
  • Interactive mode
  • Support for exporting to JSON/YAML

Have ideas or found a bug? Create an Issue on GitHub.


License

The project is distributed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

indastructa-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

indastructa-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file indastructa-0.1.0.tar.gz.

File metadata

  • Download URL: indastructa-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for indastructa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef85de4de57030fca71c1802e2760724164931f7fc3e61bd092cfd4992d52672
MD5 170f0e6cb0ca4de67a75c2cdf4fbd751
BLAKE2b-256 281356c2fd65a06dfd7f60946e1d252827abf2641783c0037cfaeb545f4e243f

See more details on using hashes here.

File details

Details for the file indastructa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: indastructa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for indastructa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3998dcf956df502f4c07eab5edac4e56dedaa20cd219fa3f93c3bec6e05f2bde
MD5 aea3f2f27447e64ec78cdfcf770aa03b
BLAKE2b-256 0df2541ed36b24a760258cac5028f152cf93d0de9248cdcb9e48ba7f42dbb700

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page