https://github.com/koraa/simplekv
Simplekv is a humen-readable text-based file format for exchageing simple Key/Value pairs
https://github.com/koraa/simplekv
Last synced: over 1 year ago
JSON representation
Simplekv is a humen-readable text-based file format for exchageing simple Key/Value pairs
- Host: GitHub
- URL: https://github.com/koraa/simplekv
- Owner: koraa
- License: cc0-1.0
- Created: 2012-06-21T17:47:06.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2018-11-27T12:17:33.000Z (over 7 years ago)
- Last Synced: 2025-01-30T18:22:31.422Z (over 1 year ago)
- Language: CoffeeScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
SimpleKV
========
Preamble
--------
This File contains the specification of the simplekv format.
The Purpose of the simplekv format is to save a number of key-value pairs.
The simplekv does not provide support for structs, dicts or arrays,
it does however provide the support for multiassignments.
Definition
----------
### Organization:
- Each line contains one Key/value pair
- Long lines cannot be escaped
### The K/V Pairs:
- The structure of each key value pair is as follows:
KEY SEPERATOR VALUE
- The key must be the first entity in the line (besides whitespaces)
- The key must match those expressions:
(This means it can contain any characters
besides any whitespace characters and a clolon)
/^\S*$/ AND /^[^:]*$/
- The Value can contain any characters besides a linebreak (anything that starts a new line)
- The divider is defined as follows:
- It may contain any number of whitespace (\s) characters (besides a newline)
- It may contain up to two colons
- The first character of the seperator is the first character that
can not be part of the key (any whitespace or a colon)
- The colon is used to end-mark the seperator, if it is not the first character used
- If no colon is used to determine the end, the first character of the value
is the first character that can not be part of the seperator (anything but a colon and a whitespace)
### Arrays/Multiassignments:
- Simplekv provides support for multiassignments. This is simply reuse of a key.
In libraries this feature should be implemented as a conversion to an array.
### Comments:
- A comment is indicated by a '#' character as the first character (besides whitespace characters) in a line
- In case of a comment the entire line is skipped
### As Header:
Simplekv can also be used as a header language, in which case a sequence of 4 empty lines will be used as a seperator.
Examples
--------
These all express the same:
foo 42
foo:42
foo::42
foo 42
foo 42
foo: 42
foo :42
foo: :42
foo 42
Special cases:
'fuu' ' bar' => fuu : bar
'fuu' ':bar' => fuu ::bar
'fuu' ': bar' => fuu :: bar
Bad things to do (this is basicly not using the colons as start or endmarkers)
fuu :: bar => 'fuu' ': bar'
fuu:: bar => 'fuu' ': bar'
License/Copying
---------------
SimpleKV - The Simple Key-Value format
Written in 2012 by Karolin Varner karo@cupdev.net
The Project SimpleKV includes this file and any related content and in particular the software libraries and the SimpleKV specification bundled with this project.
This file is part of SimpleKV.
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to SimpleKV to the public domain worldwide. is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see .
-----------------------------------------------------------
Javascript Lib
==============
The JS library requires Coffescript and Node.js to run.