Skip to main content

A CLI tool to capture entire folders, including file content, as structured JSON.

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.3.tar.gz (6.0 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.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file f2t2f-0.1.3.tar.gz.

File metadata

  • Download URL: f2t2f-0.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for f2t2f-0.1.3.tar.gz
Algorithm Hash digest
SHA256 229565fa6a4ce4e5d9178ccb16d64c0ceb52b6a015e11192ff953ddfe0b44f5b
MD5 6cdaa9da7e87e8daffb3b6b26aa193da
BLAKE2b-256 829040ad57f67f6a5a0e0be52b37df6ba95caa45a0134aab30718973d4cd4678

See more details on using hashes here.

Provenance

The following attestation bundles were made for f2t2f-0.1.3.tar.gz:

Publisher: pypi-publish.yml on vovaauer/f2t2f

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file f2t2f-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: f2t2f-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for f2t2f-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f0942551477398136c7e2cff621786159a0da5b78acd9ed60bd702a32b6fc87
MD5 47fffc85e24f30fd20bfabc50bca384a
BLAKE2b-256 3aa86fc1be3e554f0a159a993c8dd4e828d84d7134e9b79e40565800704bf79b

See more details on using hashes here.

Provenance

The following attestation bundles were made for f2t2f-0.1.3-py3-none-any.whl:

Publisher: pypi-publish.yml on vovaauer/f2t2f

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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