Skip to content

bchiavarini/pyls_program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Command Line Tool for listing directory contents

Setup

  1. Clone this project
git clone https://github.com/bchiavarini/pyls_program.git
  1. Create a JSON file describing your directory structure with the following schema:
{
  "name": "string",
  "size": "integer",
  "time_modified": "epoch time",
  "permissions": "Unix-like permissions",
  "contents": [
    {
      "name": "string",
      "size": "integer",
      "time_modified": "epoch time",
      "permissions": "Unix-like permissions"
    },
    {
      "name": "string",
      "size": "integer",
      "time_modified": "epoch time",
      "permissions": "Unix-like permissions"
    }
  ]
}
  1. Save the file as structure.json and place it in the pyls folder. An example JSON file is already provided in the project to help you get started.
  2. If you want to use a custom filename or filepath for your JSON file, update the CONFIG_FILEPATH variable in pyls.py accordingly.
  3. Create a virtual environment (if you use a virtual environment)
python3 -mvenv .venv
source .venv/bin/activate
  1. Install the project and its dependencies
pip install .

Usage

  1. Run the following command
pyls

The program will list the contents of the directory described in the your structure.json (or the file specified in your custom CONFIG_FILEPATH variable).
Note that, if no additional parameters are specified, hidden directories will not be displayed. 2. To see a list of all available options and their descriptions, you can use the --help flag:

pyls --help
  1. To change the directory structure to be parsed, update your structure.json (or the file specified in your custom CONFIG_FILEPATH variable) accordingly

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages