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

OData4 implementation #8

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
30 changes: 27 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Load the package with
Tables
~~~~~~

Statistics Netherlands (CBS) has a large amount of public available
Statistics Netherlands (CBS) has a large amount of publicly available
data tables (more than 4000 at the moment of writing). Each table is
identified by a unique identifier (``Identifier``).
identified by a unique identifier (``Identifier``).

.. code:: python

Expand Down Expand Up @@ -93,7 +93,7 @@ Data
~~~~

The function you are looking for!! The function ``get_data`` returns a list of
dicts with the table data.
dictionaries with the table data.

.. code:: python

Expand Down Expand Up @@ -230,3 +230,27 @@ Use the flag ``-o`` to load data to a file (JSON lines).
.. code:: bash

> cbsodata data 82010NED -o table_82010NED.jl


Odata API Version 4
-------------------

CBS migrates from `OData version 3`__ to `OData version 4`__. This migration comes
with a lot of other changes. Read about the changes at the website of CBS https://beta.opendata.cbs.nl/OData4/index.html.

More documentation on this page will follow when the new API is officially released (it's now in beta)

__ https://www.odata.org/documentation/odata-version-3-0/
__ https://www.odata.org/documentation/

.. code:: python

import cbsodata4 as cbsodata

obs = cbsodata.get_data("84120NED")

Transform data into a pivot table with Pandas.

.. code:: python

df.pivot(index='PeriodenTitle', columns='BelastingenEnWettelijkePremiesTitle', values='Value')
Loading