Skip to main content

Chethana's Human-readable Simple Language parser and serializer.

Project description

CHSL (Chethana's Human-readable Simple Language)

npm npm downloads PyPI PyPI downloads License: MIT

The configuration language designed for humans, not parsers.

CHSL is a lightweight, strictly-typed, and highly readable configuration language. It was built from the ground up to be as simple and predictable as possible for humans to read and write.

Why use CHSL?

  1. No quotes, no syntax headaches — just write your values naturally and CHSL figures out the type automatically.
  2. Comments that actually work — document your config files properly with NOTE: so future you knows why something is set.
  3. Secrets done right — pull API keys and passwords directly from the operating system with COPY_ENV. If the secret is missing, it crashes immediately before anything goes wrong.
  4. Write once, reuse anywhere — the COPY system lets you define a value once and reference it everywhere. Change it in one place, it updates everywhere.
  5. Readable multi-line text — write long text blocks with numbered lines instead of cramming everything into one unreadable line.
  6. Protect special strings with PIN — passwords, zip codes, and ID numbers that look like numbers stay exactly as you wrote them.
  7. Split big configs into smaller files — use LOAD to break massive configuration files into clean, logical chunks.
  8. Never lose track of nesting — the 0Group0 bracket system makes it visually impossible to lose track of which scope you're in, no matter how deep.
  9. Short or long arrays, your choice — write quick inline arrays with ARE or detailed bullet lists with # depending on what's more readable.
  10. Built-in safety — circular file dependencies and directory traversal attacks are blocked at the language level, not the application level.

Features & Syntax

1. Variables and Data Types

No quotes are required. CHSL automatically understands text, numbers, booleans (YES/NO), and empty values.

NOTE: This is a comment.
server_name = Oxide Main Server
is_active = YES
api_token = EMPTY

2. The PIN System (Strict Text)

Keep leading zeros on passwords, phone numbers, or ZIP codes by using PIN.

admin_password = PIN 0042

(Parsed as the exact string "0042", not the number 42)

3. Arrays in CHSL (Two Ways)

CHSL provides two ways to write lists, designed for different situations.

Method A: Smart Lists (The # bullet points)

  • Best for: Long lists, or strings that naturally contain spaces and commas.
allowed_ports =
#8080
#8081
#PIN 0021

Method B: Inline Arrays (The ARE keyword)

  • Best for: Short, simple data on a single line.
  • Note: Commas strictly separate items. If your text naturally contains spaces or commas, use Method A (# bullet lists) instead. If you use Smith_John to avoid spaces, it will be parsed literally as "Smith_John".
0Users0
name ARE Alice, Bob, Charlie
age ARE 30, EMPTY, 25

4. Explicit Multi-line Text (Paragraphs)

Write multi-line text naturally using explicit, numbered lines.

welcome_message = LINE
1 = Hello there!
2 = Welcome to the server.

5. Infinite, Explicit Nesting

CHSL uses numbered headers to change the current group scope. You don't need closing tags; declaring a new group automatically shifts the level.

0Network0
bind_ip = 192.168.1.1

  1Access1
  block_guest = YES

0Database0
port = 5432

6. DRY Configs (The COPY System)

Don't repeat yourself. CHSL allows you to copy values from other keys in the file.

active_port = 8080
backup_port = COPY active_port

7. Native OS Secrets

Never hardcode API keys in your config files again. CHSL securely pulls secrets directly from the operating system environment.

stripe_api_key = COPY_ENV STRIPE_SECRET_KEY

8. Modularity (File Loading)

Split massive configuration files into smaller chunks. Circular dependency detection and directory traversal protection are built-in automatically.

LOAD weapons.chsl

Usage

CHSL provides perfect compatibility across Python and JavaScript (Node.js).

Python (Install via PyPI)

pip install chsl
from chsl import parse_chsl_file, write_chsl_file

config = parse_chsl_file("settings.chsl")
write_chsl_file(config, "new_settings.chsl")

JavaScript / Node.js (Install via npm)

npm install chsl
const CHSL = require('chsl');

const config = CHSL.parseCHSLFile('settings.chsl');
CHSL.writeCHSLFile(config, 'new_settings.chsl');

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

chsl_lang-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

chsl_lang-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file chsl_lang-1.0.0.tar.gz.

File metadata

  • Download URL: chsl_lang-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for chsl_lang-1.0.0.tar.gz
Algorithm Hash digest
SHA256 06868f49d94654e29fc9a22c59ea22823f0205a2b6127f88a3abd405b1a35902
MD5 243d4c50062091c12f96d68f33a9c57d
BLAKE2b-256 ddc064c3b9b70d3a50a0b46fb728473d9f5508b01d374c9ab7d624a8fad993ee

See more details on using hashes here.

File details

Details for the file chsl_lang-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: chsl_lang-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for chsl_lang-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47066250d2ad6d3a85b198079fcce8add34aba983ce881be5683d932852fb3f5
MD5 5d4519bcc6dbc46ef494b76eb8dd28ff
BLAKE2b-256 1554db7f33ed46a3f348dc9d7b85301802a93133cfc0a6517a85fd0890d08f95

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