Skip to content

Commit 35e724d

Browse files
Push to v0.0.4 including renamed Source
1 parent 6394823 commit 35e724d

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

python-tilt-example.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
"name": "stdout",
129129
"output_type": "stream",
130130
"text": [
131-
"<tilt.tilt.Meta object at 0x10e7021f0>\n",
132-
"{'_hash': 'bd8f3c314b73d85175c8ccf15b4b8d26348beca96c9df39ba98fa5dda3f60fcc', '_id': '<your-id-01>', 'created': '2020-10-02T22:08:12.510696', 'language': 'en', 'modified': '2020-07-28T22:28:49.794345', 'name': 'Green Compancy SE', 'status': 'active', 'url': 'https://greencompany.implementation.cloud', 'version': 42}\n"
131+
"<tilt.tilt.Meta object at 0x10efb4fa0>\n",
132+
"{'_hash': 'bd8f3c314b73d85175c8ccf15b4b8d26348beca96c9df39ba98fa5dda3f60fcc', '_id': '<your-id-01>', 'created': '2020-10-02T22:08:12.510696', 'language': 'en', 'modified': '2020-07-30T16:34:11.486918', 'name': 'Green Compancy SE', 'status': 'active', 'url': 'https://greencompany.implementation.cloud', 'version': 42}\n"
133133
]
134134
}
135135
],
@@ -167,19 +167,19 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 7,
170+
"execution_count": 5,
171171
"metadata": {},
172172
"outputs": [
173173
{
174174
"ename": "JsonSchemaException",
175175
"evalue": "data.controller must contain ['name', 'address', 'country', 'representative'] properties",
176176
"output_type": "error",
177177
"traceback": [
178-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
179-
"\u001b[0;31mJsonSchemaException\u001b[0m Traceback (most recent call last)",
180-
"\u001b[0;32m<ipython-input-7-ef961cb89b42>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[0;31m# Validate another example\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 29\u001b[0;31m \u001b[0mvalidate_func\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minstance\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 30\u001b[0m \u001b[0;31m## JsonSchemaException: data.controller must contain ['name', 'address', 'country', 'representative'] properties\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0;31m## => document is invalid\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
181-
"\u001b[0;32m<string>\u001b[0m in \u001b[0;36mvalidate_https___github_com_transparency_information_language_schema\u001b[0;34m(data)\u001b[0m\n",
182-
"\u001b[0;31mJsonSchemaException\u001b[0m: data.controller must contain ['name', 'address', 'country', 'representative'] properties"
178+
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
179+
"\u001B[0;31mJsonSchemaException\u001B[0m Traceback (most recent call last)",
180+
"\u001B[0;32m<ipython-input-5-ef961cb89b42>\u001B[0m in \u001B[0;36m<module>\u001B[0;34m\u001B[0m\n\u001B[1;32m 27\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 28\u001B[0m \u001B[0;31m# Validate another example\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m---> 29\u001B[0;31m \u001B[0mvalidate_func\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0minstance\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m 30\u001B[0m \u001B[0;31m## JsonSchemaException: data.controller must contain ['name', 'address', 'country', 'representative'] properties\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 31\u001B[0m \u001B[0;31m## => document is invalid\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
181+
"\u001B[0;32m<string>\u001B[0m in \u001B[0;36mvalidate_https___github_com_transparency_information_language_schema\u001B[0;34m(data)\u001B[0m\n",
182+
"\u001B[0;31mJsonSchemaException\u001B[0m: data.controller must contain ['name', 'address', 'country', 'representative'] properties"
183183
]
184184
}
185185
],
@@ -239,4 +239,4 @@
239239
},
240240
"nbformat": 4,
241241
"nbformat_minor": 4
242-
}
242+
}

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
setuptools.setup(
77
name="tilt",
8-
version="0.0.3",
8+
version="0.0.4",
99
author="Elias Grünewald",
1010
author_email="gruenewald@tu-berlin.de",
11-
description="A python language binding for the Transparancy Information Language and Toolkit (TILT)",
11+
description="A python language binding for the Transparency Information Language and Toolkit (TILT)",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
url="https://github.com/Transparency-Information-Language/python-tilt",

tilt/tilt.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ def to_dict(self) -> dict:
991991
return result
992992

993993

994-
class TiltSource:
994+
class Source:
995995
"""This refers to an locally unique ID in an arbitrary but deterministic format."""
996996
id: str
997997
"""The category the data refer to."""
@@ -1005,12 +1005,12 @@ def __init__(self, id: str, data_category: str, sources: List[SourceSource]) ->
10051005
self.sources = sources
10061006

10071007
@staticmethod
1008-
def from_dict(obj: Any) -> 'TiltSource':
1008+
def from_dict(obj: Any) -> 'Source':
10091009
assert isinstance(obj, dict)
10101010
id = from_str(obj.get("_id"))
10111011
data_category = from_str(obj.get("dataCategory"))
10121012
sources = from_list(SourceSource.from_dict, obj.get("sources"))
1013-
return TiltSource(id, data_category, sources)
1013+
return Source(id, data_category, sources)
10141014

10151015
def to_dict(self) -> dict:
10161016
result: dict = {}
@@ -1186,11 +1186,11 @@ class Tilt:
11861186
"""This duty to provide information is limited to the collection of personal data that does
11871187
not take place from the data subject (Art. 14).
11881188
"""
1189-
sources: List[TiltSource]
1189+
sources: List[Source]
11901190
"""This schema refers to the adequacy decisions of any third country transfers."""
11911191
third_country_transfers: List[ThirdCountryTransferElement]
11921192

1193-
def __init__(self, access_and_data_portability: AccessAndDataPortability, automated_decision_making: AutomatedDecisionMaking, changes_of_purpose: List[ChangesOfPurposeElement], controller: Controller, data_disclosed: List[DataDisclosedElement], data_protection_officer: DataProtectionOfficer, meta: Meta, right_to_complain: RightToComplain, right_to_data_portability: RightToDataPortability, right_to_information: RightToInformation, right_to_rectification_or_deletion: RightToRectificationOrDeletion, right_to_withdraw_consent: RightToWithdrawConsent, sources: List[TiltSource], third_country_transfers: List[ThirdCountryTransferElement]) -> None:
1193+
def __init__(self, access_and_data_portability: AccessAndDataPortability, automated_decision_making: AutomatedDecisionMaking, changes_of_purpose: List[ChangesOfPurposeElement], controller: Controller, data_disclosed: List[DataDisclosedElement], data_protection_officer: DataProtectionOfficer, meta: Meta, right_to_complain: RightToComplain, right_to_data_portability: RightToDataPortability, right_to_information: RightToInformation, right_to_rectification_or_deletion: RightToRectificationOrDeletion, right_to_withdraw_consent: RightToWithdrawConsent, sources: List[Source], third_country_transfers: List[ThirdCountryTransferElement]) -> None:
11941194
self.access_and_data_portability = access_and_data_portability
11951195
self.automated_decision_making = automated_decision_making
11961196
self.changes_of_purpose = changes_of_purpose
@@ -1221,7 +1221,7 @@ def from_dict(obj: Any) -> 'Tilt':
12211221
right_to_information = RightToInformation.from_dict(obj.get("rightToInformation"))
12221222
right_to_rectification_or_deletion = RightToRectificationOrDeletion.from_dict(obj.get("rightToRectificationOrDeletion"))
12231223
right_to_withdraw_consent = RightToWithdrawConsent.from_dict(obj.get("rightToWithdrawConsent"))
1224-
sources = from_list(TiltSource.from_dict, obj.get("sources"))
1224+
sources = from_list(Source.from_dict, obj.get("sources"))
12251225
third_country_transfers = from_list(ThirdCountryTransferElement.from_dict, obj.get("thirdCountryTransfers"))
12261226
return Tilt(access_and_data_portability, automated_decision_making, changes_of_purpose, controller, data_disclosed, data_protection_officer, meta, right_to_complain, right_to_data_portability, right_to_information, right_to_rectification_or_deletion, right_to_withdraw_consent, sources, third_country_transfers)
12271227

@@ -1239,7 +1239,7 @@ def to_dict(self) -> dict:
12391239
result["rightToInformation"] = to_class(RightToInformation, self.right_to_information)
12401240
result["rightToRectificationOrDeletion"] = to_class(RightToRectificationOrDeletion, self.right_to_rectification_or_deletion)
12411241
result["rightToWithdrawConsent"] = to_class(RightToWithdrawConsent, self.right_to_withdraw_consent)
1242-
result["sources"] = from_list(lambda x: to_class(TiltSource, x), self.sources)
1242+
result["sources"] = from_list(lambda x: to_class(Source, x), self.sources)
12431243
result["thirdCountryTransfers"] = from_list(lambda x: to_class(ThirdCountryTransferElement, x), self.third_country_transfers)
12441244
return result
12451245

0 commit comments

Comments
 (0)