Skip to content

additional_data: sources: add licence info#335

Open
BibianaC wants to merge 2 commits into
livefrom
bc/add-grant-additional_data-licence
Open

additional_data: sources: add licence info#335
BibianaC wants to merge 2 commits into
livefrom
bc/add-grant-additional_data-licence

Conversation

@BibianaC

@BibianaC BibianaC commented Jun 3, 2026

Copy link
Copy Markdown
Member

relates to #213

I have added the licence to the additional data sources.
The API will be done in a different PR.

@BibianaC BibianaC force-pushed the bc/add-grant-additional_data-licence branch from af01824 to fda34e0 Compare June 3, 2026 13:05
self._cache = {}

def update_additional_data(self, grant, source_file, additional_data):
additional_data[f"{self.ADDITIONAL_DATA_KEY}_LICENCE"] = self.LICENCE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we're doing _LICENCE here, compared to https://github.com/ThreeSixtyGiving/datastore/pull/258/changes#diff-d3929aef8ca975fa331395aa7d04c5dc0b85608c6aed7ab04f3a45cf32fa4095R15-R22 which is additional_data[self.ADDITIONAL_DATA_KEY]["source_license"].

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Bjwebb , I made some changes.

@BibianaC BibianaC force-pushed the bc/add-grant-additional_data-licence branch from b56608d to 830d3fc Compare June 11, 2026 09:09
@BibianaC BibianaC force-pushed the bc/add-grant-additional_data-licence branch from 830d3fc to 7fa3b96 Compare June 11, 2026 09:19
@mariongalley mariongalley requested review from mrshll1001 and removed request for mariongalley June 17, 2026 15:08
@mariongalley

Copy link
Copy Markdown

Not sure how to test so asked for Matt's review instead

@BibianaC BibianaC requested a review from Bjwebb June 26, 2026 06:07

@Bjwebb Bjwebb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, if the outputted JSON is what we want. Could you share an example grant JSON? I think that might help me and @mrshll1001 review this.

@BibianaC

Copy link
Copy Markdown
Member Author

@Bjwebb @mrshll1001

I have added print statements in the test.

print("\n\n=== ACTUAL GRANT DATA ===")
print(json.dumps(grant.data, indent=2))
print("\n\n=== ACTUAL ADDITIONAL DATA ===")
print(json.dumps(additional_data, indent=2))
print("\n\n")

The output:

=== ACTUAL GRANT DATA ===
{
  "id": "360G-kahM5Ooc2u",
  "title": "The luumuch5Ir grant",
  "currency": "GBP",
  "awardDate": "2019-10-03T00:00:00+00:00",
  "description": "Example grant description",
  "dateModified": "2019-08-03T00:00:00Z",
  "fromOpenCall": "Yes",
  "plannedDates": [
    {
      "endDate": "2017-02-15",
      "duration": 4,
      "startDate": "2016-10-03"
    }
  ],
  "amountAwarded": 971,
  "grantProgramme": [
    {
      "code": "00200200220",
      "title": "Example grants August 2019"
    }
  ],
  "beneficiaryLocation": [
    {
      "name": "England; Scotland; Wales",
      "geoCode": "K02000001",
      "geoCodeType": "CTRY"
    }
  ],
  "fundingOrganization": [
    {
      "id": "GB-example-b",
      "name": "Funding for examples"
    }
  ],
  "recipientOrganization": [
    {
      "id": "360G-example-a",
      "name": "Receive an example grant",
      "postalCode": "SW1 1AA",
      "streetAddress": "10 Downing street",
      "addressCountry": "United Kingdom",
      "addressLocality": "LONDON"
    }
  ]
}
=== ACTUAL ADDITIONAL DATA ===
{
  "metadata": {
    "source_license_name": "Creative Commons Attribution 4.0",
    "source_license": "https://creativecommons.org/licenses/by/4.0/",
    "sources_metadata": {
      "recipientOrgInfos": {
        "license": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
      },
      "locationLookup": {
        "license": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
      },
      "recipientOrganizationLocation": {
        "license": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
      },
      "codeListLookup": {
        "license": "https://creativecommons.org/licenses/by/4.0/"
      }
    }
  }
}

@BibianaC BibianaC requested a review from Bjwebb June 30, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants