- Clone this project
git clone https://github.com/bchiavarini/pyls_program.git
- 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"
}
]
}
- 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.
- If you want to use a custom filename or filepath for your JSON file, update the
CONFIG_FILEPATH
variable inpyls.py
accordingly. - Create a virtual environment (if you use a virtual environment)
python3 -mvenv .venv
source .venv/bin/activate
- Install the project and its dependencies
pip install .
- 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
- To change the directory structure to be parsed, update your structure.json (or the file specified in your custom
CONFIG_FILEPATH
variable) accordingly