Skip to main content

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

Koala diagram example


Installation

Install from PyPI:

pip install koala-diagrams==1.0.0

Or with pipx:

pipx install koala-diagrams==1.0.0

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

👉 Full syntax guide:

  • docs/syntax.md

👉 Authoring tutorial:

  • docs/tutorial.md

👉 Examples:

  • docs/examples/

Features

  • Simple hierarchical DSL
  • Multiple layouts (tree, radial, synoptic)
  • Theme system
  • CLI and Python API
  • SVG output

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


´´´

Multiple Layouts

Tree, radial, and synoptic layouts from the same source.

Radial example` ´´´

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

koala_diagrams-1.2.1.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

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

koala_diagrams-1.2.1-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file koala_diagrams-1.2.1.tar.gz.

File metadata

  • Download URL: koala_diagrams-1.2.1.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for koala_diagrams-1.2.1.tar.gz
Algorithm Hash digest
SHA256 3aa9ba467cea04184c5879ba121a8acf62b2111a19300e6ccff150af304862bf
MD5 97724ddcd9d69c079fb329ba3a40646c
BLAKE2b-256 9e6078367b48fc80d3c62be90925d4b0b922bbf6c3851f65fbf9633491a8c7e5

See more details on using hashes here.

File details

Details for the file koala_diagrams-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: koala_diagrams-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for koala_diagrams-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8e681acca93d712a9c9b0b59582b116c18432e06edc41f1853e98f95a71963c
MD5 ce11187dc58722cc7286bb2a2fbec834
BLAKE2b-256 7451c3fa59991ea55697b2ef669491ee7b722cd76295a0c8a85f2a768d3d2b6b

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