semvec/pypi-packages huggingface dataset:
telegrinder-templating 1.0.4
This module is used with telegrinder framework. It is used to create text templates.
License: MIT
Requires Python: >=3.11,<4.0
Keywords: python,telegrinder framework,tool,templating,telegrinder tool,jinja2

# telegrinder templating tool

This module is used with telegrinder framework. It is used to create text templates.

Install using PyPI:

```
pip install telegrinder-templating
```


# Documentation

There is templating in order to avoid using large text. Module `telegrinder_templating` has an `ABCTemplating` interface for creating templating classes.

```python
from telegrinder_templating import ABCTemplating
```

`telegrinder_templating` has class `JinjaTemplating` to work with jinja templates.

```python
from telegrinder_templating import JinjaTemplating
```

`JinjaTemplating` methods:
* `render(template_name: str, **data: Any) -> str`
* `render_from_string(template_source: str, **data: Any) -> str`
* `@add_filter(key: str | None) -> wrapper(func: JinjaFilter)`


Example:
```python
import asyncio
import pathlib

import jinja2

from telegrinder_templating import JinjaTemplating

jt = JinjaTemplating(pathlib.Path(__file__).resolve().parent / "templates")


@jt.add_filter("title")
def title_string(value: str, must_strip: bool = False) -> str:
    if must_strip:
        return value.strip().title()
    return value.title()


async def main():
    await jt.render("template.j2", digits=[1, 2, 3])
    await jt.render_from_string("{{ name|title(must_strip=True) }}", name="  alex")


asyncio.run(main())
```

More details about `Jinja` can be found [*HERE*](https://jinja.palletsprojects.com/en)
pawnhub 0.3.0
CLI listing your online chess games results
License: MIT
Requires Python: >=3.6
Keywords: chess

[![](https://readthedocs.org/projects/pawnhub/badge/?version=latest)](http://pawnhub.readthedocs.org/en/latest/?badge=latest)
[![](https://pepy.tech/badge/pawnhub)](https://pepy.tech/project/pawnhub)

# pawnhub


Retrieve results of your online chess games from lichess.org and
chess.com.

Instantly see how you negotiated first moves to reach your favourite
positions. Spot which lines are your kryptonite leading to a
dry/deceiving middle game.

Behind the scenes, it exploits
[pawnstore](https://github.com/Kraymer/pawnstore) library to fetch games
into a local database then make them
[rich](https://github.com/Textualize/rich).

**Read documentation at https://pawnhub.readthedocs.io/**

## Screencast

[![asciicast](https://asciinema.org/a/518641.svg)](https://asciinema.org/a/518641)

## Install

`pawnhub` is written for Python 3.7+, install with pip via ``pip3 install pawnhub`` command.

## Usage

    Usage: pawnhub.py [OPTIONS]  

      List games for CHESSCOM_USER and LICHESS_USER.  

      Display for each game the first move out of repertoire if WHITE_REP or/and
      BLACK_REP are given.  

    Options:
      -c, --chesscom_user CHESSCOM_USER
                                      chess.com user login
      -l, --lichess_user LICHESS_USER
                                      lichess.org user login
      -n, --lines NUM                 Print the NUM most recent games
      -s, --search [FIELD:]TEXT       Search for text in given field (see
                                      https://kraymer.github.io/pawnhub/#search).
                                      Omit FIELD: to search in whole games data.
      --rw WHITE_REP                  Path or url to a PGN file for white
                                      repertoire
      --rb BLACK_REP                  Path or url to a PGN file for black
                                      repertoire
      --color                         Always color terminal output
      --version                       Show the version and exit.
      -h, --help                      Show this message and exit.