thirteen_f 0.2.6 → 0.4.0
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/Gemfile +0 -2
- data/README.md +3 -3
- data/lib/thirteen_f/company.rb +9 -8
- data/lib/thirteen_f/cusip_securities.rb +3 -2
- data/lib/thirteen_f/position.rb +5 -10
- data/lib/thirteen_f/version.rb +1 -1
- data/thirteen_f.gemspec +7 -7
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85b773091adc251303e4acb8b07239b42a2c99984a94d7c541f838c37eaacb79
|
4
|
+
data.tar.gz: aea7834cfc3c0c0194cbd8eedcc9ae6ba6f564d60f4360a8e29bea4cd2f73d26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea5c9d380b2606b32c2efd9d3a3ed6cc5b452e03e7f6e74dd5075132d594326bd83ba6ca672cb393172446ecea23d8b3b6b1128106c6b99b36119d9a4ce154c8
|
7
|
+
data.tar.gz: 7da64251c953225cbb0c32b32c1d87496c848bdf896ad3ddbe67579c7f21d419502d29548da4e22231357478c2660805e66ec6dc92445e1ba3c9355c6bcffde3
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -116,10 +116,10 @@ git commits and tags, and push the `.gem` file to
|
|
116
116
|
## Contributing
|
117
117
|
|
118
118
|
Bug reports and pull requests are welcome on GitHub at
|
119
|
-
https://github.com/
|
119
|
+
https://github.com/savfischer/thirteen_f. This project is intended to be a safe,
|
120
120
|
welcoming space for collaboration, and contributors are expected to adhere to
|
121
121
|
the [code of
|
122
|
-
conduct](https://github.com/
|
122
|
+
conduct](https://github.com/savfischer/thirteen_f/blob/master/CODE_OF_CONDUCT.md).
|
123
123
|
|
124
124
|
|
125
125
|
## License
|
@@ -131,4 +131,4 @@ License](https://opensource.org/licenses/MIT).
|
|
131
131
|
|
132
132
|
Everyone interacting in the ThirteenF project's codebases, issue trackers, chat
|
133
133
|
rooms and mailing lists is expected to follow the [code of
|
134
|
-
conduct](https://github.com/
|
134
|
+
conduct](https://github.com/savfischer/thirteen_f/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/thirteen_f/company.rb
CHANGED
@@ -69,18 +69,19 @@ class ThirteenF
|
|
69
69
|
"#{BASE_URL}/cgi-bin/browse-edgar?CIK=#{cik}"
|
70
70
|
end
|
71
71
|
|
72
|
+
def thirteen_f_urls(count: 10)
|
73
|
+
response = HTTP.get thirteen_f_filings_url(count: count)
|
74
|
+
page = Nokogiri::HTML response.to_s
|
75
|
+
page.search('#documentsbutton').map do |btn|
|
76
|
+
next nil unless btn.parent.previous.previous.text.include?('13F-HR')
|
77
|
+
"#{BASE_URL + btn.attributes['href'].value}"
|
78
|
+
end.compact
|
79
|
+
end
|
80
|
+
|
72
81
|
private
|
73
82
|
def self.parse_name(name_cell)
|
74
83
|
name_cell.text.split("\n").first
|
75
84
|
end
|
76
|
-
|
77
|
-
def thirteen_f_urls(count: 100)
|
78
|
-
response = HTTP.get thirteen_f_filings_url(count: count)
|
79
|
-
page = Nokogiri::HTML response.to_s
|
80
|
-
page.search('#documentsbutton').map do |btn|
|
81
|
-
"#{BASE_URL + btn.attributes['href'].value}"
|
82
|
-
end
|
83
|
-
end
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
@@ -48,10 +48,11 @@ class ThirteenF
|
|
48
48
|
reader.pages[2..-1].each do |page|
|
49
49
|
lines = page.text.split("\n").reject(&:empty?)[3..-1]
|
50
50
|
line_arrs = lines.map do |line|
|
51
|
-
next nil if line.include?('Total
|
52
|
-
line.split(
|
51
|
+
next nil if line.include?('Total Coun')
|
52
|
+
line.split(/\s{3}|( \* )/).reject(&:empty?).map(&:strip).reject { |text| text == '*' }
|
53
53
|
end
|
54
54
|
line_arrs.compact.each do |line_arr|
|
55
|
+
next unless line_arr.count > 1
|
55
56
|
valid_entries.push ListEntry.new(line_arr)
|
56
57
|
end
|
57
58
|
end
|
data/lib/thirteen_f/position.rb
CHANGED
@@ -10,20 +10,15 @@ class ThirteenF
|
|
10
10
|
|
11
11
|
def self.from_xml_filing(filing)
|
12
12
|
return nil unless filing.table_xml_url
|
13
|
-
|
14
|
-
xml_doc = Nokogiri::XML response.to_s
|
15
|
-
xml_doc.search('infoTable').map do |info_table|
|
16
|
-
position = new filing: filing
|
17
|
-
position.attributes_from_info_table(info_table)
|
18
|
-
position
|
19
|
-
end
|
13
|
+
from_xml_url(filing.table_xml_url, filing: filing)
|
20
14
|
end
|
21
15
|
|
22
|
-
def self.from_xml_url(table_xml_url)
|
16
|
+
def self.from_xml_url(table_xml_url, filing: nil)
|
23
17
|
response = HTTP.get table_xml_url
|
24
18
|
xml_doc = Nokogiri::XML response.to_s
|
25
|
-
xml_doc.
|
26
|
-
|
19
|
+
xml_doc.remove_namespaces!
|
20
|
+
xml_doc.search("//infoTable").map do |info_table|
|
21
|
+
position = new filing: filing
|
27
22
|
position.attributes_from_info_table(info_table)
|
28
23
|
position
|
29
24
|
end
|
data/lib/thirteen_f/version.rb
CHANGED
data/thirteen_f.gemspec
CHANGED
@@ -3,8 +3,8 @@ require_relative 'lib/thirteen_f/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "thirteen_f"
|
5
5
|
spec.version = ThirteenF::VERSION
|
6
|
-
spec.authors = ["
|
7
|
-
spec.email = ["
|
6
|
+
spec.authors = ["savfischer"]
|
7
|
+
spec.email = ["savannah.fischer@hey.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{A ruby interface for S.E.C. 13F Data.}
|
10
10
|
|
@@ -13,13 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
filings are disclosures large institutional investors in public securites have
|
14
14
|
to provide and make public every quarter. It is a great way to follow what
|
15
15
|
different investors have been doing.}
|
16
|
-
spec.homepage = "https://github.com/
|
16
|
+
spec.homepage = "https://github.com/savfischer/thirteen_f"
|
17
17
|
spec.license = "MIT"
|
18
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
18
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
19
19
|
|
20
20
|
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
-
spec.metadata["source_code_uri"] = "https://github.com/
|
22
|
-
spec.metadata["changelog_uri"] = "https://github.com/
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/savfischer/thirteen_f"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/savfischer/thirteen_f/commits/master"
|
23
23
|
|
24
24
|
# Specify which files should be added to the gem when it is released.
|
25
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
|
33
33
|
spec.add_development_dependency "minitest"
|
34
34
|
spec.add_development_dependency "pry"
|
35
|
-
spec.add_dependency "http", ">=
|
35
|
+
spec.add_dependency "http", ">= 5"
|
36
36
|
spec.add_dependency "nokogiri"
|
37
37
|
spec.add_dependency "pdf-reader"
|
38
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thirteen_f
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- savfischer
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '5'
|
48
48
|
type: :runtime
|
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: '
|
54
|
+
version: '5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,7 @@ description: |-
|
|
87
87
|
to provide and make public every quarter. It is a great way to follow what
|
88
88
|
different investors have been doing.
|
89
89
|
email:
|
90
|
-
-
|
90
|
+
- savannah.fischer@hey.com
|
91
91
|
executables: []
|
92
92
|
extensions: []
|
93
93
|
extra_rdoc_files: []
|
@@ -111,14 +111,14 @@ files:
|
|
111
111
|
- lib/thirteen_f/search.rb
|
112
112
|
- lib/thirteen_f/version.rb
|
113
113
|
- thirteen_f.gemspec
|
114
|
-
homepage: https://github.com/
|
114
|
+
homepage: https://github.com/savfischer/thirteen_f
|
115
115
|
licenses:
|
116
116
|
- MIT
|
117
117
|
metadata:
|
118
|
-
homepage_uri: https://github.com/
|
119
|
-
source_code_uri: https://github.com/
|
120
|
-
changelog_uri: https://github.com/
|
121
|
-
post_install_message:
|
118
|
+
homepage_uri: https://github.com/savfischer/thirteen_f
|
119
|
+
source_code_uri: https://github.com/savfischer/thirteen_f
|
120
|
+
changelog_uri: https://github.com/savfischer/thirteen_f/commits/master
|
121
|
+
post_install_message:
|
122
122
|
rdoc_options: []
|
123
123
|
require_paths:
|
124
124
|
- lib
|
@@ -126,15 +126,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 2.
|
129
|
+
version: 2.6.0
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
132
|
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
rubygems_version: 3.1.
|
137
|
-
signing_key:
|
136
|
+
rubygems_version: 3.1.4
|
137
|
+
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: A ruby interface for S.E.C. 13F Data.
|
140
140
|
test_files: []
|