quandl 0.4.4 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +5 -13
  2. data/README.md +133 -318
  3. data/lib/quandl.rb +27 -0
  4. data/lib/quandl/api_config.rb +33 -0
  5. data/lib/quandl/connection.rb +75 -0
  6. data/lib/quandl/errors/quandl_error.rb +56 -0
  7. data/lib/quandl/model/base.rb +31 -0
  8. data/lib/quandl/model/data.rb +32 -0
  9. data/lib/quandl/model/database.rb +62 -0
  10. data/lib/quandl/model/dataset.rb +24 -0
  11. data/lib/quandl/model/list.rb +45 -0
  12. data/lib/quandl/operations/base.rb +17 -0
  13. data/lib/quandl/operations/get.rb +21 -0
  14. data/lib/quandl/operations/list.rb +23 -0
  15. data/lib/quandl/util.rb +35 -0
  16. data/lib/quandl/version.rb +3 -0
  17. metadata +78 -319
  18. data/.gitignore +0 -16
  19. data/.travis.yml +0 -20
  20. data/Gemfile +0 -14
  21. data/Guardfile +0 -8
  22. data/LICENSE +0 -7
  23. data/Rakefile +0 -27
  24. data/UPGRADE.md +0 -262
  25. data/VERSION +0 -1
  26. data/bin/quandl +0 -25
  27. data/config/locales/en.yml +0 -26
  28. data/dist/resources/pkg/Distribution.erb +0 -15
  29. data/dist/resources/pkg/PackageInfo.erb +0 -6
  30. data/dist/resources/pkg/postinstall.erb +0 -47
  31. data/dist/resources/pkg/quandl +0 -25
  32. data/dist/resources/ruby/PackageInfo +0 -3
  33. data/dist/resources/windows/quandl +0 -25
  34. data/lib/commander/command/quandl_ext.rb +0 -21
  35. data/lib/quandl/command.rb +0 -47
  36. data/lib/quandl/command/client.rb +0 -0
  37. data/lib/quandl/command/client_ext.rb +0 -1
  38. data/lib/quandl/command/client_ext/user.rb +0 -11
  39. data/lib/quandl/command/compatibility_check.rb +0 -11
  40. data/lib/quandl/command/config.rb +0 -92
  41. data/lib/quandl/command/presenter.rb +0 -75
  42. data/lib/quandl/command/presenter/helper.rb +0 -19
  43. data/lib/quandl/command/presenter/record.rb +0 -113
  44. data/lib/quandl/command/presenters/dataset_presenter.rb +0 -19
  45. data/lib/quandl/command/presenters/error_presenter.rb +0 -31
  46. data/lib/quandl/command/presenters/nil_class_presenter.rb +0 -10
  47. data/lib/quandl/command/presenters/scraper_presenter.rb +0 -25
  48. data/lib/quandl/command/presenters/superset_presenter.rb +0 -10
  49. data/lib/quandl/command/task.rb +0 -44
  50. data/lib/quandl/command/task/callbacks.rb +0 -28
  51. data/lib/quandl/command/task/clientable.rb +0 -51
  52. data/lib/quandl/command/task/commandable.rb +0 -103
  53. data/lib/quandl/command/task/configurable.rb +0 -80
  54. data/lib/quandl/command/task/dependable.rb +0 -71
  55. data/lib/quandl/command/task/inputable.rb +0 -37
  56. data/lib/quandl/command/task/logging.rb +0 -83
  57. data/lib/quandl/command/task/presentation.rb +0 -36
  58. data/lib/quandl/command/task/reportable.rb +0 -35
  59. data/lib/quandl/command/task/threading.rb +0 -123
  60. data/lib/quandl/command/task/translations.rb +0 -37
  61. data/lib/quandl/command/task/updatable.rb +0 -80
  62. data/lib/quandl/command/task/validations.rb +0 -25
  63. data/lib/quandl/command/tasks.rb +0 -24
  64. data/lib/quandl/command/tasks/delete.rb +0 -34
  65. data/lib/quandl/command/tasks/download.rb +0 -44
  66. data/lib/quandl/command/tasks/info.rb +0 -48
  67. data/lib/quandl/command/tasks/list.rb +0 -31
  68. data/lib/quandl/command/tasks/login.rb +0 -47
  69. data/lib/quandl/command/tasks/replace.rb +0 -58
  70. data/lib/quandl/command/tasks/schedule.rb +0 -211
  71. data/lib/quandl/command/tasks/search.rb +0 -39
  72. data/lib/quandl/command/tasks/superset.rb +0 -66
  73. data/lib/quandl/command/tasks/uninstall.rb +0 -17
  74. data/lib/quandl/command/tasks/update.rb +0 -249
  75. data/lib/quandl/command/tasks/upload.rb +0 -60
  76. data/lib/quandl/command/version.rb +0 -5
  77. data/lib/quandl/lang.rb +0 -45
  78. data/lib/quandl/utility.rb +0 -2
  79. data/lib/quandl/utility/config.rb +0 -43
  80. data/lib/quandl/utility/ruby_version.rb +0 -143
  81. data/quandl.gemspec +0 -43
  82. data/scripts/compile_ruby_pkg.sh +0 -34
  83. data/scripts/install.sh +0 -51
  84. data/scripts/win/quandl_toolbelt.iss +0 -89
  85. data/spec/config/output.rb +0 -21
  86. data/spec/config/quandl.rb +0 -67
  87. data/spec/factories/dataset.rb +0 -10
  88. data/spec/factories/source.rb +0 -10
  89. data/spec/fixtures/scraper-test-file.rb +0 -6
  90. data/spec/lib/quandl/command/delete_spec.rb +0 -45
  91. data/spec/lib/quandl/command/download_spec.rb +0 -49
  92. data/spec/lib/quandl/command/replace_spec.rb +0 -22
  93. data/spec/lib/quandl/command/schedule_spec.rb +0 -45
  94. data/spec/lib/quandl/command/superset_spec.rb +0 -28
  95. data/spec/lib/quandl/command/upload_spec.rb +0 -86
  96. data/spec/lib/quandl/command_spec.rb +0 -38
  97. data/spec/spec_helper.rb +0 -43
  98. data/tasks/toolbelt.rake +0 -138
  99. data/tasks/toolbelt.rb +0 -116
  100. data/tasks/toolbelt/build.rb +0 -2
  101. data/tasks/toolbelt/build/darwin.rb +0 -118
  102. data/tasks/toolbelt/build/ruby.rb +0 -105
  103. data/tasks/toolbelt/build/tarball.rb +0 -79
  104. data/tasks/toolbelt/build/windows.rb +0 -25
  105. data/tasks/toolbelt/push.rb +0 -18
  106. data/tasks/toolbelt/storage.rb +0 -28
  107. data/tasks/toolbelt/tar.rb +0 -21
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- /Gemfile.lock
2
- /.idea
3
- /pkg
4
- /tmp
5
- quandl_client-*
6
- .rvmrc
7
- *.gem
8
- *.log
9
- *.qdf
10
- data/*
11
- *.DS_Store
12
- vendor/*
13
- build/*
14
- playground/*
15
- update/*
16
- .bundle
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.9.2
7
- - 1.8.7
8
-
9
- gemfile:
10
- - Gemfile
11
- - gemfiles/activemodel-4.0.gemfile
12
-
13
- matrix:
14
- exclude:
15
- - rvm: 1.8.7
16
- gemfile: gemfiles/activemodel-4.0.gemfile
17
- - rvm: 1.9.2
18
- gemfile: gemfiles/activemodel-4.0.gemfile
19
-
20
- script: "echo 'COME ON!' && bundle exec rake spec"
data/Gemfile DELETED
@@ -1,14 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
3
-
4
- use_local_gems = ENV['BUNDLE_LOCAL_GEMS'] == "true" && ENV['BUNDLE_LOCAL_DIR']
5
- local_gem_dir = ENV['BUNDLE_LOCAL_DIR']
6
-
7
- if use_local_gems
8
- gem 'quandl_format', path: "#{local_gem_dir}/quandl/format"
9
- gem 'quandl_client', path: "#{local_gem_dir}/quandl/client"
10
- gem 'quandl_data', path: "#{local_gem_dir}/quandl/data"
11
- gem 'quandl_babelfish', path: "#{local_gem_dir}/quandl/babelfish"
12
- gem 'quandl_operation', path: "#{local_gem_dir}/quandl/operation"
13
- gem 'quandl_logger', path: "#{local_gem_dir}/quandl/logger"
14
- end
data/Guardfile DELETED
@@ -1,8 +0,0 @@
1
- group :specs do
2
- guard :rspec, cmd: 'bundle exec rspec --fail-fast -f doc --color' do
3
- watch(%r{^spec/.+_spec\.rb$})
4
- watch(%r{^(lib/.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
5
- watch('spec/spec_helper.rb') { 'spec' }
6
- end
7
- end
8
-
data/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2012-2013 Blake Hilscher
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,27 +0,0 @@
1
- require "bundler"
2
- require "rake"
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
- require 'quandl/command'
6
- require 'pry'
7
-
8
- task :default => :spec
9
-
10
- Dir[File.expand_path("../tasks/*.rake", __FILE__)].each do |task|
11
- puts task
12
- load task
13
- end
14
-
15
- desc "Run all specs"
16
- RSpec::Core::RakeTask.new(:spec) do |task|
17
- task.pattern = "spec/**/*_spec.rb"
18
- end
19
-
20
- require 'quandl/utility/rake_tasks'
21
- Quandl::Utility::Tasks.configure do |c|
22
- c.name = 'quandl'
23
- c.version_path = 'VERSION'
24
- c.changelog_path = 'UPGRADE.md'
25
- c.tag_prefix = 'v'
26
- c.changelog_matching = ['^QUGC','^WIKI']
27
- end
data/UPGRADE.md DELETED
@@ -1,262 +0,0 @@
1
- ## 0.4.4
2
-
3
- * add dataset.access
4
-
5
-
6
-
7
- ## 0.4.3
8
-
9
-
10
-
11
-
12
-
13
- ## 0.4.2
14
-
15
- * fix threading issue with silently failing threads
16
-
17
-
18
-
19
- ## 0.4.1
20
-
21
- * added schedule run (now) feature
22
-
23
-
24
-
25
- ## 0.4.0
26
-
27
- * QUGC-166 fix quandl schedule list --token incorrect_token
28
- * QUGC-182. OK -> Updated
29
- * QUGC-164 fixes the issue
30
-
31
-
32
-
33
- ## 0.3.7
34
-
35
- * add production flag
36
-
37
-
38
-
39
- ## 0.3.6
40
-
41
-
42
-
43
-
44
-
45
- ## 0.3.4
46
-
47
- * QUGC-154 disable
48
-
49
-
50
-
51
- ## 0.3.3
52
-
53
-
54
-
55
-
56
-
57
- ## 0.3.2
58
-
59
- * QUGC-151 quandl superset upload --> quandl superset
60
- * QUGC-140 if a source_code is given but does not exist, it should warn the user
61
-
62
-
63
-
64
-
65
- ## 0.3.1
66
- * Added support for timed scheduling
67
-
68
- ## 0.3.0
69
-
70
- * QUGC-132 Add thread_pool locking so that requests for the same dataset are not made in parallel
71
- * QUGC-120 update Task::Threading to catch SIGINT and shutdown thread_pool. Second occurence of SIGINT will exit immediately.
72
- * QUGC-117 add option for specifying logfile output --stdout and --stderr
73
- * QUGC-118 add option to specify environment -E --environment
74
- * QUGC-119 only use thread pool when needed
75
- * QUGC-119 given 1 thread skip using thread pool so that we can debug more easily, but leave threadpool implemented otherwise
76
- * QUGC-55 POST crash input back to us. Quandl Toolbelt has crashed. Can we please send the crash report back to Quandl.com?
77
- * QUGC-113 bump client for error propagation
78
- * QUGC-109 load task modules into Task
79
- * QUGC-109 refactor quandl/command/task.rb into modules
80
- * QUGC-89 quandl list inherits from quandl search and implements the same paging behaviour.
81
- * QUGC-89 quandl search will return an unlimited number of results.
82
- * QUGC-99 Add 'quandl search' to Toolbelt
83
- * QUGC-104 bump gems to fix when upload fails output is not json
84
- * QUGC-98 Add basic presenter classes
85
- * QUGC-95 rename ruby package identifier to avoid clobbering other ruby packages
86
- * WIKI-153 bump quandl_client to 2.5.2 for scraper models
87
- * WIKI-153 Add schedule task with subtasks: add, delete, replace, list, show
88
-
89
-
90
-
91
- ## 0.2.27
92
-
93
- * add option to force update
94
-
95
-
96
- ## 0.2.26
97
-
98
- * QUGC-90 fix quandl login barfs on linux
99
- * QUGC-96 fix toolbelt failing to run due to missing config
100
- * QUGC-95 rename ruby package identifier to avoid clobbering other ruby packages
101
-
102
-
103
-
104
- ## 0.2.25
105
-
106
- * info outputs install path when given verbose
107
-
108
-
109
-
110
- ## 0.2.24
111
-
112
- * QUGC-87 quandl update, quandl uninstall need to be disabled unless installed through a package
113
- * QUGC-86 rake quandl:release will only create releases from master
114
- * QUGC-86 add rake quandl:release that: Generate documentation, bump version, build and push distros
115
- * QUGC-86 added: rake quandl:document:release
116
- * QUGC-84 rename quandl_command to quandl
117
-
118
-
119
-
120
- ## 0.2.22
121
-
122
- * update permits adding new folders
123
-
124
-
125
-
126
- ## 0.2.21
127
-
128
- * QUGC-75 darwin build process will compile ruby if its missing
129
- * QUGC-71 Add failing spec for "quandl list not working v 20"
130
- * QUGC-65 Check for updates once every 24 hour period
131
- * QUGC-65 Add QConfig that stores configuration information in ~/.quandl/config
132
- * QUGC-60 add compatibility check
133
-
134
-
135
- ## 0.2.20
136
-
137
- * QUGC-57 move data validation from Quandl::Format into Quandl::Client.
138
- * QUGC-54 write failing spec for input with nil row value
139
- * QUGC-53 numeric codes require the full code
140
-
141
-
142
- ## 0.2.19
143
-
144
- * many bugfixes
145
-
146
-
147
- ## 0.2.18
148
-
149
- * QUGC-49 Revise installer to use bash shell for [[ bashism
150
- * QUGC-48 rename to toolbelt
151
- * uniform table stdout for consistent parsing
152
- * dont export bin/quandl as an executable. If you want to use quandl cli install the package
153
-
154
-
155
- ## 0.2.17
156
-
157
- * QUGC-42 Write failing specs for should not have to include data
158
- * QUGC-45 quandl info package versions are sent to debug instead of info. remove user id
159
- * QUGC-44 quandl delete should delete the datasets or raise an error
160
- * QUGC-44 Write failing spec that checks whether delete has succeeeded.
161
- * rake package:release takes an argument for building pre releases
162
- * quandl update has an option called --revision
163
-
164
-
165
- ## 0.2.16
166
-
167
- * Add quandl update
168
-
169
-
170
- ## 0.2.15
171
-
172
- * QUGC-37 quandl info: report my username not just my token
173
- * QUGC-37 reject unauthenticated requests
174
- * QUGC-39 Download. added validation for trim_start, trim_end, order, collapse, transform.
175
-
176
-
177
- ## 0.2.14
178
-
179
- * QUGC-38 Add spec for download with column option failing
180
-
181
-
182
- ## 0.2.13
183
-
184
- * QUGC-36 Should except null entry in 2 column dataset
185
- * QUGC-35 Pure Meta Data Send or Update
186
-
187
-
188
- ## 0.2.12
189
-
190
- * add quandl list
191
-
192
-
193
- ## 0.2.10
194
-
195
- * add specific version requirements
196
- * add info command for displaying quandl package information
197
-
198
-
199
- ## 0.2.9
200
-
201
- * replace full_code regexp with Quandl::Pattern
202
- * remove --url global option
203
- * add validations
204
- * update token env var
205
- * add shortcuts to global options
206
-
207
-
208
- ## 0.2.8
209
-
210
- * use updated Quandl::Format::Dataset.each_line to upload dataset's line by line as they become availabe from whichever interface. Allows ruby GC to operate and avoid having 20k datasets in memory ...
211
-
212
-
213
- ## 0.2.7
214
-
215
- * refactor delete, download, upload
216
- * add convience methods for outputting info
217
- * remove command logger
218
-
219
-
220
- ## 0.2.6
221
-
222
- * add quandl delete quandl delete (SOURCE_CODE/)CODE
223
- * dont try to load from STDIN if file_path was provided.
224
-
225
-
226
- ## 0.2.4
227
-
228
- * refactor authorize to: quandl login login accepts username or email and password login outputs error or auth_token to ~/.quandl
229
-
230
-
231
- ## 0.2.0
232
-
233
- * update gemspec to only require quandl_format
234
- * use Quandl::Commmand::Logger to log messages
235
- * update local gems
236
- * add Quandl::Command::Logger that writes to STDOUT and STDERR
237
- * display dataset.human_errors
238
- * refactor Action#upload into Command::Upload
239
- * refactor download to inherit from Action::Base
240
- * refactor action into Quandl::Command::Download
241
- * add options to download. extend Commander::Command::Options to support #each, #to_a, #[], #to_h
242
-
243
-
244
- ## 0.1.2
245
-
246
- * use quandl_format instead of QDFormat
247
-
248
- ## 0.1.1
249
-
250
- * bump quandl_operation to support revised QDFormat
251
- * refactor examples
252
- * improve log messages
253
-
254
-
255
- ## 0.1.0
256
-
257
- * refactor commands to be more human friendly
258
-
259
-
260
- ## 0.0.1
261
-
262
- * init
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.4
data/bin/quandl DELETED
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
- require "pathname"
4
- bin_file = Pathname.new(__FILE__).realpath
5
-
6
- # vendored gems path
7
- gem_dir = File.expand_path("../../vendor/gems", bin_file)
8
- # vendored gems?
9
- if Dir.exists?(gem_dir)
10
- Dir["#{gem_dir}/**/lib"].each do |libdir|
11
- $:.unshift libdir
12
- end
13
- else
14
- require 'rubygems'
15
- end
16
-
17
- # add self to libpath
18
- $:.unshift File.expand_path("../../lib", bin_file)
19
-
20
- require 'quandl/command/compatibility_check'
21
- require 'quandl/command'
22
- require 'commander/import'
23
- require 'commander/command/quandl_ext'
24
-
25
- include Quandl::Command
@@ -1,26 +0,0 @@
1
- quandl:
2
- command:
3
- tasks:
4
- delete:
5
- options:
6
- threads: "How many workers to use during delete."
7
-
8
- download:
9
- options:
10
- order: "Return rows in either ASC or DESC order"
11
- transform: "Transform data using one of: diff, rdiff, cumul, normalize, rdiff_from"
12
- collapse: "Collapse data to one of: daily, weekly, monthly, quarterly, annual"
13
- trim_start: "Exclude rows that are older than trim_start"
14
- trim_end: "Exclude rows that are newer than trim_end"
15
- threads: "How many workers to use during download."
16
- limit: "Limit the number of rows returned"
17
- column: "Pluck a specific column by index"
18
- row: "Pluck a specific row by index"
19
- offset: "Offset the start of the rows"
20
-
21
- validations:
22
- trim_start: "is invalid. Expected format: yyyy-mm-dd"
23
- trim_end: "is invalid. Expected format: yyyy-mm-dd"
24
- order: "must be one of: asc, desc"
25
- collapse: "must be one of: daily, weekly, monthly, quarterly, annual"
26
- transform: "must be one of: diff, rdiff, cumul, normalize, rdiff_from"
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <installer-script minSpecVersion="1.000000" authoringTool="org.ruby-lang.rake" authoringToolVersion="10.1.1">
3
- <title>Quandl Toolbelt <%= version %> <%= prerelease_information %></title>
4
- <options customize="allow" allow-external-scripts="no"/>
5
- <domains enable_localSystem="true"/>
6
- <choices-outline>
7
- <line choice="quandl-toolbelt"/>
8
- </choices-outline>
9
- <choice id="quandl-toolbelt" title="Quandl Toolbelt <%= version %>">
10
- <pkg-ref id="com.quandl.toolbelt"/>
11
- <pkg-ref id="org.ruby-lang.installer"/>
12
- </choice>
13
- <pkg-ref id="com.quandl.toolbelt" installKBytes="<%= kbytes %>" version="<%= version %>" auth="Root">#quandl-toolbelt.pkg</pkg-ref>
14
- <pkg-ref id="org.ruby-lang.installer" installKBytes="9132" auth="Root">#ruby.pkg</pkg-ref>
15
- </installer-script>
@@ -1,6 +0,0 @@
1
- <pkg-info format-version="2" identifier="com.quandl.toolbelt" version="<%= version %>" install-location="/usr/local/quandl" auth="root">
2
- <payload installKBytes="<%= kbytes %>" numberOfFiles="<%= num_files %>"/>
3
- <scripts>
4
- <postinstall file="./postinstall"/>
5
- </scripts>
6
- </pkg-info>