Skip to main content

FMLPack

codecov

fmlpack is a tool to convert a file tree to/from a Filesystem Markup Language (FML) document. It creates a single text-based archive of a directory structure, suitable for passing file contexts to LLMs (Large Language Models).

Features

  • Pack: Archives files and directories into a single FML file.
  • Unpack: Extracts files from an FML archive to the filesystem.
  • Filtering: Supports .gitignore rules via --gitignore, plus specific exclusions via .fmlpackignore and --exclude.
  • Safety: Prevents path traversal attacks during extraction.

Installation

Using Pip (Recommended)

Install directly with pip to automatically handle dependencies:

pip install fmlpack

Manual Installation

fmlpack is a single-file Python script, but it requires the pathspec library.

  1. Install the dependency: pip install pathspec.
  2. Copy src/fmlpack.py to a location in your PATH.
  3. Make it executable: chmod +x fmlpack.py.

Usage

Creating an archive

# Archive current directory to archive.fml
fmlpack -c . -f archive.fml

# Archive using .gitignore rules (excludes .git/ automatically)
fmlpack -c . --gitignore -f archive.fml

# Archive specific files and folders
fmlpack -c src/ tests/ -f source_code.fml

# Exclude specific patterns
fmlpack -c . --exclude "*.pyc" --exclude "__pycache__"

Extracting an archive

# Extract to current directory
fmlpack -x -f archive.fml

# Extract to specific directory
fmlpack -x -f archive.fml -C /tmp/output

Listing contents

fmlpack -t -f archive.fml

Testing

This project uses pytest for testing.

  1. Install test dependencies:

    pip install pytest pytest-cov pathspec
    
  2. Run tests:

    pytest
    
  3. Run tests with coverage report:

    pytest --cov=./src/ tests/test_fmlpack.py
    

Metadata

Release files for fmlpack 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fmlpack 0.5.0
File Size Uploaded
fmlpack-0.5.0.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fmlpack 0.5.0
File Interpreter ABI Platform
fmlpack-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / fmlpack-0.5.0.tar.gz

Download URL fmlpack-0.5.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e36f9d37903ed4041e1248fa5a11d9ec0f391a3ea14a921dfb27473f1adb74cf
BLAKE2b-256 checksum
How to use checksums
85ea8603bb2bb9e7f24f18f4a5a339579ba157221d9231baa821eed186943354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / fmlpack-0.5.0-py3-none-any.whl

Download URL fmlpack-0.5.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4459b2b64f2fbf5b48a1c60f10a1c7547b8705d3b7465a852ddba629474306fe
BLAKE2b-256 checksum
How to use checksums
b1a89e8dc81a7be1af8b222d82cdf801275751c304ca5ca95846b74fea6ebf9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page