{"id":15692255,"url":"https://github.com/yujideveloper/recite_csv","last_synced_at":"2025-07-18T10:08:54.773Z","repository":{"id":45035370,"uuid":"112456689","full_name":"yujideveloper/recite_csv","owner":"yujideveloper","description":"ReciteCSV assists to implement a class for csv reader.","archived":false,"fork":false,"pushed_at":"2023-12-25T08:59:25.000Z","size":87,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-26T15:22:57.144Z","etag":null,"topics":["csv","csv-reader","poro","ruby"],"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/yujideveloper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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":"2017-11-29T09:46:32.000Z","updated_at":"2024-06-11T06:48:39.523Z","dependencies_parsed_at":"2024-06-11T06:48:37.017Z","dependency_job_id":"ff0a29b9-1dee-462d-8728-783346216063","html_url":"https://github.com/yujideveloper/recite_csv","commit_stats":{"total_commits":88,"total_committers":2,"mean_commits":44.0,"dds":"0.011363636363636354","last_synced_commit":"91eb36c193f2db9047babe8f99c6bb47d03cc1f5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frecite_csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frecite_csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frecite_csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frecite_csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujideveloper","download_url":"https://codeload.github.com/yujideveloper/recite_csv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232548605,"owners_count":18540145,"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":["csv","csv-reader","poro","ruby"],"created_at":"2024-10-03T18:30:13.353Z","updated_at":"2025-01-05T04:55:12.491Z","avatar_url":"https://github.com/yujideveloper.png","language":"Ruby","readme":"# ReciteCSV\n\nReciteCSV assists to implement a class for CSV reader.  \nA reader class implemented by ReciteCSV iterate each row as PORO(Plain Old Ruby Object).\n\n[![Gem Version](https://badge.fury.io/rb/recite_csv.svg)](https://badge.fury.io/rb/recite_csv)\n[![Build](https://github.com/yujideveloper/recite_csv/actions/workflows/ruby.yml/badge.svg)](https://github.com/yujideveloper/recite_csv/actions/workflows/ruby.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/eb04cab6d55b0c7a1f7f/maintainability)](https://codeclimate.com/github/yujideveloper/recite_csv/maintainability)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'recite_csv'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install recite_csv\n\n## Usage\n\nThe following is a example csv file.\n\n``` csv\nCOL1,COL2\nVALUE1,VALUE2\nVALUE3,VALUE4\n```\n\nSpecify header definition using hash object.\n\n``` ruby\nclass Foo\n  include ReciteCSV::Reader::Builder.new(col1: \"COL1\", col2: \"COL2\")\nend\n\nFoo.new(\"./example.csv\").each do |row|\n  row.class # =\u003e Foo::Row\n  row.col1\n  row.col2\nend\n```\n\nSpecify header definition using array object.\n\n``` ruby\nclass Bar\n  include ReciteCSV::Reader::Builder.new(%w[col1 col2])\nend\n\nBar.new(\"./example.csv\").each do |row|\n  row.class # =\u003e Bar::Row\n  row.col1\n  row.col2\nend\n```\n\nDefine custom methods of row object.\n\n``` ruby\nclass Baz\n  include(\n    ReciteCSV::Reader::Builder.new(col1: \"COL1\", col2: \"COL2\") do\n      # define methods of Row class\n      def col1\n        \"override #{super}\"\n      end\n\n      def custom_method\n        # do somethings..\n      end\n    end\n  )\nend\n\nBaz.new(\"./example.csv\").each do |row|\n  row.class # =\u003e Baz::Row\n  row.col1\n  row.col2\n  row.custom_method\nend\n```\n\nDefine custom methods of row object using `row_methods`.\n\n``` ruby\nclass Qux\n  include ReciteCSV::Reader::Builder.new(col1: \"COL1\", col2: \"COL2\")\n\n  row_methods do\n    def col1\n      \"override #{super}\"\n    end\n\n    def custom_method\n      # do somethings..\n    end\n  end\nend\n\nQux.new(\"./example.csv\").each do |row|\n  row.class # =\u003e Qux::Row\n  row.col1\n  row.col2\n  row.custom_method\nend\n```\n\nSpecify file mode and encoding.\n\n``` ruby\nclass Quux\n  include ReciteCSV::Reader::Builder.new(col1: \"COL1\", col2: \"COL2\")\nend\n\nQuux.new(\"./example.csv\", file_options: \"rb:UTF-8\").each do |row|\n  # do something\nend\n```\n\nConvert encoding.\n\n``` ruby\nclass Corge\n  include ReciteCSV::Reader::Builder.new(col1: \"COL1\", col2: \"COL2\")\nend\n\nCorge.new(\"./example.csv\", file_options: [\"rb:Shift_JIS:UTF-8\", invalid: :replace, undef: :replace]).each do |row|\n  # do something\nend\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yujideveloper/recite_csv.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Frecite_csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujideveloper%2Frecite_csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Frecite_csv/lists"}