#jinja

2025-04-17

LitestarCatsCV. Тренируемся на кошках. Расширяем возможности и готовимся к продакшену. Часть 3

Привет, котики и котолюбы! В первой части нашего кошачьего приключения мы выбрали инструменты (Litestar вместо FastAPI, Granian вместо Gunicorn, KeyDB вместо Redis), настроили uv и заложили фундамент проекта. Во второй части мы построили полноценное CRUD API для резюме котиков (или людей, если вам так ближе), подружили его с PostgreSQL через SQLAlchemy, настроили миграции с Alembic и написали тесты с Pytest. У нас уже есть стены и фундамент, но пора ставить крышу и готовиться к продакшену! 🏠 Сегодня мы сделаем наш API ещё круче: вынесем конфиги в отдельный модуль с помощью msgspec, добавим аутентификацию через встроенный JWT в Litestar, ускорим API с KeyDB, проверим покрытие тестами с coverage, упакуем всё в Docker и нарисуем резюме котиков с помощью Jinja. К концу статьи наш кошачий проект будет готов к реальной жизни — поехали! 🚀

habr.com/ru/companies/ntechlab

#api #python #tutorial #backend #uv #fastapi #litestar #granian #jinja #keydb

2025-04-15

alojapan.com/1247522/april-11- April 11, 2025 #Shizuoka #ShizuokaDestinations #ShizuokaTour #ShizuokaTravel #ShizuokaTrip #ShizuokaVacation #静岡 April 11, 2025 Roaming shrines with beautiful cherry blossoms taken at Yamanashi prefecture. Japan#shrines #beautifuljapan #amazingview #travel #yamanashi #cherryblossomchannel #beautifuljapan#scaredshrine#beautifulplace #fullbloom #sakura #jinja

April 11, 2025

@frenck My biggest #Jinja gripe, in HA context, is unavailable/unknown. Semantically these aren't really values. In creating a template sensor for the difference of two temperatures, I have to check for them, and in general there are a lot of if foo not unavailable and foo not unknown.

What I would like is propagation, so that any template whose output expression has used a variable that is unknown has value unknown, and then similarly for unavailable.

2025-03-19

🚀 𝗖𝗮𝗹𝗹𝗶𝗻𝗴 𝗮𝗹𝗹 𝗛𝗼𝗺𝗲 𝗔𝘀𝘀𝗶𝘀𝘁𝗮𝗻𝘁 𝘁𝗲𝗺𝗽𝗹𝗮𝘁𝗲 𝘄𝗶𝘇𝗮𝗿𝗱𝘀! 🧙‍♂️

I’m working on extending the template engine with some new functions, filters, and tests, for example:

✅ flatten(list_of_lists) – Flattens nested lists into a single list
✅ combine(dict1, dict2, ...) – Merges multiple dictionaries together

Now, I need your input! 💡

🔍 What template functions, filters, or tests would make your automations easier?
💬 What repetitive Jinja gymnastics do you find yourself doing over and over?

#HomeAssistant #Jinja

2025-03-17

You know, the _one_ time I'd have actually appreciated unsolicited advice, the fedi doesn't deliver.

Because I'm indeed wondering if there are good alternatives to #Jinja in #Python.

David Lord :python:davidism@mas.to
2025-03-06

In order to fix a Jinja security issue (upgrade to 3.1.6 today!) I had to figure out a clever way to improve Python's `hasattr`: davidism.com/python-jinja-hasa #python #jinja

2025-02-28

Version 1.8.0 of jinja2-fragments is out!

Release notes:
- Adds support for rendering multiple blocks on Flask, Quart, Sanic and Litestar.
- Fixes deprecated Litestar import.

pypi.org/project/jinja2-fragme

#jinja #flask #quart #sanic #litestar #htmx

Timothée Mazzucotelli :python:pawamoy@fosstodon.org
2025-02-25

How do you filter a list in #Jinja, to keep only elements that have a length >= 2?

:rss: HuffPost Japan - Athena2huffingtonpost@rss-mstdn.studiofreesia.com
2025-02-18

神社の「お清め」も令和ならではの「アレ」に変更!?⇨「物理のお清めですな」「ジェットタオルの方がいいと思います」の声
huffingtonpost.jp/entry/story_

#huffingtonpost #アートとカルチャー #ネットで話題 #神社 #nettodewadai #jinja

Chris WarwickChrisWarwick@mas.to
2025-02-02

@JingleDJ Thanks! I've done a bit more reading and experimentation and (along with some other suggestions from folk) I'm fairly confident about things. But it's not natural is it?! Basically, I still agree with this guy: reddit.com/r/homeassistant/com

Anyway, it is what it is. No changing it now - although installing PyScript or AppDaemon is appealing (even though I've never used Python in anger (yet...) - I'd still be a lot more productive I think)...
#HomeAssistant #Jinja #Python #WhyWhyWhy #HoHum

