Skip to main content

allude

Building precise functionality from vague specifications

To install: pip install allude

allude collects small tools that turn loose, human-friendly specifications (a list of annotations, a dot graph, "this is proportional to that") into precise artifacts: diagram source, edge lists and callable functions with meaningful signatures.

Examples

A Gantt chart from a list of annotations

Give mermaid_gantt an iterable of dicts with a task name, a begin time (bt) and an end time (tt), and it gives you Mermaid Gantt source that you can paste into any Mermaid renderer (GitHub markdown, mermaid.live, ...):

>>> from allude import mermaid_gantt
>>> annots = [
...     {"task": "design", "bt": 0, "tt": 3},
...     {"task": "build", "bt": 3, "tt": 10},
...     {"task": "test", "bt": 8, "tt": 12},
... ]
>>> print(mermaid_gantt(annots, title="Project"))
gantt
    dateFormat  s
    axisFormat  %S
    title Project
    "design" : 0, 3
    "build" : 3, 10
    "test" : 8, 12

Group tasks into sections with any function of the annotation:

>>> annots = [
...     {"task": "design", "bt": 0, "tt": 3, "team": "ux"},
...     {"task": "build", "bt": 3, "tt": 10, "team": "eng"},
...     {"task": "user tests", "bt": 8, "tt": 12, "team": "ux"},
... ]
>>> print(mermaid_gantt(annots, group=lambda a: a["team"]))
gantt
    dateFormat  s
    axisFormat  %S
    Section ux
    "design" : 0, 3
    "user tests" : 8, 12
    Section eng
    "build" : 3, 10
<BLANKLINE>

If your dicts use other field names, say which ones with the task=, bt= and tt= arguments.

Edges from a graphviz (dot) specification

Sketch a graph in dot syntax (a string, or a graphviz object) and get its edges as (source, target) pairs:

>>> from allude.util import get_edges
>>> get_edges('''
... digraph {
...     rain -> traffic
...     rain -> wet
...     traffic -> moody
...     wet -> moody
... }
... ''')
[('rain', 'traffic'), ('rain', 'wet'), ('traffic', 'moody'), ('wet', 'moody')]

Functions from "this is proportional to that"

mk_proportional_change_func makes a function that updates a prior in proportion to some evidence, and gives it a name and a signature that use your own variable names:

>>> import inspect
>>> from allude.util import mk_proportional_change_func
>>> rain_to_mood = mk_proportional_change_func("mood", "rain", 0.5)
>>> rain_to_mood.__name__
'rain_to_mood'
>>> print(inspect.signature(rain_to_mood))
(mood, rain, *, mood_rain=0.5)
>>> rain_to_mood(10, 2)  # mood * (rain * 0.5)
10.0
>>> rain_to_mood(mood=10, rain=2, mood_rain=0.1)
2.0

You can scale such a function by multiplying it by a number:

>>> (rain_to_mood * 3)(10, 2)
30.0

Metadata

Release files for allude 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for allude 0.1.5
File Size Uploaded
allude-0.1.5.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for allude 0.1.5
File Interpreter ABI Platform
allude-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / allude-0.1.5.tar.gz

Download URL allude-0.1.5.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bccd728bf4d80ef09b91e26dd88b41c91e8d53529ce7b88f076256276b41a677
BLAKE2b-256 checksum
How to use checksums
3d4db63c341f969cb2e33043b357c48d029e9b269cd10ae3a4bdb028d8a0f3a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / allude-0.1.5-py3-none-any.whl

Download URL allude-0.1.5-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caaebb7a8e49d3dcd40b27a39c31497b8e99c74b60748c14cc08b17e5c160fe9
BLAKE2b-256 checksum
How to use checksums
6bb92e89768abcf6fde34fca571b2e77161279943c2c4b63bc70c97510a59c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page