data_science_theater_3000 1.0.1 → 1.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -3
- data/lib/data_science_theater_3000/version.rb +1 -1
- metadata +15 -15
data/README.md
CHANGED
@@ -15,14 +15,33 @@ Ruby API wrapper for the [Data Science Toolkit](http://www.datasciencetoolkit.or
|
|
15
15
|
#### Just ...
|
16
16
|
require "data_science_theater_3000"
|
17
17
|
|
18
|
-
request = DataScienceTheater3000::Ip2Coordinates.new('8.8.8.8')
|
18
|
+
request = DataScienceTheater3000::Ip2Coordinates.new( '8.8.8.8' )
|
19
19
|
> #<DataScienceTheater3000::Ip2Coordinates:0x000000019c7f60 @ip="8.8.8.8">
|
20
20
|
request.result
|
21
21
|
> {"8.8.8.8"=>{"longitude"=>-122.057403564453, "country_name"=>"United States", "postal_code"=>"94043", "region"=>"CA", "locality"=>"Mountain View", "country_code"=>"US", "dma_code"=>807, "latitude"=>37.4192008972168, "country_code3"=>"USA", "area_code"=>650}}
|
22
22
|
|
23
|
+
#### This is also fun ... pass street/ip2coordinates output to coordinates2politics
|
24
|
+
locations_request = DataScienceTheater3000::Ip2Coordinates.new( ["8.8.8.8", "74.125.224.72"] )
|
25
|
+
> #<DataScienceTheater3000::Ip2Coordinates:0x000000026b17f8 @ip="[\"8.8.8.8\",\"74.125.224.72\"]">
|
26
|
+
|
27
|
+
locations = locations_request.result
|
28
|
+
> {"8.8.8.8"=>{ ... ... ... }, "74.125.224.72"=>{ ... ... ... }}
|
29
|
+
|
30
|
+
politics_request = DataScienceTheater3000::Coordinates2Politics.new( locations )
|
31
|
+
> #<DataScienceTheater3000::Coordinates2Politics:0x00000002ba6470 @coordinates="[[\"37.4192008972168\",\"-122.057403564453\"],[\"37.4192008972168\",\"-122.057403564453\"]]">
|
32
|
+
|
33
|
+
politics = politics_request.result
|
34
|
+
> [{"politics"=>[{"type"=>"admin2", "code"=>"usa", "name"=>"United States", "friendly_type"=>"country"}, {"type"=>"admin4", "code"=>"us06", "name"=>"California", "friendly_type"=>"state"}, {"type"=>"constituency", "code"=>"06_14", "name"=>"Fourteenth district, CA", "friendly_type"=>"constituency"}, {"type"=>"admin5", "code"=>"06_49670", "name"=>"Mountain View", "friendly_type"=>"city"}, {"type"=>"admin5", "code"=>"_", "name"=>"", "friendly_type"=>"city"}, {"type"=>"admin6", "code"=>"06_085", "name"=>"Santa Clara", "friendly_type"=>"county"}, {"type"=>"admin5", "code"=>"06_77000", "name"=>"Sunnyvale", "friendly_type"=>"city"}], "location"=>{"longitude"=>"-122.057403564453", "latitude"=>"37.4192008972168"}}, {"politics"=>[{"type"=>"admin2", "code"=>"usa", "name"=>"United States", "friendly_type"=>"country"}, {"type"=>"admin4", "code"=>"us06", "name"=>"California", "friendly_type"=>"state"}, {"type"=>"constituency", "code"=>"06_14", "name"=>"Fourteenth district, CA", "friendly_type"=>"constituency"}, {"type"=>"admin5", "code"=>"06_49670", "name"=>"Mountain View", "friendly_type"=>"city"}, {"type"=>"admin5", "code"=>"_", "name"=>"", "friendly_type"=>"city"}, {"type"=>"admin6", "code"=>"06_085", "name"=>"Santa Clara", "friendly_type"=>"county"}, {"type"=>"admin5", "code"=>"06_77000", "name"=>"Sunnyvale", "friendly_type"=>"city"}], "location"=>{"longitude"=>"-122.057403564453", "latitude"=>"37.4192008972168"}}]
|
35
|
+
|
36
|
+
#### Try out the File2Text feature:
|
37
|
+
request = DataScienceTheater3000::File2Text.new("doc/sample.png")
|
38
|
+
> #<DataScienceTheater3000::File2Text:0x000000025da370 @file_path="doc/sample.png">
|
39
|
+
request.result
|
40
|
+
> "lf you pass in an image, this API will run an optical character recoghition algorithm to extract any words or\nsentences it can from the picture. lf you upload a PDF file, Word document, Excel spreadsheet or HTML file, it\nwill retum a plain text version of the content. Unlike most of the calls, this one takes its input in the standard\nmultipart form-encoded format that\xE2\x80\x99s used when browsers upload files, rather than as JSON. lt retums any content\nit finds as a stream of text.\n"
|
41
|
+
|
23
42
|
|
24
43
|
## Contributing
|
25
44
|
|
26
|
-
We love contributions! please fork the project, make your changes in a branch, then send us a pull request.
|
45
|
+
We love contributions! please fork the project, make your changes in a feature branch, then send us a pull request.
|
27
46
|
|
28
|
-
If you find a bug, please post it in the GitHub Issue Tracker
|
47
|
+
If you find a bug, please post it in the GitHub Issue Tracker.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_science_theater_3000
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1
|
4
|
+
version: 1.0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2012-01-29 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_support
|
17
|
-
requirement: &
|
17
|
+
requirement: &6139020 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *6139020
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: curb
|
28
|
-
requirement: &
|
28
|
+
requirement: &6137940 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *6137940
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: json
|
39
|
-
requirement: &
|
39
|
+
requirement: &6136860 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *6136860
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rake
|
50
|
-
requirement: &
|
50
|
+
requirement: &6135940 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *6135940
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: minitest
|
61
|
-
requirement: &
|
61
|
+
requirement: &6135400 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *6135400
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: webmock
|
72
|
-
requirement: &
|
72
|
+
requirement: &6134580 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *6134580
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: ruby-debug19
|
83
|
-
requirement: &
|
83
|
+
requirement: &6129840 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
version: '0'
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *6129840
|
92
92
|
description: Ruby interface to issue Data Science Toolkit API calls.
|
93
93
|
email:
|
94
94
|
- tad@isotope11.com
|