OCDS Spoonbill 1.0.12#

PyPI Version Build Status Coverage Status Python Version

Spoonbill converts data that conforms to the Open Contracting Data Standard (OCDS) from JSON to Excel / CSV (“tables”, hereafter). This is also known as “flattening” a JSON file.

If you are viewing this on GitHub or PyPI, open the full documentation for additional details.

This documentation describes the command-line tool and Python library. Spoonbill is also accessible as a web application (URL pending).

Installation#

From the command line:

pip install spoonbill

Spoonbill requires a supported version of Python 3.

How it works#

Spoonbill reads the JSON file once to analyze its structure. It stores the results of its analysis in a “state file”. It then reads the JSON file a second time to write the tables.

Spoonbill aims to improve the user experience when working with tables by:

  • Reducing the number of Excel sheets and/or CSV files you need to work with.

    • OCDS allows arrays of Document objects in five locations (under planning, tender, etc.). Instead of creating one table per location, Spoonbill combines documents into one table. It does the same for milestones and amendments.

    • Some arrays always have few entries within a given dataset: for example, an organization’s identifiers. Instead of creating a new table, Spoonbill merges short arrays into their parent table.

  • Providing options to customize the layout of the tables to fit your needs.

Row relations through parentID and rowID#

If id column is equal to the id column of table object (For example items/id) than the rowID is a concatenation of {ocid}/{field_name}:{id} for root tables and {parentID}/{field_name}:{id} for child tables.

The field_name is the field name of the array, and the id is the value of the id field of the item in the array.

For example, the contracts table for a compiled release might have a rowID of ocds-lcuori-1/contracts:1 then, the contracts items table might have a rowID of ocds-lcuori-1/contracts:1/items:1 and so on.

Similar to rowID, each child table contains parentID column, which is corresponding rowID of parent table.

Each non-root table contains parentTable column, which corresponse to the name of the sheet.

Copyright (c) 2021 Open Contracting Partnership, released under the BSD license