uk_companies_house 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +29 -0
- data/LICENSE.txt +21 -0
- data/README.md +188 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/uk_companies_house/client.rb +36 -0
- data/lib/uk_companies_house/company.rb +113 -0
- data/lib/uk_companies_house/officer.rb +26 -0
- data/lib/uk_companies_house/search.rb +43 -0
- data/lib/uk_companies_house/version.rb +3 -0
- data/lib/uk_companies_house.rb +17 -0
- data/uk_companies_house.gemspec +39 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 483084338f5acf0ae67d4a72f7f690f5f07847081c9e9b54032088b8f3dc0928
|
4
|
+
data.tar.gz: cdccad5bce7a73dae6892a6d9016238eea6a63d1371f351290eac7737b9ec784
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e5a8b23d1daba3ff78b9aa8baa43221d82058504c779d5b415e280f7c1a43f6515244b780c96674f1ab9395a93b11265bf6afc2f4e93a804866e6bcb29338747
|
7
|
+
data.tar.gz: 8d8ea8ed27629a1fd7cbbfb47c93c8126064eaf3979737df12dfc314c70a6d0f12a5a7e8cc74f2c9f9b57011f3863ac1de3fc0163c12a93c1ed3a4f5bcb1ee3e
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at eugeniu.rtj@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
uk_companies_house (0.1.1)
|
5
|
+
faraday
|
6
|
+
faraday_middleware
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
faraday (0.15.0)
|
12
|
+
multipart-post (>= 1.2, < 3)
|
13
|
+
faraday_middleware (0.12.2)
|
14
|
+
faraday (>= 0.7.4, < 1.0)
|
15
|
+
minitest (5.11.3)
|
16
|
+
multipart-post (2.0.0)
|
17
|
+
rake (10.5.0)
|
18
|
+
|
19
|
+
PLATFORMS
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
bundler (~> 1.16)
|
24
|
+
minitest (~> 5.0)
|
25
|
+
rake (~> 10.0)
|
26
|
+
uk_companies_house!
|
27
|
+
|
28
|
+
BUNDLED WITH
|
29
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Eugeniu Tambur
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
# Uk Companies House API
|
2
|
+
|
3
|
+
UK Companies House API
|
4
|
+
|
5
|
+
Companies House digitally records almost all information it receives, and makes this available to the public through its own website and through the Companies House RESTful API.
|
6
|
+
|
7
|
+
https://developer.companieshouse.gov.uk/api/docs/
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'uk_companies_house'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install uk_companies_house
|
24
|
+
|
25
|
+
## Setup
|
26
|
+
|
27
|
+
Initialize the the gem by setting your personal API key:
|
28
|
+
|
29
|
+
```
|
30
|
+
UkCompaniesHouse.api_key = 'YOUR_API_KEY'
|
31
|
+
```
|
32
|
+
|
33
|
+
Or create ENV variable UK_COMPANIES_HOUSE_API_KEY ( ENV['UK_COMPANIES_HOUSE_API_KEY'] ) with you API KEY
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
The path "company/06790962/filing-history" can be replaced by any other path available in the companieshouse.gov.uk documentation:
|
38
|
+
https://developer.companieshouse.gov.uk/api/docs/
|
39
|
+
|
40
|
+
Get request for any URL ( "company/06790962/filing-history" can be changed to any path ):
|
41
|
+
```
|
42
|
+
UkCompaniesHouse::Client.new.get("company/06790962/filing-history")
|
43
|
+
```
|
44
|
+
(POST url have same format)
|
45
|
+
To send new request via POST just change get to post:
|
46
|
+
example:
|
47
|
+
```
|
48
|
+
UkCompaniesHouse::Client.new.post("company/06790962/filing-history", { q: "any params with any query can be added", extra2: "more params" })
|
49
|
+
```
|
50
|
+
|
51
|
+
## Example
|
52
|
+
|
53
|
+
```
|
54
|
+
filing_history = UkCompaniesHouse::Company.filing_history('06790962', 'MzE5NTI2NjkwOGFkaXF6a2N4')
|
55
|
+
|
56
|
+
# the parsed response is in the body
|
57
|
+
=> filing_history.body
|
58
|
+
{
|
59
|
+
"date": "2018-01-15",
|
60
|
+
"description_values": {
|
61
|
+
"made_up_date": "2018-01-14"
|
62
|
+
},
|
63
|
+
"category": "confirmation-statement",
|
64
|
+
"description": "confirmation-statement-with-no-updates",
|
65
|
+
"type": "CS01",
|
66
|
+
"links": {
|
67
|
+
"self": "/company/06790962/filing-history/MzE5NTI2NjkwOGFkaXF6a2N4",
|
68
|
+
"document_metadata": "https://document-api.companieshouse.gov.uk/document/Ky1jcl7swkFk-X3TDV-xxCdVCNqhSS2uzlpzPMsJpDk"
|
69
|
+
},
|
70
|
+
"action_date": "2018-01-14",
|
71
|
+
"pages": 3,
|
72
|
+
"barcode": "X6XOKYQJ",
|
73
|
+
"transaction_id": "MzE5NTI2NjkwOGFkaXF6a2N4"
|
74
|
+
}
|
75
|
+
|
76
|
+
```
|
77
|
+
|
78
|
+
|
79
|
+
##Available methods:
|
80
|
+
|
81
|
+
### Global search:
|
82
|
+
|
83
|
+
```
|
84
|
+
# Search Companies House
|
85
|
+
UkCompaniesHouse::Search.all("query text", items_per_page, start_index)
|
86
|
+
|
87
|
+
# Search company information
|
88
|
+
UkCompaniesHouse::Search.company("query text", items_per_page, start_index)
|
89
|
+
|
90
|
+
# Search for officer information
|
91
|
+
UkCompaniesHouse::Search.officers("query text", items_per_page, start_index)
|
92
|
+
|
93
|
+
# Search for disqualified officer information
|
94
|
+
UkCompaniesHouse::Search.disqualified_officers("query text", items_per_page, start_index)
|
95
|
+
|
96
|
+
```
|
97
|
+
|
98
|
+
|
99
|
+
### Company:
|
100
|
+
|
101
|
+
```
|
102
|
+
# Search company information
|
103
|
+
UkCompaniesHouse::Company.search(q: "Query text")
|
104
|
+
UkCompaniesHouse::Company.search(q: "Query Text, items_per_page = 5, start_index = 5)
|
105
|
+
|
106
|
+
# Basic company information
|
107
|
+
UkCompaniesHouse::Company.basic_information(company_number)
|
108
|
+
|
109
|
+
# Registered office address
|
110
|
+
UkCompaniesHouse::Company.office_address(company_number)
|
111
|
+
|
112
|
+
# List of all company officers
|
113
|
+
UkCompaniesHouse::Company.officers(company_number)
|
114
|
+
|
115
|
+
# Get the filing history list of a company
|
116
|
+
UkCompaniesHouse::Company.filing_history(company_number, transaction_id)
|
117
|
+
|
118
|
+
# Get the filing history list of a company
|
119
|
+
UkCompaniesHouse::Company.filing_history_list(company_number, category, items_per_page, start_index)
|
120
|
+
|
121
|
+
# Company insolvency information.
|
122
|
+
UkCompaniesHouse::Company.insolvency(company_number)
|
123
|
+
|
124
|
+
# Individual charge information for company.
|
125
|
+
UkCompaniesHouse::Company.charge(company_number, charge_id)
|
126
|
+
|
127
|
+
# List of uk-establishments companies
|
128
|
+
UkCompaniesHouse::Company.uk_establishments(company_number)
|
129
|
+
|
130
|
+
# List the company persons with significant control
|
131
|
+
UkCompaniesHouse::Company.corporate_entities(company_number
|
132
|
+
|
133
|
+
# Get details of an individual person with significant control
|
134
|
+
UkCompaniesHouse::Company.individual_person(company_number, psc_id)
|
135
|
+
|
136
|
+
# Get details of a corporate entity with significant control
|
137
|
+
UkCompaniesHouse::Company.corporate_entity(company_number, psc_id)
|
138
|
+
|
139
|
+
# Get details of a legal person with significant contro
|
140
|
+
UkCompaniesHouse::Company.legal_persons(company_number, psc_id)
|
141
|
+
|
142
|
+
# List of all persons with significant control statements
|
143
|
+
UkCompaniesHouse::Company.list_statements(company_number)
|
144
|
+
|
145
|
+
# Get details of a person with significant control statement
|
146
|
+
UkCompaniesHouse::Company.statements(company_number)
|
147
|
+
|
148
|
+
# Get company registers information
|
149
|
+
UkCompaniesHouse::Company.registers(company_number)
|
150
|
+
|
151
|
+
# Company exemptions information
|
152
|
+
UkCompaniesHouse::Company.exemptions(company_number)
|
153
|
+
|
154
|
+
```
|
155
|
+
|
156
|
+
|
157
|
+
### Officer:
|
158
|
+
|
159
|
+
```
|
160
|
+
# List of all officer appointments
|
161
|
+
UkCompaniesHouse::Officer.appointments(officer_id)
|
162
|
+
|
163
|
+
# Get a natural officer's disqualifications
|
164
|
+
UkCompaniesHouse::Officer.natural_disqualified(officer_id)
|
165
|
+
|
166
|
+
# Get a corporate officer's disqualifications
|
167
|
+
UkCompaniesHouse::Officer.corporate_disqualified(officer_id)
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
|
172
|
+
## Development
|
173
|
+
|
174
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
175
|
+
|
176
|
+
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).
|
177
|
+
|
178
|
+
## Contributing
|
179
|
+
|
180
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zinggg/uk_companies_house. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
181
|
+
|
182
|
+
## License
|
183
|
+
|
184
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
185
|
+
|
186
|
+
## Code of Conduct
|
187
|
+
|
188
|
+
Everyone interacting in the UkCompaniesHouse project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/uk_companies_house/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "uk_companies_house"
|
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(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module UkCompaniesHouse
|
2
|
+
class Client
|
3
|
+
attr_accessor :api_key
|
4
|
+
|
5
|
+
def initialize(api_key: nil)
|
6
|
+
@api_key = api_key || UkCompaniesHouse.api_key
|
7
|
+
end
|
8
|
+
|
9
|
+
def connection
|
10
|
+
@connection ||= begin
|
11
|
+
Faraday.new(:url => 'https://api.companieshouse.gov.uk/') do |faraday|
|
12
|
+
faraday.headers['Authorization'] = @api_key
|
13
|
+
faraday.response :json, :content_type => /\bjson$/
|
14
|
+
faraday.adapter Faraday.default_adapter
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def post(url, data = {})
|
20
|
+
connection.post do |req|
|
21
|
+
req.url url
|
22
|
+
req.headers['Content-Type'] = 'application/json'
|
23
|
+
req.body = data.to_json
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def get(url, data = {})
|
28
|
+
connection.get do |req|
|
29
|
+
req.url url
|
30
|
+
req.headers['Content-Type'] = 'application/json'
|
31
|
+
req.body = data.to_json
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
module UkCompaniesHouse
|
2
|
+
module Company
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def client
|
6
|
+
UkCompaniesHouse::Client.new
|
7
|
+
end
|
8
|
+
|
9
|
+
# Search company information
|
10
|
+
def search(q, items_per_page = nil, start_index = nil)
|
11
|
+
params = {q: q,
|
12
|
+
items_per_page: items_per_page,
|
13
|
+
start_index: start_index}
|
14
|
+
client.get("search/companies/", params)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Basic company information
|
18
|
+
def basic_information(company_number)
|
19
|
+
client.get("company/", {company_number: company_number})
|
20
|
+
end
|
21
|
+
|
22
|
+
# Registered office address
|
23
|
+
def office_address(company_number)
|
24
|
+
client.get("company/#{company_number}/registered-office-address/")
|
25
|
+
end
|
26
|
+
|
27
|
+
# List of all company officers
|
28
|
+
def officers(company_number)
|
29
|
+
client.get("company/#{company_number}/officers/")
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get the filing history list of a company
|
33
|
+
def filing_history(company_number, transaction_id)
|
34
|
+
client.get("company/#{company_number}/filing-history/#{transaction_id}/")
|
35
|
+
end
|
36
|
+
|
37
|
+
# Get the filing history list of a company
|
38
|
+
def filing_history_list(company_number, category = nil, items_per_page = nil, start_index = nil)
|
39
|
+
params = {category: category,
|
40
|
+
items_per_page: items_per_page,
|
41
|
+
start_index: start_index}
|
42
|
+
client.get("company/#{company_number}/officers/", params)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Company insolvency information.
|
46
|
+
def insolvency(company_number)
|
47
|
+
client.get("company/#{company_number}/insolvency/")
|
48
|
+
end
|
49
|
+
|
50
|
+
# Individual charge information for company.
|
51
|
+
def charge(company_number, charge_id)
|
52
|
+
client.get("company/#{company_number}/charges/#{charge_id}/")
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of charges for a company.
|
56
|
+
def charges(company_number, items_per_page = nil, start_index = nil)
|
57
|
+
params = {items_per_page: items_per_page, start_index: start_index}
|
58
|
+
client.get("company/#{company_number}/charges/", params)
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of uk-establishments companies
|
62
|
+
def uk_establishments(company_number)
|
63
|
+
client.get("/company/#{company_number}/uk-establishments/")
|
64
|
+
end
|
65
|
+
|
66
|
+
# List of uk-establishments companies
|
67
|
+
def corporate_entities(company_number)
|
68
|
+
client.get("/company/#{company_number}/persons-with-significant-control/")
|
69
|
+
end
|
70
|
+
|
71
|
+
# Get details of an individual person with significant control
|
72
|
+
def individual_person(company_number, psc_id)
|
73
|
+
client.get("/company/#{company_number}/persons-with-significant-control/individual/#{psc_id}")
|
74
|
+
end
|
75
|
+
|
76
|
+
# Get details of a corporate entity with significant control
|
77
|
+
def corporate_entity(company_number, psc_id)
|
78
|
+
client.get("/company/#{company_number}/persons-with-significant-control/corporate-entity/#{psc_id}")
|
79
|
+
end
|
80
|
+
|
81
|
+
# Get details of a legal person with significant control
|
82
|
+
def legal_persons(company_number, psc_id)
|
83
|
+
client.get("/company/#{company_number}/persons-with-significant-control/legal-person/#{psc_id}")
|
84
|
+
end
|
85
|
+
|
86
|
+
# List of all persons with significant control statements
|
87
|
+
def list_statements(company_number)
|
88
|
+
client.get("/company/#{company_number}/persons-with-significant-control-statements")
|
89
|
+
end
|
90
|
+
|
91
|
+
# Get details of a person with significant control statement
|
92
|
+
def statements(company_number)
|
93
|
+
client.get("/company/#{company_number}/persons-with-significant-control-statements/#{statement_id}")
|
94
|
+
end
|
95
|
+
|
96
|
+
# Get details of a person with significant control statement
|
97
|
+
def get_super_secure_person(company_number, super_secure_id)
|
98
|
+
client.get("/company/#{company_number}/persons-with-significant-control/super-secure/#{super_secure_id}")
|
99
|
+
end
|
100
|
+
|
101
|
+
# Company registers information
|
102
|
+
def registers(company_number)
|
103
|
+
client.get("/company/#{company_number}/registers")
|
104
|
+
end
|
105
|
+
|
106
|
+
# Company exemptions information
|
107
|
+
def exemptions(company_number)
|
108
|
+
client.get("/company/#{company_number}/exemptions")
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module UkCompaniesHouse
|
2
|
+
module Officer
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def client
|
6
|
+
UkCompaniesHouse::Client.new
|
7
|
+
end
|
8
|
+
|
9
|
+
# List of all officer appointments
|
10
|
+
def appointments(officer_id)
|
11
|
+
client.get("officers/#{officer_id}/appointments/")
|
12
|
+
end
|
13
|
+
|
14
|
+
# Get a natural officer's disqualifications
|
15
|
+
def natural_disqualified(officer_id)
|
16
|
+
client.get("/disqualified-officers/natural/#{officer_id}/")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get a corporate officer's disqualifications
|
20
|
+
def corporate_disqualified(officer_id)
|
21
|
+
client.get("/disqualified-officers/corporate/#{officer_id}")
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UkCompaniesHouse
|
2
|
+
module Search
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def client
|
6
|
+
UkCompaniesHouse::Client.new
|
7
|
+
end
|
8
|
+
|
9
|
+
# Search Companies House
|
10
|
+
def all(q, items_per_page = nil, start_index = nil)
|
11
|
+
params = {q: q,
|
12
|
+
items_per_page: items_per_page,
|
13
|
+
start_index: start_index}
|
14
|
+
client.get("search/", params)
|
15
|
+
end
|
16
|
+
|
17
|
+
#Search company information
|
18
|
+
def company(q, items_per_page = nil, start_index = nil)
|
19
|
+
params = {q: q,
|
20
|
+
items_per_page: items_per_page,
|
21
|
+
start_index: start_index}
|
22
|
+
client.get("search/companies/", params)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Search for officer information
|
26
|
+
def officers(q, items_per_page = nil, start_index = nil)
|
27
|
+
params = {q: q,
|
28
|
+
items_per_page: items_per_page,
|
29
|
+
start_index: start_index}
|
30
|
+
client.get("search/officers", params)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Search for disqualified officer information
|
34
|
+
def disqualified_officers(q, items_per_page = nil, start_index = nil)
|
35
|
+
params = {q: q,
|
36
|
+
items_per_page: items_per_page,
|
37
|
+
start_index: start_index}
|
38
|
+
client.get("search/disqualified-officers/", params)
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
require "uk_companies_house/version"
|
6
|
+
require "uk_companies_house/client"
|
7
|
+
require "uk_companies_house/search"
|
8
|
+
require "uk_companies_house/officer"
|
9
|
+
require "uk_companies_house/company"
|
10
|
+
|
11
|
+
module UkCompaniesHouse
|
12
|
+
class << self
|
13
|
+
attr_accessor :api_key
|
14
|
+
end
|
15
|
+
|
16
|
+
self.api_key ||= ENV['UK_COMPANIES_HOUSE_API_KEY']
|
17
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "uk_companies_house/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "uk_companies_house"
|
8
|
+
spec.version = UkCompaniesHouse::VERSION
|
9
|
+
spec.authors = ["Eugeniu Tambur"]
|
10
|
+
spec.email = ["eugeniu.rtj@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Ruby API to UK Companies House.}
|
13
|
+
spec.description = %q{Ruby API client for UK Companies House REST API. (https://developer.companieshouse.gov.uk/api/docs/) }
|
14
|
+
spec.homepage = "https://github.com/zinggg/uk_companies_house"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
#spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
"public gem pushes."
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
36
|
+
|
37
|
+
spec.add_dependency "faraday"
|
38
|
+
spec.add_dependency "faraday_middleware"
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: uk_companies_house
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eugeniu Tambur
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-26 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.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
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: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
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
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday_middleware
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: 'Ruby API client for UK Companies House REST API. (https://developer.companieshouse.gov.uk/api/docs/) '
|
84
|
+
email:
|
85
|
+
- eugeniu.rtj@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
|
+
- CODE_OF_CONDUCT.md
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- lib/uk_companies_house.rb
|
101
|
+
- lib/uk_companies_house/client.rb
|
102
|
+
- lib/uk_companies_house/company.rb
|
103
|
+
- lib/uk_companies_house/officer.rb
|
104
|
+
- lib/uk_companies_house/search.rb
|
105
|
+
- lib/uk_companies_house/version.rb
|
106
|
+
- uk_companies_house.gemspec
|
107
|
+
homepage: https://github.com/zinggg/uk_companies_house
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.7.6
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Ruby API to UK Companies House.
|
131
|
+
test_files: []
|