Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

100% Positive

Analyzed from 204 words in the discussion.

Trending Topics

#json#python#tool#clipboard#xml#yaml#might#copy#bash#print

Discussion (11 Comments)Read Original on HackerNews

nullgeo8 minutes ago
I like the version where it throws the error. That way I will realize I might not have copied the right JSON (or forgotten to copy)
lkbm16 minutes ago
I have this as a bash script and a some similar bash and python scripts for converting between python's print(my_dict) and json, or to run some python (mostly the dicts) through black.

The j2p is pretty self-evident if you know any python, and the only trick to p2j was knowing `ast.literal_eval(input_str)`.

megagpt15 minutes ago
Should be print(repr(my_dict)) in case my_dict is actually a string, or you'd have an injection attack
netsharcabout 1 hour ago
A universal tool (well, since I use Windows, a Windows tool) to modify the clipboard would be cool.

So, copy text to clipboard, press a hotkey to popup the menu, and it'll offer options depending on the detected text. For example changing the clipboard contents to prettified (if it detects JSON, XML, HTML), or formatting a number back and forth (e.g. working with SSN's out of numerical DB entries when they prefer AAA-GG-SSSS).

OskarSabout 2 hours ago
Lovely little alias, but I much prefer fracjson[0] pretty printing to jq, so I might go with that instead!

[0]: https://github.com/j-brooke/FracturedJson

pletnes33 minutes ago
Cool idea! I think it would look better as a function than an alias, but that doesn’t matter much.
dpflanabout 2 hours ago
There is also: - xq for xml - yq for yaml
mcoliverabout 1 hour ago
I wrote uq specifically for urls https://github.com/mcoliver/uq
dividedbyzeroabout 1 hour ago
yq can do a lot more than just yaml:

> yq is a portable command-line YAML, JSON, XML, CSV, TOML, HCL and properties processor

mhalikosenabout 2 hours ago
I didn't even know such a tool existed until Opus used it.
stefanvdw1about 3 hours ago
Not mine, just very useful