turbot-runner 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGQwYjkyYzJlYWE2MmM2YzRiMjljM2NlM2MxNGQyYmZkMDMzOWZjZQ==
4
+ NDYxODhhNGExNTA0ZDJmN2ZjNmY2NjA4NjlkZThmNDNmNzU1Y2ViNQ==
5
5
  data.tar.gz: !binary |-
6
- ODRjOWJkZmIzYjNiNTliZmRjYjA2ZDNhZGQ0MmFlZGY4ZmEwZTc3ZA==
6
+ MzVlMWRhNWZjNDgzYTcxY2ZmOTY0N2Q3YzFlOGUxYmFkOTU2NWRmMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTYwYTdmOWY0OTdlYzEyZTNjZDMxOTc1ZGI2YmM2Nzg0ZDIwZTYwNzc1ZThi
10
- NjJlNTVlNWUyMjFlM2RhOWQyMTU4MWM1MDJlYTRhZTAyNjY0MzJhMTBjOGZj
11
- N2FkNzMwOTc3YmIxM2NmMjJhNWY5MWE1YTE1ZjIwMjcxZWMwODA=
9
+ YjVhYTk3NGExYWYyMjk3NWE2NjRkYzJlMjRmMmU5MTkxOTA5N2U2MDcyNzA0
10
+ OWE1ZWNkN2M4ZmZmMWVjNjU0OTc0NzVkNDdmYThmYTVjM2FkNTlkZTk3MWUy
11
+ YzZmMzYzZjdiZDkxYjY0ZjZjMjIyOWM4Y2E0YWU1NTk5YmE5Y2E=
12
12
  data.tar.gz: !binary |-
