Skip to content

jackminchin/PyONS

Repository files navigation

PyONS

Python wrapper for the Office for National Statistics API Upload Python Package

Installation

    pip install pyONS

Usage

Datasets

Get List of Available Datasets

  • The ONS do not seem to provide their full range of datasets through their BETA API.
As Pandas DataFrame
from pyONS import api.Datasets

datasets_df = Datasets().as_DataFrame()
As JSON
from pyONS import api.Datasets

datasets_json = Datasets().as_Json()

Get Latest Dataset Version

from pyONS import api.Datasets

dataset = Datasets().Dataset(dataset_id).getLatest()

Interacting with Datasets

List Editions
List Versions
List Dimensions
from pyONS import api.Datasets

dimensions = x = Datasets().Dataset(dataset_id).edition(edition).version(version).dimensions().list()
print(dimensions)

Codes

Coming Soon...

Not affiliated with the Office for National Statistics

About

Python wrapper to easily interact with the Office National Statistics API

Resources

License

Stars

Watchers

Forks

Packages

No packages published