Print a directory tree structure in your Python code.

Overview

directory-structure

PyPI PyPI - Downloads PyPI - License GitHub watchers GitHub Repo stars GitHub forks

Print a directory tree structure in your Python code.

Download

You can simply:

pip install directory-structure

Or you can also:

  1. Clone the repository to your local machine.
  2. Enter the directory.
  3. Download necessary modules/libraries.
git clone https://github.com/gabrielstork/directory-structure.git
cd directory-structure
pip install -r requirements.txt

Examples

from directory_structure import Tree

Using absolute path as an argument.

path = Tree('C:/Users/User/Desktop/directory-structure', absolute=True)
print(path)
πŸ“‚ C:
|_πŸ“‚ Users
  |_πŸ“‚ User
    |_πŸ“‚ Desktop
      |_πŸ“‚ directory-structure
        |_πŸ“ .git
        |_πŸ“ directory_structure
        |_πŸ“„ .gitignore
        |_πŸ“„ LICENSE
        |_πŸ“„ pyproject.toml
        |_πŸ“„ README.md
        |_πŸ“„ requirements.txt
        |_πŸ“„ setup.py
path = Tree('C:/Users/User/Desktop/directory-structure', absolute=False)
print(path)
πŸ“‚ directory-structure
|_πŸ“ .git
|_πŸ“ directory_structure
|_πŸ“„ .gitignore
|_πŸ“„ LICENSE
|_πŸ“„ pyproject.toml
|_πŸ“„ README.md
|_πŸ“„ requirements.txt
|_πŸ“„ setup.py

Accessing a folder in current working directory.

path = Tree('./directory_structure', absolute=True)
print(path)
πŸ“‚ C:
|_πŸ“‚ Users
  |_πŸ“‚ User
    |_πŸ“‚ Desktop
      |_πŸ“‚ directory-structure
        |_πŸ“‚ directory_structure
          |_πŸ“„ tree.py
          |_πŸ“„ __init__.py
path = Tree('./directory_structure', absolute=False)
print(path)
πŸ“‚ directory_structure
|_πŸ“„ tree.py
|_πŸ“„ __init__.py

Getting all from the directory where your current working directory is.

path = Tree('../', absolute=True)
print(path)
πŸ“‚ C:
|_πŸ“‚ Users
  |_πŸ“‚ User
    |_πŸ“‚ Desktop
      |_πŸ“ directory-structure
      |_πŸ“„ Discord.lnk
      |_πŸ“„ Spotify.lnk
      |_πŸ“„ Steam.lnk
      |_πŸ“„ Telegram.lnk
      |_πŸ“„ Visual Studio Code.lnk
      |_πŸ“„ WhatsApp.lnk
path = Tree('../', absolute=False)
print(path)
πŸ“‚ Desktop
|_πŸ“ directory-structure
|_πŸ“„ Discord.lnk
|_πŸ“„ Spotify.lnk
|_πŸ“„ Steam.lnk
|_πŸ“„ Telegram.lnk
|_πŸ“„ Visual Studio Code.lnk
|_πŸ“„ WhatsApp.lnk

forthebadge forthebadge

Owner
Gabriel Stork
Python
Gabriel Stork
Turn your Python and Javascript code into DOT flowcharts

Notes from 2017 This is an older project which I am no longer working on. It was built before ES6 existed and before Python 3 had much usage. While it

Scott Rogowski 3k Jan 09, 2023
Metrinome is an all-purpose tool for working with code complexity metrics.

Overview Metrinome is an all-purpose tool for working with code complexity metrics. It can be used as both a REPL and API, and includes: Converters to

26 Dec 26, 2022
Inspects Python source files and provides information about type and location of classes, methods etc

prospector About Prospector is a tool to analyse Python code and output information about errors, potential problems, convention violations and comple

Python Code Quality Authority 1.7k Dec 31, 2022
Python package to parse and generate C/C++ code as context aware preprocessor.

