An open API service indexing awesome lists of open source software.

https://github.com/arescentral/procyon

A simple, indented object notation
https://github.com/arescentral/procyon

c c-plus-plus markup python

Last synced: 10 months ago
JSON representation

A simple, indented object notation

Awesome Lists containing this project

README

          

# Procyon

Procyon is a simple object notation. It's a little more than
[JSON][json] and a lot less than [YAML][yaml]. For a quick introduction,
see [lang.pn][lang].

[json]: http://json.org
[yaml]: http://yaml.org
[lang]: doc/lang.pn

* [Types](#types)
* [Tools](#types)
* [pnfmt](#pnfmt)
* [pn2json](#pn2json)
* [Extras](#extras)

### Repository Structure

| Language | Source |
|-----------|---------------------------|
| C | [src/c](src/c) |
| C++ | [src/cpp](src/cpp) |
| Python | [src/python](src/python) |

## Types

There are eight Procyon types:


Group
Subgroup
Type
Description
Short form


Scalar
Const
Null
Nothing
null


Boolean
True/False
true, false


Numeric
Integer
Signed, 64-bit
0, 1, -99


Float
IEEE 754 double
0.0, 1e100, -inf, nan


Vector
Raw
Data
Binary data
$, $ff0000


String
Unicode
"", "\u270c!", "🍱"


Sequence
Array
Ordered list
[1, true, 3.0]


Map
Key-value pairs
{b: false, i: 0}

In addition to short form, the four vector types have a long form:


Data
String
Array
Map



$ 01234657

$ 89abcdef
$ 01234567
$ 89abcdef



> Soft-wrap with “>”

| Hard-wrap with “|”
> Final \n unless “!”
!



* "Bullets"

* "Use “*”"



key: "unqoted"

"\"": "quoted"


## Tools

### pnfmt

Procyon notation has a standard style and format. The `pnfmt` tool will
automatically convert files to the standard style and rewrap strings for
readability.

usage: pnfmt [-i | -o OUT] [IN]

options:
-i, --in-place format file in-place
-o, --output=FILE write output to path
-h, --help show this help screen

### pn2json

pn2json converts Procyon to JSON, with a few conversions for unsupported
types and values:

|Procyon |JSON |
|---------|--------|
|`inf` |`1e999` |
|`nan` |`null` |
|`$0123` |`"0123"`|

usage: pn2json [options] [FILE.pn]

options:
--traditional format JSON traditionally (default)
--comma-first format JSON with comma first
-m, --minify minify JSON
-r, --root print root string or data instead of JSON
-h, --help show this help screen

## Extras

| For | Source |
|-----------|---------------------------------|
| lldb | [misc/lldb](misc/lldb) |
| pygments | [misc/pygments](misc/pygments) |
| vim | [misc/vim](misc/vim) |