PyOData: OData for Pythonistas¶
Python agnostic implementation of OData client library.
Supported features¶
- OData V2
Basic usage¶
The only thing you need to do is to import the pyodata Python module and provide an object implementing interface compatible with Session from the library Requests.
import pyodata
import requests
SERVICE_URL = 'http://services.odata.org/V2/Northwind/Northwind.svc/'
HTTP_LIB = requests.Session()
northwind = pyodata.Client(SERVICE_URL, HTTP_LIB)
for customer in northwind.entity_sets.Customers.get_entities().execute():
print(customer.CustomerID, customer.CompanyName)
The User Guide¶
- Initialization
- Get the service
- Get the service proxy client for an OData service requiring sap-client parameter
- Get the service proxy client for an OData service requiring authentication
- Get the service proxy client for an OData service requiring Certificate authentication
- Get the service with local metadata
- Dealing with errors during parsing metadata
- Prevent substitution by default values
- Set custom namespaces (Deprecated - use config instead)
- Querying
- Get one entity identified by its key value
- Get one entity identified by its key value which is not scalar
- Get all entities of an entity set
- Get entities matching a filter
- Get entities matching a filter in more Pythonic way
- Get entities matching a filter in ORM style
- Get entities matching a complex filter in ORM style
- Get a count of entities
- Get a count of entities via navigation property
- Use non-standard OData URL Query parameters
- Encode OData URL Path
- Query server-side paginations using the __next field
- Creating
- Updating
- Deleting
- Function imports
- Metadata evaluation
- Advanced usage
- URLs generation