sec_query 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +35 -0
- data/lib/sec_query/filing.rb +6 -7
- data/lib/sec_query/filing_detail.rb +2 -1
- data/lib/sec_query/sec_uri.rb +1 -1
- data/lib/sec_query/version.rb +1 -1
- data/sec_query.gemspec +10 -10
- data/spec/sec_query/entity_spec.rb +35 -2
- data/spec/sec_query/sec_uri_spec.rb +3 -3
- metadata +37 -38
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e05c826068c7e3b70b62043aa111e83bd01118130116a9db4d6e7991ea923231
|
4
|
+
data.tar.gz: 38465104422bc0096f3c4a432f0b6801da6282e87c8f7e5e0e6468b7606f5d30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538a894e0910434e9ed11c604485342919d6d9de42da73b3d86b2da57e1cd7b7b4b04bdeb51f405e5c1d5b7ff0e01eed6ae8e9eaa919c73ccc7af98af102a44f
|
7
|
+
data.tar.gz: 46ea472a4334afca91affa041ba5ee2bbc5879b9009c7ab2d27e05e2f884c056e77146e9ca88dbb9785c8774f4662b6c178e6995986f2a22a898307d754ef8ef
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ main ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ main ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
+
# uses: ruby/setup-ruby@v1
|
30
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake
|
data/lib/sec_query/filing.rb
CHANGED
@@ -19,8 +19,8 @@ module SecQuery
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.fetch(uri, &blk)
|
22
|
-
|
23
|
-
parse_rss(
|
22
|
+
RestClient::Request.execute(method: :get, url: uri.to_s, timeout: 10) do |response, request, result, &block|
|
23
|
+
parse_rss(response.body, &blk)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -50,11 +50,10 @@ module SecQuery
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.for_date(date, &blk)
|
53
|
-
|
54
|
-
|
53
|
+
url = SecURI.for_date(date).to_s
|
54
|
+
RestClient::Request.execute(method: :get, url: url, timeout: 10) do |response, request, result, &block|
|
55
|
+
filings_for_index(response.body).each(&blk)
|
55
56
|
end
|
56
|
-
rescue OpenURI::HTTPError
|
57
|
-
return
|
58
57
|
end
|
59
58
|
|
60
59
|
def self.filings_for_index(index)
|
@@ -151,7 +150,7 @@ module SecQuery
|
|
151
150
|
filings = []
|
152
151
|
if document.xpath('//content').to_s.length > 0
|
153
152
|
document.xpath('//content').each do |e|
|
154
|
-
if e.xpath('//content/accession-
|
153
|
+
if e.xpath('//content/accession-number').to_s.length > 0
|
155
154
|
content = Hash.from_xml(e.to_s)['content']
|
156
155
|
content[:cik] = cik
|
157
156
|
content[:file_id] = content.delete('accession_nunber')
|
@@ -15,7 +15,8 @@ module SecQuery
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.fetch(uri)
|
18
|
-
|
18
|
+
response = RestClient::Request.execute(method: :get, url: uri.to_s.gsub('http:', 'https:'), timeout: 10)
|
19
|
+
document = Nokogiri::HTML(response.body)
|
19
20
|
filing_date = document.xpath('//*[@id="formDiv"]/div[2]/div[1]/div[2]').text
|
20
21
|
accepted_date = document.xpath('//*[@id="formDiv"]/div[2]/div[1]/div[4]').text
|
21
22
|
period_of_report = document.xpath('//*[@id="formDiv"]/div[2]/div[2]/div[2]').text
|
data/lib/sec_query/sec_uri.rb
CHANGED
data/lib/sec_query/version.rb
CHANGED
data/sec_query.gemspec
CHANGED
@@ -19,15 +19,15 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ['lib']
|
21
21
|
|
22
|
-
s.add_development_dependency 'bundler', '~> 2.
|
22
|
+
s.add_development_dependency 'bundler', '~> 2.2.14'
|
23
23
|
s.add_development_dependency 'rake'
|
24
|
-
s.add_development_dependency 'rspec', '~> 3.
|
25
|
-
s.add_development_dependency 'vcr', '~>
|
26
|
-
s.add_development_dependency 'webmock', '~>
|
27
|
-
s.add_development_dependency 'rubocop', '~>
|
28
|
-
s.
|
29
|
-
s.add_runtime_dependency '
|
30
|
-
s.add_runtime_dependency '
|
31
|
-
s.add_runtime_dependency '
|
32
|
-
s.add_runtime_dependency '
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.10'
|
25
|
+
s.add_development_dependency 'vcr', '~> 6.0'
|
26
|
+
s.add_development_dependency 'webmock', '~> 3.12'
|
27
|
+
s.add_development_dependency 'rubocop', '~> 1.11'
|
28
|
+
s.add_runtime_dependency 'rest-client', '~> 2.1.0'
|
29
|
+
s.add_runtime_dependency 'addressable', '~> 2.7'
|
30
|
+
s.add_runtime_dependency 'nokogiri', '~> 1'
|
31
|
+
s.add_runtime_dependency 'activesupport', '~> 5.2'
|
32
|
+
s.add_runtime_dependency 'rss', '~> 0.2'
|
33
33
|
end
|
@@ -7,7 +7,7 @@ describe SecQuery::Entity do
|
|
7
7
|
|
8
8
|
describe "Company Queries", vcr: { cassette_name: "aapl"} do
|
9
9
|
|
10
|
-
let(:query){{name: "
|
10
|
+
let(:query){{name: "Apple Inc.", sic: "3571", symbol: "aapl", cik:"0000320193"}}
|
11
11
|
|
12
12
|
[:symbol, :cik, :name].each do |key|
|
13
13
|
context "when quering by #{key}" do
|
@@ -37,7 +37,40 @@ describe SecQuery::Entity do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
|
+
describe "Company Queries - Alphabet Inc.", vcr: { cassette_name: "googl"} do
|
42
|
+
|
43
|
+
let(:query){{name: "Alphabet Inc.", sic: "7370", symbol: "googl", cik:"0001652044"}}
|
44
|
+
|
45
|
+
[:symbol, :cik, :name].each do |key|
|
46
|
+
context "when quering by #{key}" do
|
47
|
+
describe "as hash" do
|
48
|
+
|
49
|
+
let(:entity){ SecQuery::Entity.find({ key => query[key] }) }
|
50
|
+
|
51
|
+
it "should be valid" do
|
52
|
+
is_valid?(entity)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should have a valid mailing address" do
|
56
|
+
is_valid_address?(entity.mailing_address)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should have a valid business address" do
|
60
|
+
is_valid_address?(entity.business_address)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "as string" do
|
65
|
+
it "should be valid" do
|
66
|
+
entity = SecQuery::Entity.find(query[key])
|
67
|
+
is_valid?(entity)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
41
74
|
describe "People Queries", vcr: { cassette_name: "Steve Jobs"} do
|
42
75
|
|
43
76
|
let(:query){ { name: "JOBS STEVEN P", :cik => "0001007844" } }
|
@@ -28,10 +28,10 @@ describe SecQuery::SecURI do
|
|
28
28
|
.to eq('https://www.sec.gov/cgi-bin/browse-edgar?CIK=AAPL')
|
29
29
|
end
|
30
30
|
|
31
|
-
it 'builds a default /browse-edgar/ url with options: "Apple"' do
|
32
|
-
uri = SecQuery::SecURI.browse_edgar_uri('Apple')
|
31
|
+
it 'builds a default /browse-edgar/ url with options: "Apple Inc"' do
|
32
|
+
uri = SecQuery::SecURI.browse_edgar_uri('Apple Inc')
|
33
33
|
expect(uri.to_s)
|
34
|
-
.to eq('https://www.sec.gov/cgi-bin/browse-edgar?company=Apple')
|
34
|
+
.to eq('https://www.sec.gov/cgi-bin/browse-edgar?company=Apple%20Inc')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sec_query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ty Rauber
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.2.14
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.2.14
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,126 +44,126 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.10'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.10'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: vcr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '6.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '6.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.12'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.12'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.11'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.11'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rest-client
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
103
|
+
version: 2.1.0
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 2.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: addressable
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '2.
|
117
|
+
version: '2.7'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '2.
|
124
|
+
version: '2.7'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: nokogiri
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '1'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '1'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: activesupport
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '5.2'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: '5.2'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: rss
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
159
|
+
version: '0.2'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
166
|
+
version: '0.2'
|
167
167
|
description: Search for company or person, by name, symbol or Central Index Key (CIK),
|
168
168
|
and retrieve filings.
|
169
169
|
email:
|
@@ -172,8 +172,8 @@ executables: []
|
|
172
172
|
extensions: []
|
173
173
|
extra_rdoc_files: []
|
174
174
|
files:
|
175
|
+
- ".github/workflows/ruby.yml"
|
175
176
|
- ".gitignore"
|
176
|
-
- ".travis.yml"
|
177
177
|
- Gemfile
|
178
178
|
- README.md
|
179
179
|
- Rakefile
|
@@ -193,7 +193,7 @@ homepage: https://github.com/tyrauber/sec_query
|
|
193
193
|
licenses:
|
194
194
|
- MIT
|
195
195
|
metadata: {}
|
196
|
-
post_install_message:
|
196
|
+
post_install_message:
|
197
197
|
rdoc_options: []
|
198
198
|
require_paths:
|
199
199
|
- lib
|
@@ -208,9 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
|
212
|
-
|
213
|
-
signing_key:
|
211
|
+
rubygems_version: 3.0.6
|
212
|
+
signing_key:
|
214
213
|
specification_version: 4
|
215
214
|
summary: A ruby gem for querying the United States Securities and Exchange Commission
|
216
215
|
Edgar System.
|