Skip to main content

It shows the nested directory structure in JSON or YAML.

Project description

Abstract

It shows the nested directory structure in JSON or YAML.

Japanse document is here.

How to install

pip install treejson-cli

Package Dependencies

The following packages may not work properly if they are not installed:

  • PyYAML: Most popular YAML parser for Python.

How to run

treejson <directory>

The directory structure is compiled into JSON and output to standard output.

Options

Detail document is here.

[-h|--help]

Shows help message.

[-v|--version]

Shows version message.

[-y|--yaml]

Outputs as a YAML format.

[-a|-all]

Visits hidden file.

[-d|--depth] <depth>

Specifies the depth of tree oftraversal.

If depth=0, it shows current directory.

[-f|--file] <output_file>

Outputs as a JSON or YAML file.

Examples

  • treejson tests/sample

    {'sample': [{'parent01': [{'child01_01': ['grandchild01.txt']}, {'child01_02': ['grandchild02.txt']}, 'child01_03.txt']}, {'parent02': [{'child02_01': ['grandchild02_01.txt']}]}]}
    
  • treejson tests/sample -f tests/output.json

    tests/output.json

  • treejson tests/sample -yf tests/output.yaml

    tests/output.yaml

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

treejson_cli-1.0.0.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.

treejson_cli-1.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file treejson_cli-1.0.0.tar.gz.

File metadata

  • Download URL: treejson_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for treejson_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6d96b8cd6e9ef0cf605acfef5b6d1dc2e2189c86c1374ed64c73f854198a3ef
MD5 6e11f36860b3f4f1d0122d5cb4cb8c84
BLAKE2b-256 4e3825914f888f7391db6e155cc92dc7b5d2df8e14d45cbaaffac5e46fc9ae33

See more details on using hashes here.

File details

Details for the file treejson_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: treejson_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for treejson_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 034df42e2b6046631ae58f69960a8645aace5fb8889158b4b071476683b837fb
MD5 269e05d8e2de935de552a848271f26c4
BLAKE2b-256 c201370146a87b2f9a9e37d9b9f2509a746327e33570cc46e256abca6ffefe6f

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