{"id":15571850,"url":"https://github.com/alexoid1/csv_json_converter","last_synced_at":"2025-03-13T19:44:21.977Z","repository":{"id":190048899,"uuid":"681888615","full_name":"Alexoid1/csv_json_converter","owner":"Alexoid1","description":"This gem converts a csv string to json object and vice versa.","archived":false,"fork":false,"pushed_at":"2023-09-05T22:45:39.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T05:03:50.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alexoid1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-23T01:34:01.000Z","updated_at":"2023-10-05T23:45:32.000Z","dependencies_parsed_at":"2024-10-02T18:01:27.001Z","dependency_job_id":"f99fcfc6-3312-4f49-8ef7-bbe2fd09c57c","html_url":"https://github.com/Alexoid1/csv_json_converter","commit_stats":null,"previous_names":["alexoid1/csv_json_converter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexoid1%2Fcsv_json_converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexoid1%2Fcsv_json_converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexoid1%2Fcsv_json_converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexoid1%2Fcsv_json_converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alexoid1","download_url":"https://codeload.github.com/Alexoid1/csv_json_converter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243474192,"owners_count":20296698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T18:01:09.486Z","updated_at":"2025-03-13T19:44:21.945Z","avatar_url":"https://github.com/Alexoid1.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CsvJsonConverter\n\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n[![csv_json_ - converter](https://img.shields.io/badge/csv_json_convert_-csv-2ea44f)](https://rubygems.org/gems/csv_json_converter)\n- [:green_book: Table of Contents](#-table-of-contents)\n- [:book: csv\\_json\\_converter ](#-csv_json_converter-)\n  - [Installation ](#installation-)\n    - [Usage](#usage)\n      - [Convert csv to json](#csv-to-json)\n      - [Convert json to csv](#json-to-csv)\n  - [:busts_in_silhouette: Authors ](#-authors-)\n  - [:handshake: Contributing ](#-contributing-)\n  - [:star:️ Show your support ](#️-show-your-support-)\n# :book: csv_json_convert \u003ca name=\"about-project\"\u003e\u003c/a\u003e\nThis gem converts a csv string to json object.\n## Installation \u003ca name=\"tech-stack\"\u003e\u003c/a\u003e\nAdd the following code to you Gemfile\n```\ngem 'csv_json_converter'\n```\nor\ninstall the gem on your terminal\n```\ngem install csv_json_converter\n```\n### Usage\n`require` this gem on the top of your ruby code.\n### Csv to json\nIf you want to convert `csv string`, to json you can use `to_json` method from `CsvJsonConverter`. Let's see how:-\n\n\u003ci\u003eFor example \u003c/i\u003e\n```ruby\n\n    require 'csv_json_converter'\n\n    data_csv='file;text;number;hex\n              test18.csv;CMkABfAGXvmSFV;9892576;jz40cbafbec8d6f92e93d22ea6ef5b'\n\n    json_data = CsvJsonCoverter.to_json(data_csv)\n\n    print json_data\n   \n```\n\n**The output looks like below**\n```\n    { \"file\": \"test18.csv\",\n      \"text\": \"CMkABfAGXvmSFV\",\n      \"number\": 9892576,\n      \"hex\": \"jz40cbafbec8d6f92e93d22ea6ef5b\"\n    }\n```\n### Json to csv\nIf you want to convert `json object`, to json you can use `to_csv` method from `CsvJsonConverter`. Let's see how:-\n\n\u003ci\u003eFor example \u003c/i\u003e\n```ruby\n\n    require 'csv_json_converter'\n\n    data_json={ \"file\": \"test18.csv\",\n      \"text\": \"CMkABfAGXvmSFV\",\n      \"number\": 9892576,\n      \"hex\": \"jz40cbafbec8d6f92e93d22ea6ef5b\"\n    }\n\n    csv_data = CsvJsonCoverter.to_csv(data_json)\n\n    print csv_data\n   \n```\n\n**The output looks like below**\n```\n    \"file,text,number,hex\\ntest18.csv,CMkABfAGXvmSFV,9892576,jz40cbafbec8d6f92e93d22ea6ef5b\"\n```\n## :busts_in_silhouette: Authors \u003ca name=\"authors\"\u003e\u003c/a\u003e\n :bust_in_silhouette: Pablo Zambrano\n- GitHub: [@alexoid1](https://github.com/melashu)\n- Twitter: [@pablo_acz](https://twitter.com/meshu102)\n- LinkedIn: [Pablo Alexis Zambrano](https://www.linkedin.com/in/alexzambranocoral/)\n## :handshake: Contributing \u003ca name=\"contributing\"\u003e\u003c/a\u003e\nThis repo is open for contributions. Issues, and feature requests are welcome!\nFeel free to check the [issues page.](https://github.com/melashu/csv_json_converter/issues)\n## :star:️ Show your support \u003ca name=\"support\"\u003e\u003c/a\u003e\nGive a star if you like this project!\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexoid1%2Fcsv_json_converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexoid1%2Fcsv_json_converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexoid1%2Fcsv_json_converter/lists"}