透明信息语言和工具包(TILT)的python语言绑定

tilt的Python项目详细描述


python-tilt |透明信息语言和工具包

什么是透明信息语言和工具箱?在

在这个关于数据隐私的透明信息的方案中,向复杂的生态系统迈出的重要一步是,引入一个基于描述多服务环境下透明度信息的正式语言模型和最新法律要求(欧盟一般数据保护条例)的透明度增强工具包。所期望的工作结果应该是合适的,为开发者准备使用隐私工程解决方案,并作为这一领域进一步研究的起点。最终,数据主体应该(能够)通过使用工具箱的接口来理解与其相关的数据发生了什么。在

什么是python tilt?在

tilt是一种基于Python的语言绑定,用于Transparency Information language and Toolkit。在

安装

使用pip安装python客户机库。参见project page。在

foo@bar:~$ pip3 install tilt
Collecting tilt  Using cached tilt-0.0.1-py3-none-any.whl (22 kB)Installing collected packages: tiltSuccessfully installed tilt-0.0.1

基本用途

在这里可以看到一个交互式游乐场Binder,在这个游戏中,您可以在Juypter笔记本中运行python-tilt。在

  1. 导入透明信息语言绑定/库。在
  2. 创建您的第一个对象,例如数据保护官员及其联系方式。在
  3. 继续创建对象,即控制器及其代表。在
  4. 。。。(添加所有其他字段,此处未显示)。。。在
^{pr2}$

导入现有文档

为了导入现有的tilt文档(我们称之为实例),您可以使用您喜欢的HTTP客户端或从本地磁盘加载。然后,您可以使用本机python对象并按您的喜好进行任何操作。

^{pr 3}$

Create new documents from scratch

In the example below we are using standard libraries (e.g. sha256 or datetime) in order to create formatted strings. All objects have ^{} and ^{} functions which help you to build or export them.

^{pr 4}$

Validate documents

See the following example code on how to validate documents using fastjsonschema。在

importfastjsonschemaimportjsonimportrequests# Load schema to validate againstfile=requests.get('https://raw.githubusercontent.com/Transparency-Information-Language/schema/master/tilt-schema.json')schema=json.loads(file.content)# Load instance/document to validate;# you may use your own tilt object with .to_dict() herefile=requests.get('https://raw.githubusercontent.com/Transparency-Information-Language/schema/master/tilt.json')instance=json.loads(file.content)# Compile schemavalidate_func=fastjsonschema.compile(schema)# Validate instance against schemavalidate_func(instance)## {'meta': {'_id': 'f1424f86-ca0f-4f0c-9438-43cc00509931', 'name': 'Green Company', 'created': '2020-04-03T15:53:05.929588', 'modified': '2020-04-03T15:53:05.929588',...## => document is valid# Load another examplefile=requests.get('https://raw.githubusercontent.com/Transparency-Information-Language/schema/master/tilt-NOT-valid.json')instance=json.loads(file.content)# Validate another examplevalidate_func(instance)## JsonSchemaException: data.controller must contain ['name', 'address', 'country', 'representative'] properties## => document is invalid

作者

埃利亚斯·格吕纽瓦尔德

许可证

GNU通用公共许可证,版本3

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java重写父类中的特定行   java Apache Commons CLI订购帮助选项?   java如何将数据添加到网格视图   java如何在Apache Camel批处理后移动文件?   java如何为日期范围的between子句编写hql查询?   雅加达ee开始Java编程,我应该从哪里开始?   排序Java8+流:检查我的objectinstances的两个字段的列表顺序是否正确   java如何将json转换为Map<String,Object>确保整数为整数   java不能在Spring数据JPA批处理过程中创建TransactionException   java损坏的PDF文件从FTP下载到使用Apache Common Net的设备   java无法使用Spring批处理和Wso2为XML架构命名空间找到Spring NamespaceHandler   java Android ImageView未显示在SherlockFragment中   Maven在构建时出错=无法识别Java路径   java如何使用批处理文件调用关闭处理程序?   java admob广告横幅重叠我的游戏屏幕安卓