News for hackers. Stuff that matters.
Re:Never run ‘python’ in your downloads folder by Hamuko on Sunday August 23, 2020 @05:06PM (#24255293)
Can you do straightforward JSON download and processing in bash?
Re:Never run ‘python’ in your downloads folder by heavyset_go on Sunday August 23, 2020 @05:52PM (#24255584)
You can go a long way with jq, pup and similar tools.

As an exercise, I used Bash to build scraping and download scripts for about a dozen websites. I found that I only needed to dip into Python when doing complicated operations on strings, or I needed access to data structures.

I actually liked the approach of using Bash first for scraping, because it gave me direct access to Bash's superior IPC and concurrency constructs. I could plug in a Python script into the pipeline and it wouldn't be any different than interacting with another Bash process.

Re:Never run ‘python’ in your downloads folder by samatman on Sunday August 23, 2020 @07:25PM (#24256165)
I do most of my straightforward JSON download and processing in bash. Well, in fish.

As everyone else replying to you indicated, I use jq for it. But when I type `curl http://example.com | jq .`, I'm programming in fish.

Granted, when I want to do something more complex and durable, I'm likely to reach for, yes, python. But nearly as often, I build up a moderately complex jq command, and set an alias to it.

Re:Never run ‘python’ in your downloads folder by dylan604 on Sunday August 23, 2020 @05:51PM (#24255577)
Is that the sole criteria for a scripting language to be useful?
Re:Never run ‘python’ in your downloads folder by edgyquant on Monday August 24, 2020 @12:22AM (#24257504)
I'd say yes being able to parse JSON is a requirement in today's world
Re:Never run ‘python’ in your downloads folder by Shared404 on Sunday August 23, 2020 @06:40PM (#24255899)
Not generally, but perhaps it is for their use case.
Re:Never run ‘python’ in your downloads folder by buddhiajuke on Sunday August 23, 2020 @06:50PM (#24255960)
With an util like jq, yes.
Re:Never run ‘python’ in your downloads folder by nnt38 on Tuesday August 25, 2020 @07:48AM (#24270370)
curl | jq