Skip to main content

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.

  1. Create the default config file:

    f2t2f config init
    
  2. Find its location and edit it:

    f2t2f config path
    

    You can then add or remove patterns from the ignore_patterns list in that JSON file.

License

MIT License © Vova Auer

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

f2t2f-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

f2t2f-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for f2t2f-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf50d922ed7b21d9f214ebf6089fd94e0cc72163de42920ed4651454c98f68c3
MD5 eb03738057eb22345db24707ca04159a
BLAKE2b-256 45b2f15057682c0ba895398cb96ac9f9e9fffda89d6275772ffe70803daf72a7

See more details on using hashes here.

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

Hashes for f2t2f-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f9e18a187c68d2ba101395298f9a1c97060db14c40314f8df17fafa3a40d4fd
MD5 1e83966e67c0e5aa582908cfd9e0ff1a
BLAKE2b-256 90db34e52a1e28bd150536c76ee356d2b131cbd98e500ca4fb3cb11c1729391d

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