13
- MGNiZDlhYzNiYTM4ZjhmYjE3OWJmMzJhNzI5MThkMmM4ODBkMDQ4YmNmMmJi
14
- MzE1ZDIzNmFkYmQ1OGRiNDA3MjY1OWZmZjdjN2FjNDMwNjYzNzg2NDhlYTc0
15
- NmNkMmQwMTcwYWQ5YzE1YTY2NDJmZjFjYWY5Mjc4Zjk2NTZmZTQ=
13
+ Nzc3NmY3NjYwMmE3N2IxYTA3YzExOWViNjE4MGQzZTY5MTQ1M2EyYjE5Y2Nh
14
+ Y2NjMzhlZjE0MTRkYjQwNTc0MjBhZTYxNTQ0Mzg3M2IxMmU0NTRmMjhkYWY0
15
+ ZTU0ZGM2NDRlZTgzNDU4NWZjZTJlYmMxMjA1MTM2ZTZhM2Y2ZWI=
@@ -1,3 +1,3 @@
1
1
  module TurbotRunner
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Company Schema",
4
+ "type": "object",
5
+ "description": "A company in OpenCorporates",
6
+ "properties": {
7
+ "company_number": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "jurisdiction_code": {
16
+ "type": "string",
17
+ "minLength": 2,
18
+ "maxLength": 5
19
+ },
20
+ "incorporation_date": {
21
+ "type": "date"
22
+ },
23
+ "dissolution_date": {
24
+ "type": "date"
25
+ },
26
+ "retrieved_at": {
27
+ "type": "date-time"
28
+ },
29
+ "current_status": {
30
+ "type": "string"
31
+ },
32
+ "company_type": {
33
+ "type": "string"
34
+ },
35
+ "registry_url": {
36
+ "type": "string"
37
+ },
38
+ "registered_address": {
39
+ "$ref": "includes/address.json"
40
+ },
41
+ "officers": {
42
+ "type": "array",
43
+ "items": {
44
+ "$ref": "includes/officer.json"
45
+ }
46
+ },
47
+ "share_parcels": {
48
+ "type": "array",
49
+ "items": {
50
+ "$ref": "includes/share-parcel.json"
51
+ }
52
+ },
53
+ "total_shares": {
54
+ "$ref": "includes/total-shares.json"
55
+ },
56
+ "filings": {
57
+ "type": "array",
58
+ "items": {
59
+ "$ref": "includes/filing.json"
60
+ }
61
+ },
62
+ "previous_names": {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "includes/previous_name.json"
66
+ }
67
+ },
68
+ "branch": {
69
+ "type": ["string","null"],
70
+ "description": "A flag to denote whether a company is a branch entity. This should only be set if the company is a type of branch (otherwise should be null). In general the only option here is 'F' for a 'Foreign' branch, i.e. an out-of-jurisdiction entity that has registered as having a presence in the jurisdiction. In the US this is sometimes called a Foreign Corporation",
71
+ "enum": ["F", "L",null]
72
+ },
73
+ "all_attributes": {
74
+ "type": "object",
75
+ "description": "Other arbitrary attributes for a given company",
76
+ "properties": {
77
+ "jurisdiction_of_origin": {
78
+ "type": ["string","null"],
79
+ "description": "The jurisdiction of the 'home' company if this is a branch",
80
+ "minLength": 1
81
+ },
82
+ "home_company_number": {
83
+ "type": ["string","null"],
84
+ "description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
85
+ "minLength": 1
86
+ },
87
+ "home_legal_name": {
88
+ "type": ["string","null"],
89
+ "description": "The legal name of the 'home' company in its jurisdiction if this is a branch, and the name is different from the legal name of the branch",
90
+ "minLength": 1
91
+ },
92
+ "registered_agent_address": {
93
+ "type": ["string","null"],
94
+ "description": "The address of the 'Agent', a public address to which legal papers can be served",
95
+ "minLength": 1
96
+ },
97
+ "registered_agent_name": {
98
+ "type": ["string","null"],
99
+ "description": "The 'Agent' of the company \u2013 a person or entity that is empowered to accept service for the company",
100
+ "minLength": 1
101
+ },
102
+ "number_of_employees": {
103
+ "type": "number",
104
+ "description": "The number of employees",
105
+ "minimum": 0
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "additionalProperties": false,
111
+ "required": ["company_number", "name", "jurisdiction_code"]
112
+ }
@@ -0,0 +1,23 @@
1
+ { "oneOf":
2
+ [
3
+ {
4
+ "type": ["string","null"],
5
+ "minLength": 2
6
+ },
7
+ {
8
+ "name": "Address",
9
+ "description": "An address object",
10
+ "type": "object",
11
+ "properties": { "street_address": { "type": "string" },
12
+ "locality": { "type": "date" },
13
+ "region": { "type": "string" },
14
+ "postal_code": { "type": "string" },
15
+ "country": { "type": "string" }
16
+ },
17
+ "anyOf": [ { "required": ["street_address"] },
18
+ { "required": ["postal_code"] }
19
+ ]
20
+ }
21
+ ]
22
+ }
23
+
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "Base statement",
3
+ "description": "A base statement which must be extended by a schema to be used in OpenCorporates",
4
+ "type": "object",
5
+ "properties": {
6
+ "source_url": {
7
+ "description": "Place where this fact can be verified",
8
+ "type": "string"
9
+ },
10
+ "source_jurisdiction": {
11
+ "description": "Jurisdiction of the source of the data",
12
+ "type": "string"
13
+ },
14
+ "sample_date": {
15
+ "description": "Date on which this fact was known to be true",
16
+ "type": "string"
17
+ },
18
+ "company": {
19
+ "$ref" : "../includes/company.json"
20
+ },
21
+ "data": {
22
+ "type": "array",
23
+ "additionalItems": false
24
+ }
25
+ },
26
+ "required": ["source_url", "data", "sample_date", "company"]
27
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Company",
3
+ "description": "A company which is the subject of a statement",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": { "type": "string" },
7
+ "jurisdiction": { "type": "string" },
8
+ "identifier": {
9
+ "type": "string",
10
+ "pattern": "^[^/]+/[^/]+$"
11
+ }
12
+ },
13
+ "required": [ "name", "jurisdiction" ]
14
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "Filing",
3
+ "description": "A statutory filing",
4
+ "type": "object",
5
+ "properties": { "title": { "type": "string" },
6
+ "date": { "type": "date" },
7
+ "description": { "type": "string" },
8
+ "uid": { "type": "string" },
9
+ "url": { "type": "string" },
10
+ "filing_type_code": { "type": "string" },
11
+ "filing_type_name": { "type": "string" },
12
+ "other_attributes": { "type": "object" }
13
+ },
14
+ "required": [ "date" ],
15
+ "anyOf": [ { "required": ["title"] },
16
+ { "required": ["description"] },
17
+ { "required": ["filing_type_name"] }
18
+ ]
19
+ }
20
+
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "License Data",
3
+ "type": "object",
4
+ "properties": {
5
+ "data_type": { "enum": [ "licence" ] },
6
+ "properties": {
7
+ "type": "object",
8
+ "properties": {
9
+ "regulator": {
10
+ "description": "The regulating body that issued the licence",
11
+ "type": "string"},
12
+ "jurisdiction_code": {
13
+ "description": "The jurisdiction for which licence was issued",
14
+ "type": "string"},
15
+ "licence_number": {
16
+ "type": "string"},
17
+ "jurisdiction_classification": {
18
+ "type": "array",
19
+ "minItems": 1},
20
+ "oc_classification": {
21
+ "type": "array"}
22
+ },
23
+ "required": [ "jurisdiction_code", "jurisdiction_classification" ]
24
+ }
25
+ },
26
+ "required": [ "data_type", "properties" ]
27
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Officer",
3
+ "description": "An officer (director, senior executive) of a company",
4
+ "type": "object",
5
+ "properties": { "name": { "type": "string", "minLength": 1 },
6
+ "start_date": { "type": "date" },
7
+ "end_date": { "type": "date" },
8
+ "position": { "type": "string" },
9
+ "other_attributes": { "type": "object" },
10
+ "uid": { "type": "string" }
11
+ },
12
+ "required": [ "name" ]
13
+ }
14
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "PreviousName",
3
+ "description": "A previous name of a company",
4
+ "type": "object",
5
+ "properties": { "company_name": { "type": "string", "minLength": 1 },
6
+ "con_date": { "type": "date" },
7
+ "start_date": { "type": "date" }
8
+ },
9
+ "required": [ "company_name" ]
10
+ }
11
+
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "Share Parcel Data",
3
+ "type": "object",
4
+ "properties": {
5
+ "data_type": { "enum": [ "share_parcel" ] },
6
+ "properties": {
7
+ "type": "object",
8
+ "required": ["shareholders"],
9
+ "properties": {
10
+ "number_of_shares": {
11
+ "description": "Number of shares, if known",
12
+ "type": "integer"},
13
+ "percentage_of_shares": {
14
+ "description": "Percentage of shares, if known",
15
+ "type": "number",
16
+ "maximum": 100,
17
+ "minimum": 0
18
+ },
19
+ "shareholders": {
20
+ "description": "Legal persons who own this share parcel",
21
+ "type": "array",
22
+ "minItems": 1,
23
+ "items": {
24
+ "anyOf": [
25
+ {"type": "object",
26
+ "name": "person",
27
+ "required": ["name"],
28
+ "properties": {
29
+ "name": {
30
+ "description": "Name of natural person or company",
31
+ "type": "string"
32
+ },
33
+ "jurisdiction": {
34
+ "description": "Jurisdiction of registration, if company",
35
+ "type": "string"
36
+ },
37
+ "company_number": {
38
+ "description": "Company number, if company and known",
39
+ "type": "string"
40
+ },
41
+ "identifier": {
42
+ "description": "Unique identifier of person",
43
+ "type": "string"
44
+ },
45
+ "type": {
46
+ "description": "Type of person if known (company or natural person)",
47
+ "enum" : ["Company", "Person"]
48
+ },
49
+ "address": {
50
+ "description": "Address given for owner of parcel",
51
+ "type": "string"
52
+ },
53
+ "address_country": {
54
+ "description": "Country part of owner's address",
55
+ "type": "string"
56
+ }
57
+
58
+ }
59
+ }
60
+ ]
61
+ }
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "required": [ "data_type", "properties" ]
67
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "Share Parcel",
3
+ "type": "object",
4
+ "description": "A parcel of shares in a company",
5
+ "required": ["shareholders"],
6
+ "properties": {
7
+ "number_of_shares": {
8
+ "description": "Number of shares, if known",
9
+ "type": "integer"},
10
+ "percentage_of_shares": {
11
+ "description": "Percentage of shares, if known",
12
+ "type": "number",
13
+ "maximum": 100,
14
+ "minimum": 0
15
+ },
16
+ "shareholders": {
17
+ "description": "Legal persons who own this share parcel",
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "items": {
21
+ "type": "object",
22
+ "name": "shareholder",
23
+ "required": ["name"],
24
+ "properties": {
25
+ "name": {
26
+ "description": "Name of natural person or company",
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "jurisdiction": {
31
+ "description": "Jurisdiction of registration, if company",
32
+ "type": "string"
33
+ },
34
+ "company_number": {
35
+ "description": "Company number, if company and known",
36
+ "type": "string"
37
+ },
38
+ "identifier": {
39
+ "description": "Unique identifier of person",
40
+ "type": "string"
41
+ },
42
+ "type": {
43
+ "description": "Type of person if known (company or natural person)",
44
+ "enum" : ["Company", "Person"]
45
+ },
46
+ "address": {
47
+ "description": "Address given for owner of parcel",
48
+ "type": "string"
49
+ },
50
+ "address_country": {
51
+ "description": "Country part of owner's address",
52
+ "type": "string"
53
+ }
54
+
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "required": [ ]
60
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "Share Parcel Data",
3
+ "type": "object",
4
+ "properties": {
5
+ "data_type": { "enum": [ "subsidiary_relationship" ] },
6
+ "properties": {
7
+ "type": "object",
8
+ "required": ["subsidiary"],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "direct": {
12
+ "description": "If the control is direct (if via an intermediary, this value should be false; if unknown, left blank)",
13
+ "type": "boolean"},
14
+ "significant": {
15
+ "description": "Does the source define the control as somehow significant?",
16
+ "type": "boolean"},
17
+ "subsidiary": {
18
+ "description": "Company that is controlled",
19
+ "type": "object",
20
+ "required": ["name"],
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "name": {
24
+ "description": "Name of company",
25
+ "type": "string"
26
+ },
27
+ "jurisdiction": {
28
+ "description": "Jurisdiction of registration",
29
+ "type": "string"
30
+ },
31
+ "company_number": {
32
+ "description": "Company number, if company and known",
33
+ "type": "string"
34
+ },
35
+ "identifier": {
36
+ "description": "Unique identifier of person",
37
+ "type": "string"
38
+ },
39
+ "address": {
40
+ "description": "Address given for owner of parcel",
41
+ "type": "string"
42
+ },
43
+ "address_country": {
44
+ "description": "Country part of owner's address",
45
+ "type": "string"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "TotalShares",
3
+ "description": "The total number of shares a company has issued",
4
+ "type": "object",
5
+ "properties": { "number": { "type": "integer" },
6
+ "share_class": { "type": "string", "minLength": 1 }
7
+ },
8
+ "required": [ "number" ]
9
+ }
10
+
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Licence Schema",
4
+ "type": "object",
5
+ "allOf" : [
6
+ // The following is a basic statement with sample_date, etc
7
+ { "$ref": "includes/base-statement.json" },
8
+ // And this overrides it to provide data-type-specific information
9
+ {
10
+ "properties": {
11
+ "data": {
12
+ "items": {
13
+ "allOf": [
14
+ { "$ref": "includes/license-data.json" }
15
+ ]
16
+ }
17
+ }
18
+ }
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Primary Data Schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "source_url": {
7
+ "description": "Place where this fact can be verified",
8
+ "type": "string"
9
+ },
10
+ "sample_date": {
11
+ "description": "Date on which this fact was known to be true",
12
+ "type": "string"
13
+ }
14
+ },
15
+ "required": ["source_url", "sample_date"],
16
+ "additionalProperties": true
17
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Share Parcel Schema",
4
+ "type": "object",
5
+ "allOf" : [
6
+ // The following is a basic statement with sample_date, etc
7
+ { "$ref": "includes/base-statement.json" },
8
+ // And this overrides it to provide data-type-specific information
9
+ {
10
+ "properties": {
11
+ "data": {
12
+ "items": {
13
+ "allOf": [
14
+ { "$ref": "includes/share-parcel-data.json" }
15
+ ]
16
+ }
17
+ }
18
+ }
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Simple Licence Schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "source_url": {
7
+ "description": "Place where this fact can be verified",
8
+ "type": "string"
9
+ },
10
+ "sample_date": {
11
+ "description": "Date on which this fact was known to be true",
12
+ "type": "string"
13
+ },
14
+ "confidence": {
15
+ "description": "Confidence in accuracy of data",
16
+ "type": "string",
17
+ "enum": ["HIGH", "MEDIUM", "LOW"]
18
+ },
19
+ "company_name": {
20
+ "description": "Name of the company holding the licence",
21
+ "type": "string"
22
+ },
23
+ "company_jurisdiction": {
24
+ "description": "Jurisdiction where company is based",
25
+ "type": "string"
26
+ },
27
+ "licence_number": {
28
+ "description": "Licence number or code",
29
+ "type": "string"
30
+ },
31
+ "jurisdiction_classification": {
32
+ "description": "Description of how regulator classifies licence",
33
+ "type": "string"
34
+ },
35
+ "regulator": {
36
+ "description": "The regulating body that issued the licence",
37
+ "type": "string"
38
+ },
39
+ "licence_jurisdiction": {
40
+ "description": "Jurisdiction where licence is issued",
41
+ "type": "string"
42
+ },
43
+ "category": {
44
+ "description": "Category of licence",
45
+ "type": "string",
46
+ "enum": ["Financial"]
47
+ }
48
+ },
49
+ "required": ["source_url", "sample_date", "company_name", "company_jurisdiction"]
50
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Subsidiary Relationship Schema",
4
+ "type": "object",
5
+ "allOf" : [
6
+ { "$ref": "includes/base-statement.json" },
7
+ {
8
+ "properties": {
9
+ "data": {
10
+ "items": {
11
+ "allOf": [
12
+ { "$ref": "includes/subsidiary-relationship-data.json" }
13
+ ]
14
+ }
15
+ }
16
+ }
17
+ }
18
+ ]
19
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbot-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenCorporates
@@ -33,6 +33,23 @@ files:
33
33
  - bin/rspec
34
34
  - lib/turbot_runner.rb
35
35
  - lib/turbot_runner/version.rb
36
+ - schema/schemas/company-schema.json
37
+ - schema/schemas/includes/address.json
38
+ - schema/schemas/includes/base-statement.json
39
+ - schema/schemas/includes/company.json
40
+ - schema/schemas/includes/filing.json
41
+ - schema/schemas/includes/license-data.json
42
+ - schema/schemas/includes/officer.json
43
+ - schema/schemas/includes/previous_name.json
44
+ - schema/schemas/includes/share-parcel-data.json
45
+ - schema/schemas/includes/share-parcel.json
46
+ - schema/schemas/includes/subsidiary-relationship-data.json
47
+ - schema/schemas/includes/total-shares.json
48
+ - schema/schemas/licence-schema.json
49
+ - schema/schemas/primary-data-schema.json
50
+ - schema/schemas/share-parcel-schema.json
51
+ - schema/schemas/simple-licence-schema.json
52
+ - schema/schemas/subsidiary-relationship-schema.json
36
53
  - spec/dummy-bot/manifest.json
37
54
  - spec/dummy-bot/scraper.rb
38
55
  - spec/dummy-bot/transformer.rb