Skip to main content

Wander

wander is a simple Python library that makes it easier to incorporate external data into LLM prompt.

Installation

You can install wander with pip

pip install wander

You need to have Python version 3.10 or above to use this library.

Usage

Assuming you have an markdown text with a special block !shell.

text = """\
Today is:
```!shell
date
```\
"""

Using wander to render it.

from wander import Renderer
from wander.plugins import ShellPlugin

renderer = Renderer(plugins=[ShellPlugin()])
renderer.render(text)

Output:

Today is:
Wed May 17 16:48:09 +08 2023

Writing your own plugin

To write your own plugin, simply inherit the Plugin class and do the following:

  • Specify plugin_name property. This will be the name of the directive used in your special block.
  • Specify parser property, which is an argparse.ArgumentParser object to define what CLI-like arguments are accepted after the directive name
  • Implement run async method. It must takes an args argument holding all the values of the command arguments defined in your parser as well as content argument holding all texts in the block.

You can find an example in shell.py.

Release files for wander 0.1.1

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

Source distribution (sdist)

Source distribution for wander 0.1.1
File Size Uploaded
wander-0.1.1.tar.gz 4.0 kB Details

Built distribution (wheel)

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

Total release size: 9.7 kB

Release files / wander-0.1.1.tar.gz

Download URL wander-0.1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b41245e7841f1cbb74f48c73196bca2e80e555dcf227e903729b7bb643fd9b16
BLAKE2b-256 checksum
How to use checksums
07d317ef40a9ea317b67fe383e75f27b33213fb4bd2d1ce44737d639f4eb020a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / wander-0.1.1-py3-none-any.whl

Download URL wander-0.1.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29507982e03244b2b205b49cd5de6bb0ab41e85563cfbb15f316b0048f132e2e
BLAKE2b-256 checksum
How to use checksums
bea4440043389cd0ac871e740a62aef6db14c10cdaeecaa45fddc15c2ad27917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/5.15.90.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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