Skip to content

Commit

Permalink
Merge pull request #88 from openownership/2022-06-22
Browse files Browse the repository at this point in the history
More work on Schema 0.3
  • Loading branch information
James (ODSC) authored Jun 30, 2022
2 parents e8e802e + 37a809f commit 76cbd1a
Show file tree
Hide file tree
Showing 21 changed files with 2,116 additions and 52 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.13.0] - 2022-06-30

### Added

- Schema version 0.3
- Schema class has new method is_schema_version_equal_to_or_greater_than()
- New statistic: count of interest objects with different directOrIndirect values. For 0.3+
- Schema class has new method get_ownership_or_control_statement_interest_direct_or_indirect_list() for this

- New check: has public listing information but has public listing is false. For 0.3+
- New check: statement entityType and entitySubtype.generalCategory do not align. For 0.3+
- New check: marketIdentifierCode / operatingMarketIdentifierCode - check one not missing. For 0.3+
- New statistic: count ownership or control statement with at least one interest beneficial
- New statistic: count person statements have pep status statuses
- New check: has pep details without missing info but incorrect pep status. For 0.2 only
- New check: has pep details but incorrect pep status. For 0.3+
- New check: has pep details with missing info but incorrect pep status. Different rules are used for 0.2 only and 0.3+

### Changed

- Updated included schema files, and added instructions on how to do that to the README
Expand All @@ -22,6 +32,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- New abstract class AdditionalCheck - can be extended by other classes to have better seperation in the future
- New function process_additional_checks available to do work

## Removed

- Removed statistic: count person statements have pep status and reason missing info

## [0.12.0] - 2021-10-26

### Added
Expand Down
251 changes: 222 additions & 29 deletions libcovebods/lib/common_checks.py

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions libcovebods/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ def get_ownership_or_control_statement_interest_direct_or_indirect_list(self):
else:
return []

def get_person_statement_political_exposure_status_list(self):
for statement_schema in self._pkg_schema_obj["items"]["oneOf"]:
if (
statement_schema["properties"]["statementType"]["enum"][0]
== "personStatement"
):
political_exposure_schema = statement_schema["properties"].get(
"politicalExposure"
)
# This is only available in 0.3 and above.
if isinstance(political_exposure_schema, dict):
return political_exposure_schema["properties"]["status"]["enum"]
else:
return []

def get_inconsistent_schema_version_used_for_statement(self, statement):
# If version is not set at all, then we assume it's the default version
if (
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="libcovebods",
version="0.12.0",
version="0.13.0",
author="Open Data Services",
author_email="code@opendataservices.coop",
url="https://github.com/openownership/lib-cove-bods",
Expand All @@ -16,6 +16,7 @@
"flattentool>=0.5.0",
"libcove>=0.22.0",
"libcoveweb>=0.21.0",
"packaging",
],
extras_require={"dev": ["pytest", "flake8", "black==22.3.0", "isort"]},
classifiers=[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[
{
"statementID": "0d2a7a15-3291-4ac7-9663-e3659056dadc",
"statementType": "entityStatement",
"isComponent": false,
"statementDate": "2019-03-18",
"entityType": "registeredEntity",
"name": "Platinum Emerald and Plutonim Mining Limited",
"identifiers": [
{
"scheme": "GB-COH",
"id": "XE-000079054"
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
},
{
"statementID": "a5680770-899f-4f7a-b795-e266f1ce8668",
"statementType": "personStatement",
"isComponent": false,
"personType": "knownPerson",
"statementDate": "2019-03-18",
"names": [
{
"fullName": "Michael Hubbard"
}
],
"hasPepStatus": true,
"pepStatusDetails":
[
{
"missingInfoReason": "They won't tell us"
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
},
{
"statementID": "106271aa-10ff-48ad-a5ba-f3f8132b59ff",
"statementType": "ownershipOrControlStatement",
"isComponent": false,
"statementDate": "2019-03-18",
"subject": {
"describedByEntityStatement": "0d2a7a15-3291-4ac7-9663-e3659056dadc"
},
"interestedParty": {
"describedByPersonStatement": "a5680770-899f-4f7a-b795-e266f1ce8668"
},
"interests": [
{
"type": "shareholding",
"interestLevel": "direct",
"share": {
"minimum": 25,
"maximum": 50
},
"startDate": "2016-07-07",
"beneficialOwnershipOrControl": true
},
{
"type": "voting-rights",
"interestLevel": "direct",
"share": {
"minimum": 25,
"maximum": 50
},
"startDate": "2016-07-07",
"beneficialOwnershipOrControl": true
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[
{
"statementID": "0d2a7a15-3291-4ac7-9663-e3659056dadc",
"statementType": "entityStatement",
"isComponent": false,
"statementDate": "2019-03-18",
"entityType": "registeredEntity",
"name": "Platinum Emerald and Plutonim Mining Limited",
"identifiers": [
{
"scheme": "GB-COH",
"id": "XE-000079054"
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
},
{
"statementID": "a5680770-899f-4f7a-b795-e266f1ce8668",
"statementType": "personStatement",
"isComponent": false,
"personType": "knownPerson",
"statementDate": "2019-03-18",
"names": [
{
"fullName": "Michael Hubbard"
}
],
"hasPepStatus": false,
"pepStatusDetails":
[
{
"jurisdiction": {
"code": "gb"
},
"reason": "Member of Parliament",
"startDate": "2017-10-15",
"source": {
"type": ["selfDeclaration"],
"assertedBy": [
{
"name": "Michael Hubbard"
}
]
}
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
},
{
"statementID": "106271aa-10ff-48ad-a5ba-f3f8132b59ff",
"statementType": "ownershipOrControlStatement",
"isComponent": false,
"statementDate": "2019-03-18",
"subject": {
"describedByEntityStatement": "0d2a7a15-3291-4ac7-9663-e3659056dadc"
},
"interestedParty": {
"describedByPersonStatement": "a5680770-899f-4f7a-b795-e266f1ce8668"
},
"interests": [
{
"type": "shareholding",
"interestLevel": "direct",
"share": {
"minimum": 25,
"maximum": 50
},
"startDate": "2016-07-07",
"beneficialOwnershipOrControl": true
},
{
"type": "voting-rights",
"interestLevel": "direct",
"share": {
"minimum": 25,
"maximum": 50
},
"startDate": "2016-07-07",
"beneficialOwnershipOrControl": true
}
],
"publicationDetails": {
"publicationDate": "2019-06-07",
"bodsVersion": "0.2",
"license": "https://example.com/document/ei-open-data-policy-2015",
"publisher": {
"name": "ETI International"
}
}
}
]
2 changes: 1 addition & 1 deletion tests/fixtures/0.2/pep_status_missing_info_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fullName": "Michael Hubbard"
}
],
"hasPepStatus": true,
"hasPepStatus": false,
"pepStatusDetails":
[
{
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/0.3/basic_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"id": "07444723"
}
],
"publicListing": {
"hasPublicListing": true,
"companyFilingsURLs": ["http://example.com/"],
"securitiesListings": []
},
"publicationDetails": {
"publicationDate": "2018-02-13",
"bodsVersion": "0.3",
Expand Down
Loading

0 comments on commit 76cbd1a

Please sign in to comment.