resa-padel/resa_padel/payload_builders.py
Stanislas Jouffroy 0938fb98b7 Big refactoring.
- clubs, booking platforms and user are now defined in customization files -> there are less environment variables
- the responsibility of the session moved
- booking cancellation is available
2024-03-17 23:58:03 +01:00

12 lines
357 B
Python

from pathlib import Path
from jinja2 import Environment, FileSystemLoader
class PayloadBuilder:
@staticmethod
def build(template_path: Path, **kwargs) -> str:
environment = Environment(loader=FileSystemLoader(template_path.parent))
template = environment.get_template(template_path.name)
return template.render(**kwargs)