FMLPack
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
.gitignorerules via--gitignore, plus specific exclusions via.fmlpackignoreand--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.
- Install the dependency:
pip install pathspec. - Copy
src/fmlpack.pyto a location in your PATH. - 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.
-
Install test dependencies:
pip install pytest pytest-cov pathspec
-
Run tests:
pytest
-
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)
| File | Size | Uploaded | |
|---|---|---|---|
| fmlpack-0.5.0.tar.gz | 22.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|