Skip to main content

qri python client

Project description

qri-python

 ██████╗ ██████╗ ██╗
██╔═══██╗██╔══██╗██║
██║   ██║██████╔╝██║
██║▄▄ ██║██╔══██╗██║
╚██████╔╝██║  ██║██║
 ╚══▀▀═╝ ╚═╝  ╚═╝╚═╝

Python client for qri ("query")

Installation

pip install qri

About

Python wrapper to enable usage of qri, the dataset toolchain. Can either use a locally installed qri command-line program to work with your local repository, or can directly get datasets from the Qri Cloud.

Dataset objects returned by this library have the components that exist in the standard qri model. The body is returned as a Pandas DataFrame in order to easily integrate with other data science systems, like Jupyter Notebook.

Usage

The following examples assume you have the latest release of the qri command-line client installed. You can get this from https://github.com/qri-io/qri/releases

import qri
# Pull a dataset from cloud and add it to your repository
$ qri.pull("b5/world_bank_population")

Fetching from registry...

"Added b5/world_bank_population: ..."

# List datasets in your repository
$ qri.list()

[Dataset("b5/world_bank_population")]

# Get that single dataset as a variable
$ d = qri.get("b5/world_bank_population")
# Look at metadata description
$ d.meta.description

( 1 ) United Nations Population Division. World Population Prospects: 2017 Revision...

# Get the dataset body as a pandas DataFrame
$ d.body

. country_name country_code indicator_name ...

0 Afghanistan AFG Population, total ...

...

TODO: Save changes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for qri, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size qri-0.1.5.tar.gz (9.4 kB) File type Source Python version None Upload date Hashes View
Filename, size qri-0.1.5-py3-none-any.whl (10.0 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page