Query Json


#1

I was wondering, is there any Atom plugin which allows for json queries? I see something at https://github.com/ianwremmel/atom-json-query but have no idea how I would go about installing this into Atom since it does not come up in the plugin list. Any help or ideas are welcome - I have some largish json files I need to pull certain data from…


#2

There are multiple components to this, so I have multiple answers.

  1. If it’s not visible in the database, the package is probably marked as deprecated because it hasn’t been maintained for three years.
  2. It’s easy to manually install packages. The best way is to git clone the repo into your preferred folder for git repos, then navigate into it and use apm install to download and build all its dependencies and apm link to create a symlink inside .atom/packages that points at the repo.
  3. Atom is built on JavaScript, so it can handle JSON natively. If you describe to us exactly how you imagine this process happening, we can provide guidance about how to make it happen.

#3

It doesn’t look like it was ever published to apm. It also has a high chance of not working, considering that it was created before the Atom API stabilized and never updated. However, if you want to try it…you can execute the apm install ianwremmel/atom-json-query command.


#4

Well I have a pretty large json file with a bunch of data, and I really need to do some queries on it like, sql.

I managed to do them online with http://jmespath.org/ but I see (now) that there are multiple ways online to do it.

There are even more ways with just javascript libraries (http://orangevolt.blogspot.rs/2012/12/8-ways-to-query-json-structures.html old article - probably many more ways now) but there is nothing build into Atom or one of it’s packages?


#5

This is pretty vague. It doesn’t describe what you’re looking for for inputs or outputs.

I managed to do them online with http://jmespath.org/ but I see (now) that there are multiple ways online to do it.

Do you want JMESPath? Because there’s a library for that.

but there is nothing build into Atom or one of it’s packages?

Atom can handle JavaScript objects natively. That’s not an issue. Querying the objects would involve some specialized tasks, and that’s not something that base Atom needs to do. I can’t guarantee you that there isn’t a package out there that does this, but if you’ve searched and come up empty, there might not be.