jupyter_on_rails 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/jupyter_on_rails.gemspec +3 -1
- data/lib/jupyter_on_rails/daru/data_frame_ext.rb +12 -0
- data/lib/jupyter_on_rails/railtie.rb +4 -0
- data/lib/jupyter_on_rails/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e6369cfa99c15261de10721130c486f17eb74b2cb1314ee12d9dcbd3cc05e56
|
4
|
+
data.tar.gz: 0fb2755e9c07b722653afa7f21bb22e0ea2696bcb6c5a4cc2ead1aa8979dc45b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 810b4806aeddac18ef4daca0af9d73686bfbc31bcdc39dd5c41ace0fa0ffb746828d5c366c142e52274a10aa68f3c4352766b809a2afddc042ac3bf1b59fac7f
|
7
|
+
data.tar.gz: d79f7edbcfb58449b58b7922d5adc22758d90648bd985e77ddae581e18d5e9da74bc27d7d216cf8067f8a8f3960ea1b9dc2c9c935b9f165c0b346504e481ef65
|
data/README.md
CHANGED
@@ -64,6 +64,15 @@ Eventually, you'll have jupyter opened, and the kernel being available.
|
|
64
64
|
User.to_df # => Daru::DataFrame is returned
|
65
65
|
```
|
66
66
|
|
67
|
+
### Daru::DataFrame#write_model
|
68
|
+
|
69
|
+
For each row, call `to_h` and pass it to `model.new`.
|
70
|
+
And then, imports them using `model.import`.
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
df.write_model(User)
|
74
|
+
```
|
75
|
+
|
67
76
|
## Development
|
68
77
|
|
69
78
|
This is a railtie gem, so you'd probably want to do something like:
|
data/jupyter_on_rails.gemspec
CHANGED
@@ -38,6 +38,8 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_development_dependency "bundler", "~> 1.17"
|
39
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
40
40
|
|
41
|
-
spec.add_dependency 'railties'
|
42
41
|
spec.add_dependency 'iruby'
|
42
|
+
spec.add_dependency 'railties'
|
43
|
+
|
44
|
+
spec.add_dependency 'activerecord-import'
|
43
45
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require_relative 'daru/active_record_ext'
|
2
|
+
require_relative 'daru/data_frame_ext'
|
2
3
|
|
3
4
|
module JupyterOnRails
|
4
5
|
class Railtie < ::Rails::Railtie
|
@@ -11,6 +12,9 @@ module JupyterOnRails
|
|
11
12
|
class ::ActiveRecord::Base
|
12
13
|
include ::JupyterOnRails::Daru::ActiveRecordExt
|
13
14
|
end
|
15
|
+
class ::Daru::DataFrame
|
16
|
+
include ::JupyterOnRails::Daru::DataFrameExt
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jupyter_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki INOUE
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: iruby
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: railties
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +67,7 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: activerecord-import
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ">="
|
@@ -84,6 +98,7 @@ files:
|
|
84
98
|
- lib/jupyter_on_rails.rb
|
85
99
|
- lib/jupyter_on_rails/boot.rb
|
86
100
|
- lib/jupyter_on_rails/daru/active_record_ext.rb
|
101
|
+
- lib/jupyter_on_rails/daru/data_frame_ext.rb
|
87
102
|
- lib/jupyter_on_rails/iruby_kernel_extention.rb
|
88
103
|
- lib/jupyter_on_rails/railtie.rb
|
89
104
|
- lib/jupyter_on_rails/railtie/jupyter.rake
|