透明信息语言和工具包(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第三方库


热门话题
使用多个参数的枚举   从Oracle到Redis的java复制表   java如何保护tomcat服务器中的db用户名和密码。xml   java如何使用注册密钥保护移动应用程序?   java在什么情况下超类不应该是抽象的?   java Backspace键在macOS上的Scala REPL中不起作用   arduino Java+Uno+RFID:调用方法读取Java中的RFID   带有where语句中集合的java JPA查询   java如何向基于Tyrus注释的客户端添加请求头   java对我的二进制搜索算法的反馈   java重新访问数据库时文件的内容不正确   用户在字符串中输入值后退出While循环(Java)   java如何在Maven中的多个项目之间共享项目依赖关系?   java Close从未在数据库上被明确调用   在java中从文件读入布尔矩阵   Java:如何使用父节点将XML流拆分为小型XML文档。VTDXML