Skip to main content

Treecount Package

Setup Automated Test passing Python Version PyPI version Last Commit Open Source Love png2

About

Ever get confused in counting the number of files in a set of directories? No Worries!

treecount is a simple fork of Directory-tree python utility package that displays out the Tree Structure of a user-defined directory with their respective file count.

Currently Available for All Platforms.

Installation

Run the following command on your terminal to install treecount:

1 . Installing the package using pip:

pip install treecount

OR

pip3 install treecount

2 . Cloning the repository:

git clone https://github.com/rushic24/treecount/
cd Directory-Tree
pip install -e .

Usage

Arguments

Parameters Description
dir_path Refers to the Directory Path of Operation. By default, refers to the Current Working Directory.
string_rep Refers to whether you just want the direct output or a string representation of the same.

Run this script in order to print out the tree structure of a user-defined directory!

# Importing Libraries
from treecount import display_tree

# Main Method
if __name__ == '__main__':
    display_tree(directory_path)
  • Here by default, the directory_path is the current working directory (CWD) unless specified by the user.

Output

  1. For Current Working Directory [DEFAULT] [String Representation = False]
>>> from treecount import display_tree
>>> display_tree()

$ Operating System : Windows
$ Path : C:\Personal\Work\Directory-Tree\Test\Main Directory

*************** Directory Tree ***************

Main Directory/
├── Directory 1/
│   └── Directory 2/
│       ├── Directory 3/
│       │   └── Directory 4/
│       │       └── Hello World.txt
│       └── Say World.txt
├── Directory A/
│   └── Hmm.txt
├── directory-tree-print.cpp
├── letseee.txt
└── printTree.exe
  1. For User Specified Directory [Argument] [String Representation = True]
>>> from treecount import display_tree
>>> stringRepresentation = display_tree('C:\Personal\Work\Directory-Tree\Test\Main Directory', string_rep = True)
>>> print(stringRepresentation)

$ Operating System : Windows
$ Path : C:\Personal\Work\Directory-Tree\Test\Main Directory

*************** Directory Tree ***************

Main Directory/
├── Directory 1/
│   └── Directory 2/
│       ├── Directory 3/
│       │   └── Directory 4/
│       │       └── Hello World.txt
│       └── Say World.txt
├── Directory A/
│   └── Hmm.txt
├── directory-tree-print.cpp
├── letseee.txt
└── printTree.exe

Developing treecount

To install treecount, along with the tools you need to develop and run tests, and execute the following in your virtualenv:

$ pip install -e .[dev]

forthebadge made-with-python ForTheBadge built-with-love

Release files for treecount 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treecount 0.0.2
File Size Uploaded
treecount-0.0.2.tar.gz 20.0 kB Details

Release files / treecount-0.0.2.tar.gz

Download URL treecount-0.0.2.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f78e6e89fac47ee60e6bcc1831e188b69bc610fe2f319c98bfbedf8bb901172f
BLAKE2b-256 checksum
How to use checksums
5aefcbcc3590ed31747aded573b8026b0b413c2ff3ad723d5f03ee58be67fe7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page