PrintStruct: print project structure and optionally zip it
Project description
PrintStruct
A Python CLI tool for printing the structure of your project in a visually easy-to-read format. Respects .gitignore files when present so ignored files and folders are omitted from the output.
Example usage (on windows powershell):
PS C:/Users/Projects/PrintStruct> prst .
outputs:
PrintStruct
├─ LICENSE
├─ pyproject.toml
├─ README.md
├─ requirements.txt
└─ structure.py
Quick Setup
Installation using pip:
- Run this command in your terminal:
pip install printstruct
Installation (for Development purpose):
- Clone the repository (main branch):
git clone https://github.com/ShahzaibAhmad05/PrintStruct
- Move your terminal to the project
cd PrintStruct
- Open
pyproject.toml, and name the keyword you want to use in terminals to call the tool under project.scripts (default is prst):
[project.scripts]
prst = "main:main" # change prst to your preffered keyword
- Install the project on your system (globally) using pip:
pip install -r requirements.txt
and Done! The tool is installed as a python script on your system.
Usage:
- Open a terminal in any project (any time) and run:
prst
This will print the whole structure of the repository as shown. In fact, You can also just type:
prst <directory_path>
in any terminal to get the structure of the directory printed.
For Updates:
To update the tool simply follow the installation process again, but with the latest release version. Pip will automatically handle old version removal.
Useful CLI args
Other than the directory path, here are some CLI args you can use with this script:
--version or -v
Displays the version of the tool installed on the system.
--zip
Zips the project, respecting gitignores. For example, --zip a should create a.zip in the same directory having the directory contents. If zip name is not given, it defaults to a random ID.
--max-depth
Limits how deep the directory recursion gets. For example, --max-depth 1 should print the files and folders directly visible from the project root.
--all or -a
Includes hidden files and folders in the results. This does not override gitignore directives.
--ignore
Adds further files or folders to ignore.
--gitignore-depth
Controls how deep the script looks for gitignore files. For example, --gitignore-depth 0 should include only the gitignore present at the project root.
--no-gitignore
Does not respect gitignore files if this flag is given.
--max-items
Max number of files/folders to display in each folder, the rest is shown as ... and x more items. For example --max-items 5 should display only 5 items per directory.
Default for max items is 20.
--no-limit
Remove the --max-items limiter on printing files.
Contributions
Please feel free to open issues or submit pull requests to improve formatting, add features (e.g. colorized output), or add tests.
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.2.3.tar.gz.
File metadata
- Download URL: printstruct-1.2.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a24f3aee27cba48d620d66c25ddaed717dc6016f901e38acbbf0fbb9ffb8fda2
|
|
| MD5 |
55275c085bfbb2227aff597ae0d41d27
|
|
| BLAKE2b-256 |
9e26ef56affb903f92b9d62fb421182b70c87dc70e3039a87c30c7af351e0ab1
|
Provenance
The following attestation bundles were made for printstruct-1.2.3.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.2.3.tar.gz -
Subject digest:
a24f3aee27cba48d620d66c25ddaed717dc6016f901e38acbbf0fbb9ffb8fda2 - Sigstore transparency entry: 774511292
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/PrintStruct@96d7ae96a9d72e178b908b9252cb291421a8c0db -
Branch / Tag:
refs/tags/v1.2.3 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@96d7ae96a9d72e178b908b9252cb291421a8c0db -
Trigger Event:
release
-
Statement type:
File details
Details for the file printstruct-1.2.3-py3-none-any.whl.
File metadata
- Download URL: printstruct-1.2.3-py3-none-any.whl
- Upload date:
- Size: 6.8 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 |
aacd25c8d49197ab3443eaf14d128a9be21cc7a4ed36a75ce43150d1262af324
|
|
| MD5 |
b4bf381037082433b451b69590c0da79
|
|
| BLAKE2b-256 |
3b763bb297d613c54f3326ddb1452d39eabbf22c2862bfe59b7d07d7f364785e
|
Provenance
The following attestation bundles were made for printstruct-1.2.3-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.2.3-py3-none-any.whl -
Subject digest:
aacd25c8d49197ab3443eaf14d128a9be21cc7a4ed36a75ce43150d1262af324 - Sigstore transparency entry: 774511296
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/PrintStruct@96d7ae96a9d72e178b908b9252cb291421a8c0db -
Branch / Tag:
refs/tags/v1.2.3 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@96d7ae96a9d72e178b908b9252cb291421a8c0db -
Trigger Event:
release
-
Statement type: