{"id":13878915,"url":"https://github.com/pythonicrubyist/creek","last_synced_at":"2025-07-16T14:33:24.306Z","repository":{"id":9058098,"uuid":"10825818","full_name":"pythonicrubyist/creek","owner":"pythonicrubyist","description":"Ruby library for parsing large Excel files.","archived":false,"fork":false,"pushed_at":"2024-03-18T21:29:02.000Z","size":444,"stargazers_count":395,"open_issues_count":12,"forks_count":115,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-01T23:05:32.084Z","etag":null,"topics":["excel","excelparser","excelreader","parsing","rails","ruby","xlsx","xlsx-parser","xlsxreader"],"latest_commit_sha":null,"homepage":"http://rubygems.org/gems/creek","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/pythonicrubyist.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-06-20T17:49:49.000Z","updated_at":"2025-03-31T23:29:37.000Z","dependencies_parsed_at":"2024-01-13T20:55:03.759Z","dependency_job_id":"5f4207c9-2130-4ef5-b0d2-ec0f049aab53","html_url":"https://github.com/pythonicrubyist/creek","commit_stats":{"total_commits":110,"total_committers":40,"mean_commits":2.75,"dds":0.7363636363636363,"last_synced_commit":"2172e0059648cdb5e694d50ebc9160586a974640"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pythonicrubyist/creek","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonicrubyist%2Fcreek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonicrubyist%2Fcreek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonicrubyist%2Fcreek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonicrubyist%2Fcreek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythonicrubyist","download_url":"https://codeload.github.com/pythonicrubyist/creek/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonicrubyist%2Fcreek/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265518475,"owners_count":23780967,"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":["excel","excelparser","excelreader","parsing","rails","ruby","xlsx","xlsx-parser","xlsxreader"],"created_at":"2024-08-06T08:02:04.133Z","updated_at":"2025-07-16T14:33:23.829Z","avatar_url":"https://github.com/pythonicrubyist.png","language":"Ruby","readme":"[![version](https://badge.fury.io/rb/creek.svg)](https://badge.fury.io/rb/creek)\n[![downloads](https://img.shields.io/gem/dt/creek)](https://rubygems.org/gems/creek)\n\n# Creek - Stream parser for large Excel (xlsx and xlsm) files.\n\nCreek is a Ruby gem that provides a fast, simple and efficient method of parsing large Excel (xlsx and xlsm) files.\n\n\n## Installation\n\nCreek can be used from the command line or as part of a Ruby web framework. To install the gem using terminal, run the following command:\n\n```\ngem install creek\n```\n\nTo use it in Rails, add this line to your Gemfile:\n\n```ruby\ngem 'creek'\n```\n\n## Basic Usage\nCreek can simply parse an Excel file by looping through the rows enumerator:\n\n```ruby\nrequire 'creek'\ncreek = Creek::Book.new 'spec/fixtures/sample.xlsx'\nsheet = creek.sheets[0]\n\nsheet.rows.each do |row|\n  puts row # =\u003e {\"A1\"=\u003e\"Content 1\", \"B1\"=\u003enil, \"C1\"=\u003enil, \"D1\"=\u003e\"Content 3\"}\nend\n\nsheet.simple_rows.each do |row|\n  puts row # =\u003e {\"A\"=\u003e\"Content 1\", \"B\"=\u003enil, \"C\"=\u003enil, \"D\"=\u003e\"Content 3\"}\nend\n\nsheet.rows_with_meta_data.each do |row|\n  puts row # =\u003e {\"collapsed\"=\u003e\"false\", \"customFormat\"=\u003e\"false\", \"customHeight\"=\u003e\"true\", \"hidden\"=\u003e\"false\", \"ht\"=\u003e\"12.1\", \"outlineLevel\"=\u003e\"0\", \"r\"=\u003e\"1\", \"cells\"=\u003e{\"A1\"=\u003e\"Content 1\", \"B1\"=\u003enil, \"C1\"=\u003enil, \"D1\"=\u003e\"Content 3\"}}\nend\n\nsheet.simple_rows_with_meta_data.each do |row|\n  puts row # =\u003e {\"collapsed\"=\u003e\"false\", \"customFormat\"=\u003e\"false\", \"customHeight\"=\u003e\"true\", \"hidden\"=\u003e\"false\", \"ht\"=\u003e\"12.1\", \"outlineLevel\"=\u003e\"0\", \"r\"=\u003e\"1\", \"cells\"=\u003e{\"A\"=\u003e\"Content 1\", \"B\"=\u003enil, \"C\"=\u003enil, \"D\"=\u003e\"Content 3\"}}\nend\n\nsheet.state   # =\u003e 'visible'\nsheet.name    # =\u003e 'Sheet1'\nsheet.rid     # =\u003e 'rId2'\n```\n\n## Filename considerations\nBy default, Creek will ensure that the file extension is either *.xlsx or *.xlsm, but this check can be circumvented as needed:\n\n```ruby\npath = 'sample-as-zip.zip'\nCreek::Book.new path, :check_file_extension =\u003e false\n```\n\nBy default, the Rails [file_field_tag](http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-file_field_tag) uploads to a temporary location and stores the original filename with the StringIO object. (See [this section](http://guides.rubyonrails.org/form_helpers.html#uploading-files) of the Rails Guides for more information.)\n\nCreek can parse this directly without the need for file upload gems such as Carrierwave or Paperclip by passing the original filename as an option:\n\n```ruby\n# Import endpoint in Rails controller\ndef import\n  file = params[:file]\n  Creek::Book.new file.path, check_file_extension: false\nend\n```\n\n## Parsing images\nCreek does not parse images by default. If you want to parse the images,\nuse `with_images` method before iterating over rows to preload images information. If you don't call this method, Creek will not return images anywhere.\n\nCells with images will be an array of Pathname objects.\nIf an image is spread across multiple cells, same Pathname object will be returned for each cell.\n\n```ruby\nsheet.with_images.rows.each do |row|\n  puts row # =\u003e {\"A1\"=\u003e[#\u003cPathname:/var/folders/ck/l64nmm3d4k75pvxr03ndk1tm0000gn/T/creek__drawing20161101-53599-274q0vimage1.jpeg\u003e], \"B2\"=\u003e\"Fluffy\"}\nend\n```\n\nImages for a specific cell can be obtained with images_at method:\n\n```ruby\nputs sheet.images_at('A1') # =\u003e [#\u003cPathname:/var/folders/ck/l64nmm3d4k75pvxr03ndk1tm0000gn/T/creek__drawing20161101-53599-274q0vimage1.jpeg\u003e]\n\n# no images in a cell\nputs sheet.images_at('C1') # =\u003e nil\n```\n\nCreek will most likely return nil for a cell with images if there is no other text cell in that row - you can use *images_at* method for retrieving images in that cell.\n\n## Remote files\n\n```ruby\nremote_url = 'http://dev-builds.libreoffice.org/tmp/test.xlsx'\nCreek::Book.new remote_url, remote: true\n```\n\n## Mapping cells with header names\nBy default, Creek will map cell names with letter and number(A1, B3 and etc). To be able to get cell values by header column name use ***with_headers*** (can be used only with ***#simple_rows*** method!!!) during creation *(Note: header column is first string of sheet)*\n\n```ruby\ncreek = Creek::Book.new file.path, with_headers: true\n```\n\n\n## Contributing\n\nContributions are welcomed. You can fork a repository, add your code changes to the forked branch, ensure all existing unit tests pass, create new unit tests which cover your new changes and finally create a pull request.\n\nAfter forking and then cloning the repository locally, install the Bundler and then use it\nto install the development gem dependencies:\n\n```\ngem install bundler\nbundle install\n```\n\nOnce this is complete, you should be able to run the test suite:\n\n```\nrake\n```\n\nThere are some remote tests that are excluded by default. To run those, run\n\n```\nbundle exec rspec --tag remote\n```\n\n## Bug Reporting\n\nPlease use the [Issues](https://github.com/pythonicrubyist/creek/issues) page to report bugs or suggest new enhancements.\n\n\n## License\n\nCreek has been published under [MIT License](https://github.com/pythonicrubyist/creek/blob/master/LICENSE.txt)\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicrubyist%2Fcreek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonicrubyist%2Fcreek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicrubyist%2Fcreek/lists"}