ffiec 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e2622ad8498a364eddc77be1f7b2cc0ed151fa9d
4
+ data.tar.gz: 51f827d83fbf4f96134b01d317af2c486de30351
5
+ SHA512:
6
+ metadata.gz: 6e0531b7990b124eb38648af805daaff1576787e970c54ac1a31fd265c828e8154eea83dff5f68448a291b4390b789a6daeb3ab16eba1cec75337ea30a71e83f
7
+ data.tar.gz: a652c461c56910912711eeed5681e11ce02610e95c6df4e1fc0e49bcf50130a9f0728235b45973bd7f7a87f48f452c475b4a0bb7e3e6fbc99a68fed9bf3b201c
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /*.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ffiec.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Andrew Curley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # Ffiec
2
+
3
+ This gem is a Ruby wrapper for the FFIEC (Federal Financial Institutions Examination Council) Public Data Distribution (PDD) Public Web Service (PWS). Before using this gem you must sign up for a web services account at the [FFIEC's website](https://cdr.ffiec.gov/public/PWS/CreateAccount.aspx) where you will choose a username and be provided with an API key.
4
+
5
+ * [Documentation for the SOAP API](https://cdr.ffiec.gov/Public/PWS/WebServices/RetrievalService.asmx)
6
+ * [WSDL file](https://cdr.ffiec.gov/Public/PWS/WebServices/RetrievalService.asmx?WSDL)
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'ffiec'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install ffiec
23
+
24
+ ## Usage
25
+ ```
26
+ client = Ffiec::Client.new(username:'your_username', api_key:'your_api_key')
27
+
28
+ client.available_commands
29
+ => [:test_user_access, :retrieve_reporting_periods, :retrieve_panel_of_reporters, :retrieve_filers_submission_date_time, :retrieve_filers_since_date, :retrieve_facsimile, :retrieve_ubpr_reporting_periods, :retrieve_ubprxbrl_facsimile]
30
+
31
+ client.test_user_access
32
+ => true
33
+
34
+ client.retrieve_facsimile(date: '9/30/2015', format: 'SDF', id: 37, id_type: 'ID_RSSD')
35
+ => "Call Date;Bank RSSD Identifier;MDRM #;Value;Last Update;Short Definition;Call Schedule;Line Number\r\n20150930;37;RCOA3792;20326;20151028;Total capital (sum of items 26 and 34.a)..."
36
+ ```
37
+
38
+ ## Development
39
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+
41
+ ## Contributing
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/acurley/ffiec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
43
+
44
+ ## License
45
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ffiec"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ffiec/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ffiec"
8
+ spec.version = Ffiec::VERSION
9
+ spec.authors = ["Andrew Curley"]
10
+ spec.email = ["andrew.curley@gmail.com"]
11
+
12
+ spec.summary = "Ruby wrapper around the FFIEC's Public Data Distribution (PDD) Public Web Service (PWS)"
13
+ spec.description = "The FFIEC (Federal Financial Institutions Examination Council) provides a SOAP web service for it's Public Data Distribution (PDD) Public Web Service (PWS). Through this API you can obtain financial and structural information for most FDIC-insured institutions. The information available on this site is updated to reflect the most recent data for both prior and current periods. "
14
+ spec.homepage = "http://github.com/acurley/ffiec"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.10"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "rspec"
33
+ spec.add_dependency "savon"
34
+ end
@@ -0,0 +1,7 @@
1
+ require "ffiec/version"
2
+ require 'ffiec/client'
3
+ require "savon"
4
+
5
+ module Ffiec
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,55 @@
1
+ require 'savon'
2
+
3
+ module Ffiec
4
+ class Client
5
+
6
+ # Return new Ffiec::Client, which is really a wrapper around Savon::Client
7
+ def initialize(username:, api_key:)
8
+ wsdl_endpoint = "https://cdr.ffiec.gov/Public/PWS/WebServices/RetrievalService.asmx?WSDL"
9
+ @client = Savon.client(wsdl: wsdl_endpoint, wsse_auth: [username, api_key])
10
+ end
11
+
12
+ # Return array of commands that the WDL endpoint prescribes
13
+ def available_commands
14
+ return @client.operations
15
+ end
16
+
17
+ # Return array of strings that contain dates for which reports are available
18
+ def retrieve_reporting_periods
19
+ response = @client.call(:retrieve_reporting_periods)
20
+ return response.body[:retrieve_reporting_periods_response][:retrieve_reporting_periods_result][:string]
21
+ end
22
+
23
+ def retrieve_panel_of_reporters
24
+ end
25
+
26
+ def retrieve_filers_submission_date_time
27
+ end
28
+
29
+ def retrieve_filers_since_date
30
+ end
31
+
32
+ # Returns the web service response already decoded using Base64.decode64. The output is ready to be written to a file or processed inline. Accepted valued for parameters are:
33
+ #
34
+ # date - (See output of :retrieve_reporting_periods method for acceptable values)
35
+ # format - Acceptable values: PDF, SDF (semicolon delimited format) and XBRL
36
+ # id_type - Acceptable values: FDICCertNumber, ID_RSSD, OCCChartNumber and OTSDockNumber
37
+ # id - The financial institution's ID based on the enumerated fiIDType
38
+ def retrieve_facsimile(date:, format:, id:, id_type:)
39
+ response = @client.call(:retrieve_facsimile, message: {reportingPeriodEndDate: date, fiID: id, facsimileFormat: format, fiIDType: id_type})
40
+ return Base64.decode64 response.body[:retrieve_facsimile_response][:retrieve_facsimile_result]
41
+ end
42
+
43
+ def retrieve_ubpr_reporting_periods
44
+ end
45
+
46
+ def retrieve_ubprxbrl_facsimile
47
+ end
48
+
49
+ # Returns boolean response stating whether a user has provided valid credentials
50
+ def test_user_access
51
+ response = @client.call(:test_user_access)
52
+ return response.body[:test_user_access_response][:test_user_access_result]
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,3 @@
1
+ module Ffiec
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ffiec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Curley
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: savon
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: 'The FFIEC (Federal Financial Institutions Examination Council) provides
70
+ a SOAP web service for it''s Public Data Distribution (PDD) Public Web Service (PWS). Through
71
+ this API you can obtain financial and structural information for most FDIC-insured
72
+ institutions. The information available on this site is updated to reflect the most
73
+ recent data for both prior and current periods. '
74
+ email:
75
+ - andrew.curley@gmail.com
76
+ executables: []
77
+ extensions: []
78
+ extra_rdoc_files: []
79
+ files:
80
+ - ".gitignore"
81
+ - ".rspec"
82
+ - ".travis.yml"
83
+ - CODE_OF_CONDUCT.md
84
+ - Gemfile
85
+ - LICENSE.txt
86
+ - README.md
87
+ - Rakefile
88
+ - bin/console
89
+ - bin/setup
90
+ - ffiec.gemspec
91
+ - lib/ffiec.rb
92
+ - lib/ffiec/client.rb
93
+ - lib/ffiec/version.rb
94
+ homepage: http://github.com/acurley/ffiec
95
+ licenses:
96
+ - MIT
97
+ metadata:
98
+ allowed_push_host: https://rubygems.org
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.4.5
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: Ruby wrapper around the FFIEC's Public Data Distribution (PDD) Public Web
119
+ Service (PWS)
120
+ test_files: []