PrintStruct: print project tree structure and optionally zip it
Project description
PrintStruct
PrintStruct is a clean, lightweight Python CLI that prints a directory tree of your project while respecting .gitignore, with optional zipping support.
The problems it solves:
- sharing project structure in issues or pull requests
- generating directory trees for documentation
- pasting project layouts into LLMs
- zipping projects for feeding to LLMs using
.gitignoredirections
Quick Start (10 seconds)
Installation using pip (recommended):
Run this command in your terminal:
pip install printstruct
Usage:
Open a terminal in any project and run:
prst
This prints the directory structure of the current folder.
You can also specify a path explicitly:
prst <directory_path>
Example (Windows PowerShell):
PS C:/Users/Projects/PrintStruct> prst .
Output:
PrintStruct
├─ LICENSE
├─ pyproject.toml
├─ README.md
├─ requirements.txt
└─ structure.py
Updating PrintStruct:
To update the tool, reinstall it using pip. Pip will automatically replace the older version with the latest release.
Useful CLI arguments
In addition to the directory path, the following options are available:
| Argument | Description |
|---|---|
--version, -v |
Displays the installed version. |
--zip [name] |
Zips the project while respecting .gitignore. Example: --zip a creates a.zip. If no name is provided, a random ID is used. |
--max-depth |
Limits recursion depth. Example: --max-depth 1 shows only top-level files and folders. |
--all, -a |
Includes hidden files and directories. Does not override .gitignore. |
--ignore |
Adds extra files or directories to ignore. |
--gitignore-depth |
Controls how deeply .gitignore files are discovered. Example: --gitignore-depth 0 uses only the root .gitignore. |
--no-gitignore |
Ignores all .gitignore rules when set. |
--max-items |
Limits items shown per directory. Extra items are summarized as ... and x more items. Default: 20. |
--no-limit |
Removes the per-directory item limit. |
Installation (for Contributors)
Clone the repository:
git clone https://github.com/ShahzaibAhmad05/PrintStruct
Move into the project directory:
cd PrintStruct
Install dependencies:
pip install -r requirements.txt
The tool is now available as a Python CLI on your system.
Contributions
Issues and pull requests are welcome. Ideas that would fit well include improved formatting, colorized output, test coverage, and performance optimizations.
PrintStruct is intentionally small and readable, so contributions that preserve simplicity are especially appreciated.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file printstruct-1.3.1.tar.gz.
File metadata
- Download URL: printstruct-1.3.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
758edd915377ee17114f89c90593f0c10d55561a3371a30da4b667bee2852ab1
|
|
| MD5 |
7079350ee5c97a86ce57724faf573336
|
|
| BLAKE2b-256 |
37f498b45fb68fc113ff2bcf369a5c3fad930e46912eb37fda888177f04a9235
|
Provenance
The following attestation bundles were made for printstruct-1.3.1.tar.gz:
Publisher:
workflow.yml on ShahzaibAhmad05/PrintStruct
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
printstruct-1.3.1.tar.gz -
Subject digest:
758edd915377ee17114f89c90593f0c10d55561a3371a30da4b667bee2852ab1 - Sigstore transparency entry: 775104668
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/PrintStruct@3a4dc066b516a0df744d4edb59d43768e3955b74 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3a4dc066b516a0df744d4edb59d43768e3955b74 -
Trigger Event:
release
-
Statement type:
File details
Details for the file printstruct-1.3.1-py3-none-any.whl.
File metadata
- Download URL: printstruct-1.3.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dd71f53fc4a9983b617abb3a0984f111ba72cdf81fc63f9a90a073d44995f84
|
|
| MD5 |
4e91d2cb9052d0c6d4315705ab7570b2
|
|
| BLAKE2b-256 |
4cabcc502afd9a34120b8ed1ea88671500d0cc2bcc7a52804ad3803e9f49d941
|
Provenance
The following attestation bundles were made for printstruct-1.3.1-py3-none-any.whl:
Publisher:
workflow.yml on ShahzaibAhmad05/PrintStruct
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
printstruct-1.3.1-py3-none-any.whl -
Subject digest:
9dd71f53fc4a9983b617abb3a0984f111ba72cdf81fc63f9a90a073d44995f84 - Sigstore transparency entry: 775104670
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/PrintStruct@3a4dc066b516a0df744d4edb59d43768e3955b74 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@3a4dc066b516a0df744d4edb59d43768e3955b74 -
Trigger Event:
release
-
Statement type: