Reputation: 2569
I was wondering if any OData Python libraries are available to produce and consume OData? There are implementations for different languages: http://www.odata.org/libraries/
But I couldn't find Python so far. I don't mean IronPython by the way. The library should be just usable in Python.
Upvotes: 53
Views: 26831
Reputation: 13350
I've looked as well after getting an intro to OData and it looks like there isn't one as of yet unfortunately. I'll be keeping an eye out for one as I'm sure one will surface.
Update 2016
OData Libraries lists two python libraries that support OData. With pyslet looking to be the most active since it has had commits in the last few months and several releases. I haven't tried either of them so I can't really say if they work well or not.
Upvotes: 1
Reputation: 7098
I started my own OData 4.0 consumer project some time ago. It's based on the requests
library and is pure Python. It's rather minimal as I've only implemented things I needed for work. Check it out on my github.
Works kinda like this:
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)
Upvotes: 7
Reputation: 163
please check this link
http://www.odata.org/libraries/
ODataPy (Python)
ODataPy is an open-source Python library that implements the Open Data Protocol (OData). It supports the OData protocol version 4.0. It is built on top of ODataCpp using language binding. It is under development and currently serves only parts of client and client side proxy generation (code gen) aspects of OData.
V4 Client GitHub
ODataStore for CoreData (iOS)
The ODataStore for CoreData is an iOS static library and a Mac OS X Framework to use V3 OData services with the CoreData Framework from Apple. V4 OData services will be supported in the future. The development language is Objective-C.
V3 Both Link
Pyslet Python Package (Python)
Pyslet is a Python package for Standards in Learning Education and Training. It implements a number of standards including OData v2 with both client and server capabilities.
V2 Both Link
OData4ObjC
This library makes it easy for iOS app developers to interact with data in any OData-compliant web service. It supports metadata-aware client-side code generation and full CRUD with query. If someone exposes a data model via OData, OData4ObjC makes it easy to get that model onto your iOS device.
V1-3 Client GitHub
Upvotes: 1
Reputation: 323
I've recently added some OData modules to a Python package I maintain for an e-Learning project called Pyslet. The project is hosted on Github here: https://github.com/swl10/pyslet
I wrote an introductory blog post demonstrating the OData consumer features here: http://swl10.blogspot.co.uk/2014/02/a-dictionary-like-python-interface-for.html
Upvotes: 7
Reputation: 1011
i am the author of the library at http://code.google.com/p/odata-py/ it's still in its early stages but it provides the most basic functionalities (create, read, update). Don't hesitate to drop a message if you see a bug or want to contribute ;)
Upvotes: 16
Reputation: 3236
Here is a version that is targeting Google App Engine: http://code.google.com/p/odata-py/
I've been experimenting with the spec and wrote a simple server for Python called MyOhData: https://bitbucket.org/dowski/myohdata/src
Upvotes: 2