A Reddit post talking about Jinja. Text reads, "I've been coding for over thirty years, and Jinja in Home Assistant kicks my ass. The hierarchy of attributes, the null coalescing, the handling of undefined vs unavailable vs unknown, the typing of variables, god - I get that it's a templating language, but it's SOOO convoluted. Every time | want to do something, I refer to the Home Assistant templating page, and every time, | get about 20% of the way there, then have to search through a half dozen other posts from people and try to divine what's going on."
:rss: HuffPost Japan - Athena2huffingtonpost@rss-mstdn.studiofreesia.com
2025-01-10

ポツンと神社、ダム湖の中に何のため?「近づこうにも、道が見当たらない」光景が神秘的
huffingtonpost.jp/entry/story_

#huffingtonpost #アートとカルチャー #ネットで話題 #神社 #nettodewadai #jinja

2025-01-06

Ok, I've got a #cloudengineer spicy 🌶️ take that will lose some followers.

(Preface: I've used #terraform and built up some moderately complex infra with it. Nothing crazy. I'm not an expert, but definitely not new to it either.)

I will take #ansible every day of the week over TF for any task that's not just spinning up vanilla, CSP-specific infra. That's the one place where TF shines, and everything else imo is just unnecessarily irritating.

Ansible is cleaner, easier to reason about, and just makes sense to my brain.

I think it's TF's syntax. It reminds me of #jinja or #golang template language with the unintuitive way of evaluating conditions and calling functions.

I said what I said.

2024-12-26

Создание динамических таблиц в SuperSet

Однажды в студеную зимнюю пору из-за морей, из-за океанов прилетело известие: лицензии не выдаем, тех.поддержку не оказываем, а можем и вовсе отключить все системы. В компании погоревали, но делать нечего, решили переходить на новые системы, да такие, чтобы не смогли в любой момент их превратить в тыкву. И стали смотреть в сторону open-sourсe решений. Проанализировали несколько BI-систем и остановились на SuperSet. /*После QlikSense и Tableau казалось, что это так себе затея*/ Меня зовут Корнева Настя, я отвечаю за разработку BI-отчетности в Magnit Tech в рамках проекта Аналитика УЦП (управление цепочками поставок). В этой статье поделюсь нашим опытом создания динамических сводных таблиц в BI-инструменте SuperSet, что будет полезно разработчикам отчетности и всем, кому интересна тематика.

habr.com/ru/companies/magnit/a

#superset #сводная_таблица #динамическая_таблица #jinja #jinja2 #python #big_data #bi

David Lord :python:davidism@mas.to
2024-12-21

Jinja 3.1.5 released! github.com/pallets/jinja/relea This contains two security fixes and a bunch of bug fixes. #Python #Flask #Jinja

$(cat /dev/urandom)mattesilver@fosstodon.org
2024-12-20

Generating #python code: #jinja or libcst?

#codeGen #codeGenerator #jinja2

:rss: HuffPost Japan - Athena2huffingtonpost@rss-mstdn.studiofreesia.com
2024-12-14

「境内で鶏肉・卵を食すべからず」神社の習わしが「なぜ」と注目。理由を聞いた
huffingtonpost.jp/entry/story_

#huffingtonpost #アートとカルチャー #ネットで話題 #神社 #nettodewadai #jinja

2024-12-03

Hey #Ansible and/or #Jinja crowd: Any idea how I can, reasonably easily, transform the 'records_in' data into 'records_out'?

What I basically need is to merge these records by _two_ keys: prefix and type. If it was only one key, this would probably be a candidate for the mergeby filter (docs.ansible.com/ansible/lates), but no, it should only merge items where both of these keys are identical.

Note that I'm converting 'value' into a list on the fly here, too, where necessary. That's only nice-to-have.

records_in:
  - prefix: ''
    type: A
    value: 127.0.0.1
  - prefix: ""
    type: AAAA
    value: ::1
  - prefix: www
    type: A
    value: 127.0.0.1
  - prefix: ''
    type: A
    value:
      - 127.0.0.2

records_out:
  - prefix: ''
    type: A
    value:
      - 127.0.0.1
      - 127.0.0.2
  - prefix: ""
    type: AAAA
    value: ::1
  - prefix: www
    type: A
    value: 127.0.0.1
David Sullivantkroo@fosstodon.org
2024-11-04

Home Assistant markdown card that shows max, min, and average of all temperature sensors. #HomeAssistant #jinja

yaml: gist.github.com/tkroo/a192e110

Home Assistant markdown card that shows max, min, and average of all temperature sensors.
2024-10-27

Пара шаблонов кастомизированных элементов Handlebars для Apache Superset — 2

Причины написания статьи, общие правила использования handlebars в superset и советы содержатся в первой статье , поэтому сразу опишу следующие шаблоны.

habr.com/ru/articles/853476/

#handlebars_superset #шаблоны_графиков #jinja #css #html #apache_superset #templates #charts #аналитика #дашборд

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst