Git Product home page Git Product logo

anonymijson's Introduction

Anonymijson

Anonymise JSON data structures. The tool helps ensure that test data is stripped of identifiable personal data and unlicensed content. This is useful as it allows you to save time when creating new test cases or other test data for your software. You can get started using Anonymijson provided you have Go installed.

Scroll down for an explanation on how to install, and how to use.

Installation

Provided you have Go installed, you can simply run

go get github.com/justuswilhelm/anonymijson

and as long as Go has executables in your $PATH, you can immediately start using the command anonymijson.

Usage

$ cat test.json test2.json
{
  "1": 1.02,
  "bla": "lol",
  "hello": [
    1,
    2,
    3
  ]
}
[
  [
    1,
    2
  ],
  1,
  2,
  3
]
$ anonymijson test.json test2.json
=== test.json ===
{
  "1": 0.9122551027038107,
  "bla": "scaberulous-honeysweet",
  "hello": [
    0.6288449008092282,
    0.9233224572170322,
    0.5275968199385908
  ]
}

=== test2.json ===
[
  [
    0.35278562141995556,
    0.5841195295045782
  ],
  0.9718421636089548,
  0.7314389548879902,
  0.2812210260450312
]

Will override all values in JSON objects, while leaving they key/array/hashmap structure. The format will be kept, so strings will be replaced by random strings and numbers by random numbers.

Furthermore, anonymijson can be run in-place. This means that files will be replaced directly with the randomized values, instead of outputting the result to stdout. This can be done by running

$ anonymijson test.json

The output is stored within the file provided.

$ cat test.json
{
  "1": 0.09056946229454671,
  "bla": "Nathaniel-bonded",
  "hello": [
    0.8885474570694423,
    0.8161380166567574,
    0.4648524575247153
  ]
}

anonymijson's People

Contributors

justuswilhelm avatar keranem1 avatar

Watchers

James Cloos avatar  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.