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 of 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wander-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

wander-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file wander-0.1.0.tar.gz.

File metadata

  • Download URL: wander-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for wander-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f7878f0c1fefa59f3795771b0e66a229e77b25c2a13fa1f1d6ca2958bf24e60
MD5 b606349ec1ed51b8606ff04c23ab1cfa
BLAKE2b-256 42fa67abce4104fbdda9af09996944ca42f2fd836898daaaeb7a059b37dbec3e

See more details on using hashes here.

File details

Details for the file wander-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wander-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for wander-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a45f53bcf9f28b11af0a955538e6f4d7b239bf21c0c9a779cfdaa34b8e850c62
MD5 45f4ca3f5ec2486b8895e645d5ce08f9
BLAKE2b-256 8a6d657fb43b0256da7f2f43519d0e8152d17f14997f4c51d08b4aaa3639472f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 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