News for hackers. Stuff that matters.

ptwt

Re:Htmlq: like jq, but for html on Tuesday September 07, 2021 @04:46AM (#28442491)
It did write it a few years ago.

https://github.com/plainas/tq

Re:Show HN: Django REST – Typed Views on Thursday October 17, 2019 @07:23AM (#21280860)
Shameless self plug: a couple of days ago I posted a project that does pretty much the same thing but built on top of flask instead of django: https://github.com/plainas/flask-swagger-types

Also relying on Marshmallow but with the extra bonus of generating an openapi spec for you and hosting swagger ui.

It puzzles me that such approach is not the norm. Interesting to see more people tackling the same problem.

I put this similar project[0] together a while ago. Almost the same concept, but I skipped the json layer altogether as I just wanted a quick way of getting nuggets of content from webpages into my terminal.

For example:

  curl https://news.ycombinator.com/news | tq -tj ".title a"
0. https://github.com/plainas/tq