Skip to main content

No project description provided

Project description

Build Status Coverage Status

ocds-api.client.python

A python data retrieving and synchronization client for the OCDS API.

Installation

Simply run from command line:

pip install ocds-api.client.python

Usage

Retrieve

from ocds_client.clients import RecordClient
client = RecordClient('http://')

To get a single record by ocid use method get_record:

record = client.get_record('ocid')

To get multiple records bypage id use method get_records:

records = client.get_records({'size': n , 'page': 'page id'})

Similar actions can be taken with the client for Releases.

from ocds_client.clients import ReleaseClient

Use methods get_release and get_realeses.

Synchronization

To synchronize, use SyncClient when initializing the OCDS API host and the resource to synchronize with.

from ocds_client.sync import SyncClient
client = SyncClient('http://', 'record')
for record in client.get_resource_items ():
	# do smth with record

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
ocds-api.client.python-0.0.1b0.tar.gz (8.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page