JSON

Application and Data / Languages & Frameworks / Languages
Avatar of lukasvarkalis
Developer at Veleza
Needs advice
on
Node.js
JavaScript
and
Firebase

Hi all,

I need advice for object-oriented data analysis. I have exported a collection of users from Firebase to JSON, and I want to analyze it, for example, how many users are females, males, etc. Are there any tools or packages that could help me quickly analyze this data?

READ MORE
2 upvotes11.9K views
Replies (3)
Avatar of ashwani_0x
Software Engineer III at Airtel Payments Bank
Recommends
Microsoft Excel

Excel would be a go to choice. You can do all sort (mostly) of analysis on data easily. (unless you've nested array). Apply pivots, infer tables, generate graphs.

If the data size is huge, you can also try MySQL and do queries in traditional manner.

READ MORE
1 upvote227 views
View all (3)
Avatar of subratds69
Lead Enginner at HCL Technologies LTD
Needs advice
on
MySQL
MongoDB
and
Karate DSL

I want to develop a custom API testing tool for which I have chosen Karate DSL. As I will be dealing with APIs, I need to handle lots of data in JSON or XML format. I need advice on which DB is best suited for my application. MongoDB or MySQL?

Please Suggest. Thank you in advance.

READ MORE
2 upvotes6.9K views
Replies (1)
Avatar of ctovarun6818
CTO at Nugen Computer & I.T. Services

As you mentioned that you are going to deal with lot of JSON or XML format in your app. Then I would suggest you to go for the MongoDB. It is very easy to maintain JSON records in mongodb and you can store XML as a string there. MongoDB will help to traverse lot of JSON/BSON records within fraction of seconds.

READ MORE
3 upvotes81 views
Needs advice
on
Python
and
JSON

Hi. Currently, I have a requirement where I have to create a new JSON file based on the input CSV file, validate the generated JSON file, and upload the JSON file into the application (which runs in AWS) using API. Kindly suggest the best language that can meet the above requirement. I feel Python will be better, but I am not sure with the justification of why python. Can you provide your views on this?

READ MORE
7 upvotes92.4K views
Replies (4)
Recommends
Python

CSV and JSON libraries are available in most modern languages.

Since you're leaning toward Python, this task is trivial with Python's csv module (and specifically the DictReader class) and the json module. Both are part of the Python standard library.

You will need to consider whether the resulting file to contain a single json list with all csv rows (i.e., [{*row 1 data*}, {*row 2 data*}]) or as a series of json key-value maps without the enclosing list. The latter approach is not valid json (and should NOT have a .json suffix), but is easier to parse as a stream.

Here's a version with the enclosing list:

    import csv, json
    print(json.dumps(list(csv.DictReader(open(fn)))))
READ MORE
5 upvotes82.9K views
Recommends
Python

Python is very flexible and definitely up the job (although, in reality, any language will be able to cope with this task!). Python has some good libraries built in, and also some third party libraries that will help here. 1. Convert CSV -> JSON 2. Validate against a schema 3. Deploy to AWS

  1. The builtins include json and csv libraries, and, depending on the complexity of the csv file, it is fairly simple to convert:
import csv
import json

with open("your_input.csv", "r") as f:
    csv_as_dict = list(csv.DictReader(f))[0]

with open("your_output.json", "w") as f:
    json.dump(csv_as_dict, f)
  1. The validation part is handled nicely by this library: https://pypi.org/project/jsonschema/ It allows you to create a schema and check whether what you have created works for what you want to do. It is based on the json schema standard, allowing annotation and validation of any json

  2. It as an AWS library to automate the upload - or in fact do pretty much anything with AWS - from within your codebase: https://aws.amazon.com/sdk-for-python/ This will handle authentication to AWS and uploading / deploying the file to wherever it needs to go.

A lot depends on the last two pieces, but the converting itself is really pretty neat.

READ MORE
3 upvotes82.9K views
View all (4)