Skip to main content

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

# Build, install extension, configure icons, reload VS Code
fruitsalad vscode --build

# Install only (requires pre-built .vsix)
fruitsalad vscode

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 / .ccb and .melon / .mel files
  • Snippetsheader, section, kv for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fruitsalad-0.2.0.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

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

fruitsalad-0.2.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file fruitsalad-0.2.0.tar.gz.

File metadata

  • Download URL: fruitsalad-0.2.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for fruitsalad-0.2.0.tar.gz
Algorithm Hash digest
SHA256 109e741ddc11cd5bc18b1e518917505f3c6db97290acce040b1216172ce43e93
MD5 a299348298d53ead7a08013f96544533
BLAKE2b-256 d24b806eeffa14db2c13095520dfa92c01e2b8733f0929f07595e92e370a492d

See more details on using hashes here.

File details

Details for the file fruitsalad-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fruitsalad-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for fruitsalad-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36f7eae7397d8dac962a6ee713b1de6ff372b0be42fd6165fb64b743abf2c1e4
MD5 242e9e634e8fa314479806bbaa8171a8
BLAKE2b-256 9a601d27f9522b8e234144c0f28fb1a759956cabe0ef1f26246c6d0075c4d70c

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