Skip to main content

A python program to pretty print directory structures

Project description

pp_paths: A python script to pretty print directory structures

pass the paths of files to be printed through stdin. They will be printed as a tree using ascii art.

Installation

pip install pp_paths --user

pp_paths [-c] [-b]

-c collapse directory sequences

-b print trees with a common base named '////'. The default is to print all the trees formed separated with a '////'

Examples

> find b -type f|pp_paths
b/
├─a/
│ └─b/
│   └─c/
│     └─d/
│       ├─1
│       ├─2
│       └─3
├─s
├─b/
│ ├─w/
│ │ └─a
│ ├─q
│ └─x
├─r
└─q/
  ├─e
  └─y


> find b -type f|pp_paths -c
b/
├─a/b/c/d/
│ ├─1
│ ├─2
│ └─3
├─s
├─b/
│ ├─w/a
│ ├─q
│ └─x
├─r
└─q/
  ├─e
  └─y

> {find b -type d; find a}|pp_paths
b/
├─a/
│ └─b/
│   └─c/
│     └─d
├─b/
│ └─w
├─z
└─q

-*-*-
a/
└─b

user@machine /dev/pts/4 /home/user/src/pp_paths
> {find b -type d; find a}|pp_paths -b
////
├─b/
│ ├─a/
│ │ └─b/
│ │   └─c/
│ │     └─d
│ ├─b/
│ │ └─w
│ │
│ ├─z
│ └─q
└─a/
  └─b

You can easily integrate it with other tools which output list of files:

> pacman -Ql tmux |awk '{print $2}'|pp_paths -c -b
/usr/
├─bin/tmux
└─share/
  ├─licenses/tmux/LICENSE
  └─man/man1/tmux.1.gz


> bsdtar tf ~/Downloads/emacs-for-clojure-book1.zip |pp_paths -c
emacs-for-clojure-book1/
├─.gitignore
├─README.md
├─customizations/
│ ├─editing.el
│ ├─elisp-editing.el
│ ├─misc.el
│ ├─navigation.el
│ ├─setup-clojure.el
│ ├─setup-js.el
│ ├─shell-integration.el
│ └─ui.el
│
...

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

pp_paths-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

pp_paths-1.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pp_paths-1.0.1.tar.gz.

File metadata

  • Download URL: pp_paths-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pp_paths-1.0.1.tar.gz
Algorithm Hash digest
SHA256 011cb4c3de237bb3f70a3164a10264128165350625eb29082f0a6042fd190be5
MD5 5fb816242acb321a2064919c3ee961e3
BLAKE2b-256 6ce364d0337accdc5f70ad55f3242d1d3c2156d9159abf1c59cd3ebcd38a21f6

See more details on using hashes here.

File details

Details for the file pp_paths-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pp_paths-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pp_paths-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 823a681fcf2947eb683b3797273e60c996b1cae7a59cb7781115ee6ee8560556
MD5 0a41ef81ea76f8d56fb311bf24f3ec0d
BLAKE2b-256 3ed5dbea238355bbd17ad0e440e980c6f49f60e9192e2a293767c85f1d50cca6

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