Skip to main content

A marble diagram generator

Project description

dooble

https://img.shields.io/pypi/v/dooble.svg https://img.shields.io/travis/MainRo/dooble.svg

Dooble is a marble diagram generator from text. It eases the documentation of ReactiveX standard and custom operators, in a consitent way.

Installation

pip install dooble

A sphinx plugin is also available:

pip install sphinxcontrib-dooble

Usage

The text grammar allows to easilly define observables and operators. The map operator with an input observable and an output observable is described the following way:

--1--2--3--4-->
[ map(i: i*2) ]
--2--4--6--8-->

save this text in a file named map.txt and then render it to an image:

dooble --input map.txt --output map.png

The generated image looks like this:

examples/map.png

Higher order observables can also be documented easilly:

--a-b-c---d-e-f-->
[     window     ]
--+-------+------>
          +d-e-f-|
  +a-b-c-|

save this text in a file named window.txt and then render it to an image:

dooble --input window.txt --output window.png

The generated image looks like this:

examples/window.png

For operators that take several observables as input, it is possible to label them:

--1--2--3--*
         a-7-8-|
[   catch(a)   ]
--1--2--3--7-8-|

save this text in a file named catch.txt and then render it to an image:

dooble --input catch.txt --output catch.png

The generated image looks like this:

examples/catch.png

Full grammar

  • Each text line represents either an observable, either an operator

  • Observables are defined with dash lines

  • If an Observable starts with a letter, this letter is considered as a label

  • Each character represent a time span

  • Character | indicates an observable completion

  • Character * indicates an observable error

  • Character > indicates an observable continutation

  • The + character is used to define anchors of higher order observables

  • operators start with a [ and end with a ]

The full grammar is the following one (in tatsu peudo ebnf syntax):

@@grammar::dooble

start = { layer } $ ;

layer
=
| obs:observable
| op:operator
;

observable = {skipspan}* [prefix] {lifetime}* completion ;
operator = '[' description ']' ;

prefix = '+' | label ;

label = /[a-z]/ ;

lifetime
=
| ts:timespan
| item:item
;

completion = /[>|\*]/ ;

skipspan = ' ' ;
timespan = '-' ;
item = /[a-zA-Z0-9+.,]+/ ;

description = /[a-zA-Z0-9,:+*() <>_]+/ ;

History

0.1.0 (2019-02-08)

  • First release on PyPI.

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

dooble-0.6.0.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file dooble-0.6.0.tar.gz.

File metadata

  • Download URL: dooble-0.6.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for dooble-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2214c9f239006a9eafdd1affab4662eeebc7953775e8685a89dade15a2843a8f
MD5 5b5294ab0f3eede1c4db7aa5beb6cb2e
BLAKE2b-256 5a17f7e68b4fed4d6bd309d3241e3ff28f189b7439345fe1954e05d4f4d40ce1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page