Coder Social home page Coder Social logo

json_merger's Introduction

Json Merger

A python script that lets you to merge jsons into a single json

How to use?

  • Step 1: Running the script

$ cd <navigate to script path>
$python main.py
  • Step 2: Enter folder path


$ c:\<some path file>\ >Enter the folder path :<file_directory>:\<folder>\<sub folder>
  • Step 3: Enter base name of the file

$ c:\<some path file>\ > Enter the base file name : <some name>
  • Step 4: Enter merged json file name without extension

$ c:\<some path file>\ > Enter the merger file name : <some name>
  • Step 5: Enter File size limit

$ c:\<some path file>\ > Enter the file size in 1.bytes 2.Kb 3.Mb : <choose option>
$ c:\<some path file>\ > Enter the limit : <any_limit>

  • Step 6: BOOM! watch your merged json file

$ c:\<some path file>\ > The merged file size exceeds the limit . Do you still wanna keep?(y/n)
$ c:\<some path file>\ > <type 'n' to remove file>

How it Works?

from jsons2json.merger import json_merger

This snippet is crucial for merging json.It is a user defined module that takes

  • file path
  • Base name

as arguments and merges all the jsons starting with the base name specified by the user

Also,You can specify the

  • output file name
  • output file size

Complexity Analysis

The complexity depends on 2 key factors

  • Distinct keys in the json object
  • Number of json files
  • Length of the json array of each value of a key-value pair
Let the number of Files be -> 'N'
and Let the length of the json array be 'M'
if Each json file share a same common key 
then, complexity becomes
 ==> O(NM) <==

Worst Case

Square Complexity

O(N^2) 

Sample Working

json_merger's People

Contributors

yk-x-25 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.