0.01
No commit activity in last 3 years
No release in over 3 years
A simple class to generate CSV strings (or files) given a JSON object or valid JSON string.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

json_converter

A small ruby class to convert JSON into a tabular, comma-separated format.

Installation

gem install json_converter

Usage

The JsonConverter class is able to convert objects created with JSON.parse, as well as raw JSON strings.

require 'json_converter'
converter = JsonConverter.new

json = some_valid_json_object_or_string

csv = converter.generate_csv(json)               # Generate a CSV string...
converter.write_to_csv(json, 'boiled_frogs.csv') # ... or write your CSV to a file

Inspired by http://konklone.io/json/.

TODO

  • Write tests
  • Repackage gem with a more descriptive name