spreadsheet_stream_reader 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08ec0153a1bb700d633a0849ffa0cd1d01a9e3a5
4
- data.tar.gz: f2ac037707850c9d7c77c9898c641e3cab4c98aa
3
+ metadata.gz: 4645b2f23a11e836905f2d3d93aa797081a10498
4
+ data.tar.gz: 0408bb2f3731df578dead03a427d3ad8b54e04da
5
5
  SHA512:
6
- metadata.gz: 04bee6a44ca78c9b22d3ac0bf112ff990e5a94207e3e1cb79afebe0057d49ded25f5efc8425ddaefed937ca6d8af30b53820e532ebeb25217f44da47c5b8db84
7
- data.tar.gz: 359308722a9ad5b05dff8412301fb3df9e4eae91a514dc48cb8289e7219c81998d6c6f8c379f3a485540dd56179df1e7bab331ea029a3d315bf1c0bfa116d252
6
+ metadata.gz: 070deb75a3c3986701de43609dd34aecad083eecb37d0c94910c28f2791778f74a16a7c88ce7a1f7c3a93defa7e4ac7ede320410ae87b2b0caf7dad1d0468e30
7
+ data.tar.gz: cd699ac31811b634d1aa8eb1afca045262473b806d281961b378c1dc18c792bb2058d1a45e43c9b5d89c7834e6aa49def74927a5ad1991a8abc960f51c9f9635
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # SpreadsheetStreamReader
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/spreadsheet_stream_reader`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Memory efficient spreadsheet reader. It reads file in streaming fashion. Currently supports Excel legacy file (.xls) format. Work in progress for other file formats.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ You can configure the batch size. It will read and streams the batch size rows at a time.
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,50 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ #### Opening a spreadsheet
26
+
27
+ ```ruby
28
+ require 'spreadsheet_stream_reader'
29
+
30
+ records_per_batch = 100 #By default its 1000. You will get this much records at a time.
31
+
32
+ document = SpreadsheetStreamReader::Reader.new('/path/to/workbook.xls', records_per_batch)
33
+ ```
34
+
35
+ #### Working with sheets
36
+
37
+ ```ruby
38
+ # Returns an array of names of sheets present in the workbook
39
+ document.sheet_names
40
+ # => ["K-Sheet-1", "K-Sheet-22"]
41
+
42
+
43
+ ## Access the sheet
44
+ # By name
45
+ sheet1 = document.get_sheet('K-Sheet-1')
46
+ # By index
47
+ sheet2 = document.get_sheet(1)
48
+
49
+ # => Returns the SpreadsheetStreamReader::Sheet object
50
+ ```
51
+
52
+ #### Iterate through single sheet
53
+
54
+ ```ruby
55
+ sheet1.stream_rows_in_batch do |row|
56
+ puts row #Work with the row data
57
+ end
58
+ ```
59
+
60
+ #### Iterate through workbook (all sheets in workbook)
61
+
62
+ ```ruby
63
+ document.each_sheet do |sheet|
64
+ sheet.stream_rows_in_batch do |row|
65
+ puts row #Work with the row data
66
+ end
67
+ end
68
+ ```
26
69
 
27
70
  ## Development
28
71
 
@@ -32,7 +75,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
75
 
33
76
  ## Contributing
34
77
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/spreadsheet_stream_reader. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
78
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ketandoshi/spreadsheet-stream-reader. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
79
 
37
80
  ## License
38
81
 
@@ -40,4 +83,4 @@ The gem is available as open source under the terms of the [MIT License](http://
40
83
 
41
84
  ## Code of Conduct
42
85
 
43
- Everyone interacting in the SpreadsheetStreamReader project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/spreadsheet_stream_reader/blob/master/CODE_OF_CONDUCT.md).
86
+ Everyone interacting in the SpreadsheetStreamReader project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ketandoshi/spreadsheet-stream-reader/blob/master/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module SpreadsheetStreamReader
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadsheet_stream_reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ketan Doshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler