Koala is a DSL and SVG compiler for structured concept diagrams.
Project description
Koala
Koala is a DSL for generating diagrams from structured text.
Write once, render in multiple layouts.
Quick Example
Write this:
@theme jungle
main:: 1 Biology
Study of life.
hl:: contains -> 1.1 Cell
Basic unit of life.
1.2 Genetics
Study of heredity.
Then run:
koala compile example.txt --layout tree
Result
Installation
Install from PyPI:
pip install koala-diagrams==1.2.1
Or with pipx:
pipx install koala-diagrams==1.2.1
Usage
CLI
koala compile docs/examples/tree.txt --layout tree
koala compile docs/examples/radial.txt --layout radial --theme jungle --size square
koala inspect docs/examples/tree.txt
koala validate docs/examples/radial.txt --strict
Python
import koala
result = koala.compile(
"docs/examples/radial.txt",
layout="radial",
theme="academic",
size="square",
)
print(result.output_svg)
DSL Syntax
Koala uses a simple line-based DSL:
[kind::] [relation ->] number title
Example:
1 Main Concept
contains -> 1.1 Child Node
hl:: 1.2 Highlighted Node
Features
- Simple hierarchical DSL
- Multiple layouts (
tree,radial,synoptic) - Theme system
- CLI and Python API
- SVG output
Multiple Layouts
Tree, radial, and synoptic layouts from the same source.
Philosophy
Koala is built around a simple idea:
The same source file should be able to drive multiple layouts and visual styles without rewriting the content.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file koala_diagrams-1.2.2.tar.gz.
File metadata
- Download URL: koala_diagrams-1.2.2.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49c91749c22f2902e2c057ed4760d36f04fb575240d65c5fba3649a79c4a2051
|
|
| MD5 |
248500687f88bad46ff59f199d3ed67d
|
|
| BLAKE2b-256 |
fea8aa83220e602f5a465084963756cfbd2a6dfb9b5f4eb3c85079a19a789971
|
File details
Details for the file koala_diagrams-1.2.2-py3-none-any.whl.
File metadata
- Download URL: koala_diagrams-1.2.2-py3-none-any.whl
- Upload date:
- Size: 46.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098e46435759ad1c32d1ff04e8ff6f75de9d01b4df01916b15f304585c331888
|
|
| MD5 |
945a5197bd750061452d49587c329cb3
|
|
| BLAKE2b-256 |
08ca21fe1514339d4866a774eb4b30b321af0d9e343953c672f8df3392806a96
|