Skip to content

eeemoon/weneda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypi python support

Weneda

Modern way to edit and format text.

Installation

To install this module, run the following command:

pip install weneda

Examples

Placeholders

import asyncio
from weneda import Formatter, placeholder


class MyFormatter(Formatter):
    @placeholder(
        name="upper",
        syntax="upper_<text>",
        pattern=r"upper_(?P<text>.*)"
    )
    async def upper_handler(self, text: str) -> str:
        return text.upper()
    

async def main():
    formatter = MyFormatter()
    result = await formatter.format("Hello {upper_world}")
    print(result) # Hello WORLD


asyncio.run(main())