Giter Site home page Giter Site logo

munge's Introduction

munge

A command line tool for converting data from one type to another. This is useful for data science when one has many types of data in different formats, and can be quickly converted to the same data type with munge!

Installation

If you want to contribute

git clone https://github.com/tommyanthony/munge
cd munge
pip install --editable ./
pip install -r requirements.txt

Otherwise to simply use munge

git clone https://github.com/tommyanthony/munge
cd munge
pip install --editable ./

Usage

All the following examples use the data from the test-data directory, so follow along!

> ls
github.csv      in.json         out.html
in.csv          in.xlsx         presidents.yaml
> cat in.json
[
  {
    "last_name": "Adams",
    "age": 90,
    "first_name": "John"
  },
  {
    "last_name": "Ford",
    "age": 83,
    "first_name": "Henry"
  }
]
> munge csv -i in.json
first_name,age,last_name
John,90,Adams
Henry,83,Ford

> cat presidents.yaml
- {first_name: John, last_name: Adams}
- {first_name: George, last_name: Washington}

> munge -i presidents.yaml csv
last_name,first_name
Adams,John
Washington,George

> munge -i in.csv -o output.json json
> cat output.json
[{"first_name": "John", "last_name": "Adams"}, {"first_name": "George", "last_name": "Washington"}]

Munge by default reads from standard in and prints to stdout, allowing it to interact with all the other UNIX utilities you're used to.

> curl https://raw.githubusercontent.com/rankam/napoleon/ce658a0ff1a16debc240a6c9b3790ac1b9a8efd5/original_data/cities.json | munge csv -o cities.csv
> cat cities.csv
cities_lat,cities_long,cities_city
55,24,Kowno
54.7,25.3,Wilna
54.4,26.4,Smorgoni
54.3,26.8,Moiodexno
55.2,27.7,Gloubokoe
...

In development

I'm currently working on the ability to perform transforms on the dataset in munge, and development for this can be seen under transforms branch.

munge's People

Contributors

tommyanthony avatar

Stargazers

ron bhattacharyay avatar

Watchers

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