Devana Devana is a python tool that make it easy to parsing, format, transform and generate C++ (or C) code. This tool uses libclang to parse the code

5 Dec 28, 2022
Typical: Fast, simple, & correct data-validation using Python 3 typing.

typical: Python's Typing Toolkit Introduction Typical is a library devoted to runtime analysis, inference, validation, and enforcement of Python types

Sean 170 Dec 26, 2022
Optional static typing for Python 3 and 2 (PEP 484)

Mypy: Optional Static Typing for Python Got a question? Join us on Gitter! We don't have a mailing list; but we are always happy to answer questions o

Python 14.4k Jan 05, 2023
πŸ¦” PostHog is developer-friendly, open-source product analytics.

PostHog provides open-source product analytics, built for developers. Automate the collection of every event on your website or app, with no need to send data to 3rd parties. With just 1 click you ca

PostHog 10.3k Jan 01, 2023
Code audit tool for python.

Pylama Code audit tool for Python and JavaScript. Pylama wraps these tools: pycodestyle (formerly pep8) Β© 2012-2013, Florent Xicluna; pydocstyle (form

Kirill Klenov 966 Dec 29, 2022
Find usage statistics (imports, function calls, attribute access) for Python code-bases

Python Library stats This is a small library that allows you to query some useful statistics for Python code-bases. We currently report library import

Francisco Massa 13 May 02, 2022
fixup: Automatically add and remove python import statements

fixup: Automatically add and remove python import statements The goal is that running fixup my_file.py will automatically add or remove import stateme

2 May 08, 2022
Print a directory tree structure in your Python code.

directory-structure Print a directory tree structure in your Python code. Download You can simply: pip install directory-structure Or you can also: Cl

Gabriel Stork 45 Dec 19, 2022
An analysis tool for Python that blurs the line between testing and type systems.

CrossHair An analysis tool for Python that blurs the line between testing and type systems. THE LATEST NEWS: Check out the new crosshair cover command

Phillip Schanely 836 Jan 08, 2023
Performant type-checking for python.

Pyre is a performant type checker for Python compliant with PEP 484. Pyre can analyze codebases with millions of lines of code incrementally – providi

Facebook 6.2k Jan 07, 2023
Checkov is a static code analysis tool for infrastructure-as-code.

Checkov - Prevent cloud misconfigurations during build-time for Terraform, Cloudformation, Kubernetes, Serverless framework and other infrastructure-as-code-languages with Checkov by Bridgecrew.

Bridgecrew 5.1k Jan 03, 2023
Robocop is a tool that performs static code analysis of Robot Framework code.

Robocop Introduction Documentation Values Requirements Installation Usage Example Robotidy FAQ Watch our talk from RoboCon 2021 about Robocop and Robo

marketsquare 132 Dec 29, 2022
coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use.

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." ― John F. Woods coala provides a

coala development group 3.4k Jan 02, 2023
Calculator Python Package

Calculator Python Package This is a Calculator Package of Python. How To Install The Package? Install packagearinjoyn with pip (Package Installer Of P

Arinjoy_Programmer 1 Nov 21, 2021
Static type checker for Python

Static type checker for Python Speed Pyright is a fast type checker meant for large Python source bases. It can run in a β€œwatch” mode and performs fas

Microsoft 9.4k Jan 07, 2023
TidyPy is a tool that encapsulates a number of other static analysis tools and makes it easy to configure, execute, and review their results.

TidyPy Contents Overview Features Usage Docker Configuration Ignoring Issues Included Tools Included Reporters Included Integrations Extending TidyPy

Jason Simeone 33 Nov 27, 2022
Collects all accepted (partial and full scored) codes submitted within the given timeframe and saves them locally for plagiarism check.

Collects all accepted (partial and full scored) codes submitted within the given timeframe of any contest.

ARITRA BELEL 2 Dec 28, 2021