Skip to main content

PrintStruct: print project structure and optionally zip it

Reason this release was yanked:

This version is not stable, it was an accidental release.

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


Download files

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

Source Distribution

printstruct-1.2.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

printstruct-1.2.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file printstruct-1.2.2.tar.gz.

File metadata

  • Download URL: printstruct-1.2.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for printstruct-1.2.2.tar.gz
Algorithm Hash digest
SHA256 c32c448241de59f6fba64e61d51a9e9f2bfae7a5de1ad3f8ae7deb862d37bd9a
MD5 ce731ac0bc7d715c9f169d88877840eb
BLAKE2b-256 ec7900852468a24c7d66ccc4c35650a49789e0d41284701e65b5b0a7bf49fbdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for printstruct-1.2.2.tar.gz:

Publisher: workflow.yml on ShahzaibAhmad05/PrintStruct

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file printstruct-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: printstruct-1.2.2-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

Hashes for printstruct-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46046667edccded22e85e8f1bd5a8c8cc4c39c604365edb3df94afd54de7c74b
MD5 aa4d73e58c30154174f03c83c1a71ec9
BLAKE2b-256 6f216b496ea4a857bf1555ae95bc2498d81fedaef27bb3bcbba355d194372107

See more details on using hashes here.

Provenance

The following attestation bundles were made for printstruct-1.2.2-py3-none-any.whl:

Publisher: workflow.yml on ShahzaibAhmad05/PrintStruct

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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