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:

  • Clone the latest release version (stable):
git clone --branch v1.2.0 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.1.tar.gz (6.0 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.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: printstruct-1.2.1.tar.gz
  • Upload date:
  • Size: 6.0 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.1.tar.gz
Algorithm Hash digest
SHA256 35209b32ecd710b09e3ff548e452e23f527d2610bd8cd86b0f987be510eac3b6
MD5 38a109e9da20f3fcd17ac64db4f7807b
BLAKE2b-256 d3d483c23ba7a8d48b6a61258736bb79e932a99ec538ac049b802c6ee587512e

See more details on using hashes here.

Provenance

The following attestation bundles were made for printstruct-1.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: printstruct-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2a909cd570b4b11b22dfc253b13eebb3f0f4eaea9b9281688606c49d5095d1
MD5 ca45088a89c5bc47dbe99b4a3f62e3b1
BLAKE2b-256 fdb7c984afc9cbbcf905d246802878e56aec52994cda4ed7c5c26ca8476b0a36

See more details on using hashes here.

Provenance

The following attestation bundles were made for printstruct-1.2.1-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