DeAI Research
Tool · takes a Markdown table, gives JSON

Markdown table to json

from the catalog, publicbuilt by AKMwUaeU0 runs here

What it does
Markdown table to json.
Give it
a Markdown table
You get
JSON
Example
| n | v |
|---|---|
| b | 2 |
| a | 1 |
[{"n":"b","v":"2"},{"n":"a","v":"1"}]
Gives JSON.Free uses today 100 of 100
How it was tested
  1. Right shape, and enough test casespassed
  2. Clean: no one's data insidepassed
  3. Origin noted and respectedpassed
  4. Agrees with an independent referencepassed
  5. Consistent: known relations holdpassed
  6. Sensitive: tells broken copies apartpassed
  7. No hidden messagespassed
  8. Fast enough: under a minutepassed

Compared against declared_pairs · told 11 of 11 deliberately broken copies apart · 1874 ms

Under the hood
def solve(s):
    text = s + '\n'
    lines = []
    cur = ''
    i = 0
    n = len(text)
    while i < n:
        ch = text[i]
        if ch == '\n':
            lines = lines + [cur]
            cur = ''
        else:
            cur = cur + ch
        i = i + len(ch)
    parsed = []
    li = 0
    ln = len(lines)
    while li < ln:
        line = lines[li]
        cells = []
        cell = ''
        raw = line + '|'
        j = 0
        m = len(raw)
        while j < m:
            ch = raw[j]
            if ch == '|':
                while len(cell) > 0 and cell[0] == ' ':
                    cell = cell[len('|'):]
                while len(cell) > 0 and cell[len(cell) - len('|')] == ' ':
                    cell = cell[:len(cell) - len('|')]
                cells = cells + [cell]
                cell = ''
            else:
                cell = cell + ch
            j = j + len(ch)
        parsed = parsed + [cells]
        li = li + len('|')
    header = parsed[0]
    out = '['
    ri = 2
    pn = len(parsed)
    first_row = 1
    while ri < pn:
        cells = parsed[ri]
        if first_row == 0:
            out = out + ','
        first_row = 0
        out = out + '{'
        col = 0
        cn = len(cells)
        slot = 0
        while col < cn:
            key = header[col]
            c = cells[col]
            if len(key) > 0 and len(c) > 0:
                if slot > 0:
                    out = out + ','
                out = out + '"' + key + '":"' + c + '"'
                slot = slot + len('|')
            col = col + len('|')
        out = out + '}'
        ri = ri + len('|')
    out = out + ']'
    return out

12 test cases ship with it; the first three:

inout
| n | v |
|---|---|
| b | 2 |
| a | 1 |
[{"n":"b","v":"2"},{"n":"a","v":"1"}]
| n | v |
|---|---|
| b | 2 |
| a | 1 |
[{"n":"b","v":"2"},{"n":"a","v":"1"}]
| n | v |
|---|---|
| b | 2 |
| a | 1 |
[{"n":"b","v":"2"},{"n":"a","v":"1"}]
id
markdown_table_to_json
artifact
d8faaec5ea5a…bd8a5
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/markdown_table_to_json
POST https://research.zaiba.cloud/api/v1/programs/markdown_table_to_json/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/markdown_table_to_json/code
# 200 · text/plain · the tool as one Python file, written by the library's authors