{"id":25065675,"url":"https://github.com/programming-sai/filestructure-to-text","last_synced_at":"2026-02-17T15:02:37.745Z","repository":{"id":254564849,"uuid":"846915592","full_name":"Programming-Sai/FileStructure-To-Text","owner":"Programming-Sai","description":"This is a simple program that takes a folder and returns the structure of it as a text","archived":false,"fork":false,"pushed_at":"2025-03-14T21:56:41.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T19:50:11.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Programming-Sai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-24T10:09:48.000Z","updated_at":"2025-03-14T21:56:45.000Z","dependencies_parsed_at":"2025-05-07T19:47:47.272Z","dependency_job_id":"ac3906e9-00c1-4752-b09f-07f52d8def8f","html_url":"https://github.com/Programming-Sai/FileStructure-To-Text","commit_stats":null,"previous_names":["programming-sai/filestructure-to-text"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Programming-Sai/FileStructure-To-Text","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FFileStructure-To-Text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FFileStructure-To-Text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FFileStructure-To-Text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FFileStructure-To-Text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Programming-Sai","download_url":"https://codeload.github.com/Programming-Sai/FileStructure-To-Text/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FFileStructure-To-Text/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29548201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-06T19:44:43.983Z","updated_at":"2026-02-17T15:02:37.728Z","avatar_url":"https://github.com/Programming-Sai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileStructure-To-Text\n\n## Overview\n\n**FileStructure-To-Text (FTT)** is a simple Python tool that generates a text-based representation of a directory's structure or creates a folder structure based on a provided template. The tool supports customizable output options (e.g., excluding hidden files, limiting depth, or displaying only files or directories).\n\n\u003e **Warning:**\n\u003e\n\u003e - This is an MVP version. The tool is provided \"as-is\" and may have bugs.\n\u003e - **Important:** You must supply absolute paths when using FTT to visualize directories.\n\u003e - FTT no longer includes dedicated install or uninstall scripts. Instead, you run the tool directly via the command line.\n\u003e - After building a standalone executable (using PyInstaller), ensure that its containing folder is added to your system `PATH`. If it isn't, you may need to add it manually.\n\u003e - When generating a folder structure from a template, **do not include empty folders** in your template. If an empty folder is required, add a placeholder file (e.g., `.fttkeep`) inside it.\n\u003e - If the generated structure is missing some files, try running the generation process two more times. If files are still missing, then there may be an issue with the predefined template.\n\n## Features\n\n- **Directory Visualization:**  \n  Recursively traverse directories and display a clean, tree-like structure of files and subdirectories.\n- **Structure Generation:**  \n  Generate a folder (and file) structure from a user-defined template. The template can be provided as a direct string or as a path to a text file.\n\n- **Customizable Output:**\n  - **Exclusions:** Specify files or folders to exclude via wildcard patterns or by providing a file with exclusions (e.g., a `.fttignore` file).\n  - **Hidden Files:** Optionally include hidden files and directories.\n  - **Depth Limiting:** Limit the recursion depth for visualization.\n  - **Output Filters:** Choose to display only directories or only files.\n- **Command-Line Interface:**  \n  Uses `argparse` to support various optional arguments for flexible usage.\n\n## Example Output\n\nWhen you run FTT on a folder, the output might look like this:\n\n```graphql\n\n./SearchAndSort/*\n        ├─ bin/*\n        |       ├─ algorithms/*\n        |       |       └─ ... (files)\n        |       └─ ... (other files)\n        ├─ lib/*\n        ├─ .vscode/*\n        |       └─ settings.json\n        ├─ src/*\n        |       ├─ algorithms/*\n        |       |       ├─ SearchAlgorithms.java\n        |       |       └─ SortAlgorithms.java\n        |       └─ App.java\n        ├─ 204 GROUP WORK A3.pdf\n        └─ README.md\n\n```\n\nWhen generating a folder structure from a template, you might define a template like this:\n\n```graphql\n\nProject/*\n    ├─ src/*\n    │   ├─ main.py\n    │   └─ utils.py\n    ├─ docs/*\n    │   └─ README.md\n    ├─ config.json\n    └─ .gitignore\n\n```\n\nThe tool will then create the corresponding folders and files in the specified target directory.\n\n## How to Use\n\n### 1. Clone the Repository\n\nClone this repository to your local machine using:\n\n```bash\ngit clone https://github.com/Programming-Sai/FileStructure-To-Text.git\n```\n\n### 2. Navigate to the Project Directory\n\nChange into the directory where the script is located:\n\n```bash\ncd FileStructure-To-Text\n```\n\n### 3. Running FTT for Visualization\n\nTo visualize a folder's structure, run:\n\n```bash\npython main.py -f \"C:\\Absolute\\Path\\To\\Folder\"\n```\n\n_Note: The folder path must be absolute._\n\n### 4. Running FTT for Structure Generation\n\nTo generate a folder structure from a template, you can provide the template either as a direct string or as a file:\n\n```psh\npython main.py \"\n\u003e\u003e Project/*\n\u003e\u003e     ├─ src/*\n\u003e\u003e     │   ├─ main.py\n\u003e\u003e     │   └─ utils.py\n\u003e\u003e     ├─ docs/*\n\u003e\u003e     │   └─ README.md\n\u003e\u003e     ├─ config.json\n\u003e\u003e     └─ .gitignore\n\u003e\u003e \" -f \"C:\\Users\\pc\\Desktop\\j\"\n```\n\nOr if your template is saved in a file (e.g., `template.txt`):\n\n```bash\npython main.py template.txt -f \"C:\\Absolute\\Path\\To\\TargetFolder\"\n```\n\n### 5. Additional Options\n\n- **Exemptions:**  \n  To exclude specific files or folders, pass them using the `-e` or `--exemptions` flag:\n  ```bash\n  python main.py -f \"C:\\Folder\" -e \"*.log\" \"node_modules\" \".fttignore\"\n  ```\n- **Hidden Files:**  \n  Exclude hidden files (files starting with a dot) using the `-H` flag:\n  ```bash\n  python main.py -f \"C:\\Folder\" -H\n  ```\n- **Filter Output:**  \n  Show only directories with `-d` or only files with `-F`:\n  ```bash\n  python main.py -f \"C:\\Folder\" -d\n  python main.py -f \"C:\\Folder\" -F\n  ```\n- **Limit Traversal Depth:**  \n  Use the `-m` flag to limit directory traversal depth:\n\n  ```bash\n  python main.py -f \"C:\\Folder\" -m 3\n  ```\n\n- **Save Output to File:**  \n  Save the visualization output to a file using the `-s` flag:\n\n  ```bash\n  python main.py -f \"C:\\Folder\" -s output.txt\n  ```\n\n- **Version Information:**  \n  View version information with the `-v` flag:\n  ```bash\n  python main.py -v\n  ```\n\n## Installation\n\nTo install FTT as a standalone, globally available executable:\n\n1. **Build the Executable:**  \n   Run the build script:\n\n   ```bash\n   python build.py\n   ```\n\n   This script will:\n\n   - Build a standalone executable using PyInstaller.\n   - Copy the executable to the appropriate installation directory.\n   - Attempt to add that directory to your system `PATH`.\n\n2. **Post-Installation:**\n\n   - **Important:** If the executable is not recognized after installation, restart your terminal (or VS Code) and try again.\n   - If the executable is still not recognized, manually add the installation directory (e.g., `C:\\Users\\pc\\AppData\\Local\\Programs\\FTT`) to your system `PATH` OR use this to help you [troubleshoot](https://chatgpt.com/).\n\n3. **Usage of Installed Executable:**  \n   Once installed, you can run FTT globally by simply typing:\n\n   ```bash\n   ftt\n   ```\n\n   in your terminal.\n\n   **Example:**\n\n   ```bash\n   ftt -f \"C:\\Absolute\\Path\\To\\Folder\"\n   ```\n\n   **Additional Options**\n\n- **Exemptions:**  \n  To exclude specific files or folders, pass them using the `-e` or `--exemptions` flag:\n  ```bash\n  ftt -f \"C:\\Folder\" -e \"*.log\" \"node_modules\" \".fttignore\"\n  ```\n- **Hidden Files:**  \n  Exclude hidden files (files starting with a dot) using the `-H` flag:\n  ```bash\n  ftt -f \"C:\\Folder\" -H\n  ```\n- **Filter Output:**  \n  Show only directories with `-d` or only files with `-F`:\n  ```bash\n  ftt -f \"C:\\Folder\" -d\n  ftt -f \"C:\\Folder\" -F\n  ```\n- **Limit Traversal Depth:**  \n  Use the `-m` flag to limit directory traversal depth:\n\n  ```bash\n  ftt -f \"C:\\Folder\" -m 3\n  ```\n\n- **Save Output to File:**  \n  Save the visualization output to a file using the `-s` flag:\n\n  ```bash\n  ftt -f \"C:\\Folder\" -s output.txt\n  ```\n\n- **Version Information:**  \n  View version information with the `-v` flag:\n  ```bash\n  ftt -v\n  ```\n\n## Requirements\n\n- Python 3.x\n\n## Warnings \u0026 Important Notes\n\n- **Absolute Paths Required:**  \n  When visualizing, always provide an absolute path for the folder. Relative paths are not supported.\n- **No Install/Uninstall Scripts:**  \n  This version does not include dedicated install or uninstall scripts. You run the tool directly via the command line.\n- **PATH Configuration:**  \n  After building a standalone executable (using PyInstaller), ensure that its containing folder is added to your system `PATH` if you want to run it globally.\n- **Environment:**  \n  The tool is in MVP stage. Future releases may include additional features, improvements, and bug fixes. Always check for updates.\n- **Error Handling:**  \n  If you encounter any errors during use, please file an issue on GitHub with details and steps to reproduce the problem.\n- **Empty Folders:**  \n  No Empty folders must be included in your folder structure when trying to generate files. so something like this:\n\n  ```graphql\n\n    Project/*\n        ├─ empty/*\n        ├─ src/*\n        │   ├─ main.py\n        │   └─ utils.py\n        ├─ docs/*\n        │   └─ README.md\n        ├─ config.json\n        └─ .gitignore\n\n  ```\n\n  would not be a good idea to do. This would be better:\n\n  ```graphql\n\n  Project/*\n      ├─ empty/*\n      │   └─ .fttkeep\n      ├─ src/*\n      │   ├─ main.py\n      │   └─ utils.py\n      ├─ docs/*\n      │   └─ README.md\n      ├─ config.json\n      └─ .gitignore\n\n  ```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Ffilestructure-to-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogramming-sai%2Ffilestructure-to-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Ffilestructure-to-text/lists"}