A CLI tool to serialize folder structures to text and back.
Project description
f2t2f
A simple CLI tool to convert folder structures to and from a structured text format (JSON).
This is useful for sharing project structures, analyzing them with LLMs, or creating project templates.
Installation
pip install f2t2f
Usage
Folder to Text
To serialize the structure of ./my-project to the clipboard:
f2t2f copy ./my-project
To save it to a file instead:
f2t2f save ./my-project structure.json
Text to Folder
To create a folder structure from your clipboard into the current directory:
f2t2f paste
To create it from a file into a specific destination:
f2t2f load structure.json ./output-folder
Example Format
f2t2f uses a clear JSON format. For a folder structure like this:
my_app/
├── main.py
└── data/
└── config.txt
Running f2t2f copy ./my_app would produce the following JSON:
{
"type": "f2t2f_folder_structure_v1",
"data": {
"name": "my_app",
"type": "folder",
"children": [
{
"name": "data",
"type": "folder",
"children": [
{
"name": "config.txt",
"type": "file",
"content": "setting=True\n"
}
]
},
{
"name": "main.py",
"type": "file",
"content": "print(\"Hello, World!\")\n"
}
]
}
}
Configuration (Optional)
By default, f2t2f ignores common files like __pycache__ and .git. To customize this, you can create a configuration file.
-
Create the default config file:
f2t2f config init
-
Find its location and edit it:
f2t2f config path
You can then add or remove patterns from the
ignore_patternslist in that JSON file.
License
MIT License © Vova Auer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file f2t2f-0.1.1.tar.gz.
File metadata
- Download URL: f2t2f-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf50d922ed7b21d9f214ebf6089fd94e0cc72163de42920ed4651454c98f68c3
|
|
| MD5 |
eb03738057eb22345db24707ca04159a
|
|
| BLAKE2b-256 |
45b2f15057682c0ba895398cb96ac9f9e9fffda89d6275772ffe70803daf72a7
|
File details
Details for the file f2t2f-0.1.1-py3-none-any.whl.
File metadata
- Download URL: f2t2f-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f9e18a187c68d2ba101395298f9a1c97060db14c40314f8df17fafa3a40d4fd
|
|
| MD5 |
1e83966e67c0e5aa582908cfd9e0ff1a
|
|
| BLAKE2b-256 |
90db34e52a1e28bd150536c76ee356d2b131cbd98e500ca4fb3cb11c1729391d
|