Overview
simple_foundation_api is a unified facade that bundles essential foundation libraries for any Eiffel project. Instead of managing multiple library dependencies, use a single FOUNDATION class that provides access to:
- Base64 encoding/decoding
- Cryptographic hashing (SHA-256, SHA-1, MD5, HMAC)
- UUID generation and validation
- JSON parsing and building
- CSV parsing and generation
- Markdown to HTML conversion
- XML parsing and building
- Data validation with fluent API
- Regular expressions with fluent builder
- Date/time manipulation and formatting
- Structured logging with JSON output
- HTMX component generation
- Process execution
- Random data generation
Features
Base64
Standard and URL-safe Base64 encoding and decoding
Hashing
SHA-256, SHA-1, MD5, and HMAC-SHA256 algorithms
UUID
Generate v4 UUIDs in standard and compact formats
JSON
Parse, validate, and build JSON with JSONPath queries
CSV
Parse and generate CSV data with header support
Markdown
Convert Markdown to HTML with table of contents
Validation
Fluent data validation with chainable rules
Random
Generate random integers, strings, words, and UUIDs
XML
Parse, query, and build XML documents with XPath
Regex
Pattern matching, replacement, and fluent builder API
DateTime
Date/time manipulation, formatting, age and duration calculations
Logger
Structured logging with levels, fields, and JSON output
HTMX
Generate HTMX-enabled HTML components
Installation
Add simple_foundation_api to your ECF configuration file:
<library name="simple_foundation_api"
location="$SIMPLE_FOUNDATION_API\simple_foundation_api.ecf"/>
Environment Variables
Set the following environment variables:
SIMPLE_FOUNDATION_API=path/to/simple_foundation_api
SIMPLE_BASE64=path/to/simple_base64
SIMPLE_CSV=path/to/simple_csv
SIMPLE_DATETIME=path/to/simple_datetime
SIMPLE_HASH=path/to/simple_hash
SIMPLE_HTMX=path/to/simple_htmx
SIMPLE_JSON=path/to/simple_json
SIMPLE_LOGGER=path/to/simple_logger
SIMPLE_MARKDOWN=path/to/simple_markdown
SIMPLE_PROCESS=path/to/simple_process
SIMPLE_RANDOMIZER=path/to/simple_randomizer
SIMPLE_REGEX=path/to/simple_regex
SIMPLE_UUID=path/to/simple_uuid
SIMPLE_VALIDATION=path/to/simple_validation
SIMPLE_XML=path/to/simple_xml
Quick Start
local
foundation: FOUNDATION
do
create foundation.make
-- Base64 encoding
foundation.base64_encode ("Hello") -- "SGVsbG8="
-- SHA-256 hashing
foundation.sha256 ("data")
-- UUID generation
foundation.new_uuid -- "550e8400-e29b-41d4-a716-446655440000"
-- JSON parsing
if attached foundation.parse_json ("{%"name%": %"test%"}") as json then
...
end
-- Markdown conversion
foundation.markdown_to_html ("# Hello World")
-- Validation
if foundation.is_valid_email ("test@example.com") then
...
end
-- Random generation
foundation.random_integer_in_range (1, 100)
end
API Reference
Base64 Operations
Hashing Operations
UUID Operations
JSON Operations
CSV Operations
Markdown Operations
Validation Operations
Random Operations
XML Operations
Regex Operations
DateTime Operations
Logger Operations
HTMX Operations
Dependencies
simple_foundation_api bundles the following libraries:
| Library | Purpose |
|---|---|
simple_base64 |
Base64 encoding and decoding |
simple_csv |
CSV parsing and generation |
simple_datetime |
Date, time, duration, and age calculations |
simple_hash |
Cryptographic hash functions |
simple_htmx |
HTMX-enabled HTML component generation |
simple_json |
JSON parsing and building |
simple_logger |
Structured logging with JSON output |
simple_markdown |
Markdown to HTML conversion |
simple_process |
Shell command execution |
simple_randomizer |
Random data generation |
simple_regex |
Regular expressions with fluent builder |
simple_uuid |
UUID generation and validation |
simple_validation |
Data validation with fluent API |
simple_xml |
XML parsing, querying, and building |