Skip to content
Go to file

Latest commit


Failed to load latest commit information.

Welcome to ODataPy

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.

Getting started

Getting the source

git clone

Getting ODataCpp and building

1.Download the source code of ODataCpp and save it at 'odatacpp' under the ODataPy folder.

2.Build the Win32 Release version of ODataCpp.

3.Set the following environment variables to your Python install location, such as:

SET PYTHON_INCLUDE=C:\python27\include
SET PYTHON_LIB=C:\python27\libs\python27.lib

4.Run buildall.bat in VS2012 Command Prompt to build the library for ODataPy

Running tests

After building the library, you can run the end-to-end tests to check the basic functionality.

1.Test the raw client:


2.Test the generated client:


Your first ODataPy app

Generate the client side proxy of the target service

Navigate to the folder of ODataPy and run the code generation tool to generate the proxy.

python <ServiceURL> <ProxyFileName> [<Username> <Password>]

is the URL of the service document of the target OData service. is the name you want for the .py file of the proxy code. and are the credential for accessing the service in case it requires authentication.

In this tutorial, we want to build a client application for the TripPin service published on and it doesn't require authentication, so the command is:

python TripPin

and we get

Create a client app in Python

Type in the following code:

import TripPin

path = r""
context = TripPin.DefaultContainer(path)
airports = context.query_airports()
for airport in airports:
    print airport.get_name()

Save it as "", and run it!


OData Python client




No releases published


No packages published
You can’t perform that action at this time.