creeker 2.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -2
- data/lib/creeker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4d420c04fe635845353edf92b12ec3afe810b4
|
4
|
+
data.tar.gz: d14f45bbdfc6b13eddb97d020569e63ae5f5d8dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc80c89452bb6f35e02e3fda5b6bc97352ea8a138cc50351ecbda7f9bda8adc511c6b106d463c5b814c998976571306873c0e25b4837abf30a8bcc707cd556ff
|
7
|
+
data.tar.gz: 0a9e4f3cfe8ced82516bad82534c5e7bb216d9b342526967652ea0a04745b61e6d631a50270648b9d4daaf60dcd67b35540291638db6e059089dc79be058a2bf
|
data/README.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Creeker - Stream parser for large Excel (xlsx and xlsm) files.
|
2
2
|
|
3
|
-
Creeker is a Ruby gem that provides a fast, simple and efficient method of parsing large Excel (xlsx and xlsm) files.
|
3
|
+
Based on Creek gem, Creeker is a Ruby gem that provides a fast, simple and efficient method of parsing large Excel (xlsx and xlsm) files.
|
4
|
+
|
5
|
+
Here we solve the issue of heavy RAM and memory usage, using multi-threading and Garbage collection.
|
6
|
+
|
7
|
+
```
|
8
|
+
BENCHMARKS:
|
9
|
+
|
10
|
+
Parsing 150,000 rows of excel:
|
11
|
+
|
12
|
+
Creek gem: 98~99.5% CPU usage
|
13
|
+
Creeker gem: 23~24.5% CPU usage
|
14
|
+
```
|
4
15
|
|
5
16
|
|
6
17
|
## Installation
|
@@ -20,10 +31,18 @@ gem 'creeker'
|
|
20
31
|
## Basic Usage
|
21
32
|
Creeker can simply parse an Excel file by looping through the rows enumerator:
|
22
33
|
|
34
|
+
To get the headers
|
23
35
|
```ruby
|
24
|
-
require 'creeker'
|
25
36
|
creeker = Creeker::Book.new 'spec/fixtures/sample.xlsx'
|
26
37
|
sheet = creeker.sheets[0]
|
38
|
+
headers = sheet.rows.first.values
|
39
|
+
```
|
40
|
+
|
41
|
+
To parse whole file, we recommend using multi-threading and garbage collections as follows:
|
42
|
+
```ruby
|
43
|
+
require 'creeker'
|
44
|
+
creeker = Creeker::Book.new 'spec/fixtures/sample.xlsx', multi_thread: true
|
45
|
+
sheet = creeker.sheets[0]
|
27
46
|
|
28
47
|
sheet.rows.each do |row|
|
29
48
|
puts row # => {"A1"=>"Content 1", "B1"=>nil, C1"=>nil, "D1"=>"Content 3"}
|
data/lib/creeker/version.rb
CHANGED