Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting empty dictionary in Service.entities #39

Open
aviasd opened this issue Mar 1, 2020 · 2 comments
Open

Getting empty dictionary in Service.entities #39

aviasd opened this issue Mar 1, 2020 · 2 comments

Comments

@aviasd
Copy link

aviasd commented Mar 1, 2020

I tried to get the data from this site:
http://knesset.gov.il/Odata/ParliamentInfo.svc/

This is the code I used:

from odata import ODataService
url = 'http://knesset.gov.il/Odata/ParliamentInfo.svc/'
Service = ODataService(url, reflect_entities=True)
print(len(Service.entities))

The result is:

0

It should return a dictionary with all the tables on the site.
There is data on the site, and I think the format is good.
Maybe the problem is with the metadata.

Is there a way to fix this?
Thanks,

@tpow
Copy link

tpow commented Mar 14, 2020

Based on http://knesset.gov.il/Odata/ParliamentInfo.svc/$metadata the site does not appear to support the OData 4 version used by python-odata.

@tpow
Copy link

tpow commented Mar 14, 2020

You may want to look at the fork https://github.com/klem4/python-odata

It appears that it has been revised to support OData version 3. I know nothing else about this fork, but did a quick test using it with your code. The result was 38 entities in Service. Perhaps this will work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants