A fruit salad project
Project description
FruitSalad
A Python toolkit for working with structured config file formats — .cucumber/.ccb for human-readable configs with BLAKE3 integrity, and .melon/.mel for compact binary serialization. Includes a VS Code extension with syntax highlighting, snippets, and file icons.
Installation
pip install fruitsalad
Requires Python 3.10+.
File Formats
Cucumber (.cucumber / .ccb)
Human-readable config format with key-value pairs organized in sections:
--h-- Auto-Generated by FruitSalad --h--
--h-- BLAKE3: <hash> --h--
server
host | localhost
port | 8080
database
driver | sqlite
file | data.db
Line format: key | value with optional type annotations (:int, :bool, :str).
Melon (.melon / .mel)
Binary serialization format using TLV (Type-Length-Value) encoding with BLAKE3 checksums. Compact and fast — ideal for size-sensitive storage.
CLI Usage
Generate files
# Generate an empty file
fruitsalad gef example.cucumber
# Protected (enforce integrity on load)
fruitsalad gef -P secret.cucumber
# Generate in .ccb / .melon / .mel
fruitsalad gef config.ccb
Prepare for production
# Normalize extensions and reseal
fruitsalad to-production .
# Reseal only (skip .ccb -> .cucumber rename)
fruitsalad to-production . -N
# Mark as protected
fruitsalad to-production . -P
# Recursive
fruitsalad to-production ./cfg -R
Convert between formats
fruitsalad convert input.cucumber output.json
fruitsalad to-json input.cucumber
fruitsalad to-yaml input.cucumber > output.yaml
fruitsalad to-cucumber input.json
fruitsalad to-melon input.cucumber
VS Code integration
# Install extension (uses bundled VSIX — no npm required)
fruitsalad vscode
# Rebuild from source before installing (requires npm)
fruitsalad vscode --build
Python API
from fruitsalad import load, save, reseal, test_file, gef
# Load a .cucumber file
data = load("config.cucumber")
print(data)
# {'server': {'host': 'localhost', 'port': 8080}}
# Save data
save("output.cucumber", data)
save("output.cucumber", data, protected=True)
# Re-seal after manual edits
reseal("config.cucumber")
# Generate files
gef("empty.cucumber")
gef("empty.cucumber", protected=True)
# Test file generation
test_file("test.cucumber")
Working with Melon
from fruitsalad import MelonSerializer
m = MelonSerializer()
data = m.load("data.melon")
m.save("data.melon", data)
Protected Mode
Files created with -P / protected=True include a PROTECTED header in cucumber files or a protection flag in melon files. When loading a protected file:
- Hash matches → loads normally
- Hash mismatches → raises
ValueError(tampering detected)
Unprotected files load normally regardless of hash — the hash is used for caching only, and resealing always updates it.
VS Code Extension
The VS Code extension provides:
- Syntax highlighting for
.cucumber/.ccband.melon/.melfiles - Snippets —
header,section,kvfor quick editing - Hover info — shows key/value pairs and BLAKE3 hashes on hover
- Commands — Verify hash, Reseal, Generate empty file, Convert to JSON/YAML
- File icons — Material Icon Theme integration included
Install with:
fruitsalad vscode --build
Then run Developer: Reload Window in VS Code.
Development
git clone <repo>
cd FruitSalad
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linux
pip install -e .
License
MIT
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 fruitsalad-0.2.1.tar.gz.
File metadata
- Download URL: fruitsalad-0.2.1.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
262c9bc6e256535e048c4d049f40bbff8129999c81368dd9be9096c03bed95bb
|
|
| MD5 |
7de8fc2688c11595d2c435734ec0314b
|
|
| BLAKE2b-256 |
1252b630be40323ac761168155a52ed3818b568d8ab0b248ee3d19218fcd1122
|
File details
Details for the file fruitsalad-0.2.1-py3-none-any.whl.
File metadata
- Download URL: fruitsalad-0.2.1-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
483e584d12508615d358d2c49799821e1ab978eea2286675c0e80fb40a8321ea
|
|
| MD5 |
9fc30f570ed8c60cd989fd4d8754b355
|
|
| BLAKE2b-256 |
9c676308c3af669d61bbef428ed0a80c6b347008dc8634ca1e5c65a2916d37d1
|