我想知道是否有任何OData Python库可用于生成和使用OData?有不同语言的实现:http: //www.odata.org/libraries/
但到目前为止我找不到Python.顺便说一下,我不是指IronPython.该库应该只在Python中可用.
and*_*dri 15
我是http://code.google.com/p/odata-py/图书馆的作者, 它还处于早期阶段,但它提供了最基本的功能(创建,阅读,更新).如果您发现错误或想要贡献,请随时留言;)
前段时间我开始了自己的 OData 4.0 消费者项目。它基于requests
库并且是纯Python。它相当小,因为我只实现了工作所需的东西。在我的github上查看。
有点像这样工作:
from odata import ODataService
url = 'http://services.odata.org/V4/Northwind/Northwind.svc/'
Service = ODataService(url, reflect_entities=True)
Product = Service.entities['Product']
query = Service.query(Product)
query = query.filter(Product.ProductName.startswith('Queso'))
query = query.order_by(Product.UnitPrice.desc())
for product in query:
print(product.ProductName)
Run Code Online (Sandbox Code Playgroud)
我最近在我为一个名为Pyslet的电子学习项目维护的Python包中添加了一些OData模块.该项目在Github上托管:https://github.com/swl10/pyslet
我在这里写了一篇介绍OData消费者功能的介绍性博客文章:http://swl10.blogspot.co.uk/2014/02/a-dictionary-like-python-interface-for.html
在了解了 OData 的介绍后,我也进行了查看,不幸的是,到目前为止似乎还没有。我会密切关注其中的一个,因为我确信其中一个会浮出水面。
2016年更新
OData Libraries列出了两个支持 OData 的 python 库。pyslet看起来是最活跃的,因为它在过去几个月中进行了提交并发布了多个版本。我还没有尝试过它们中的任何一个,所以我不能真正说它们是否有效。