OCDS Spoonbill 1.0.12#
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 (underplanning
,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.
- Command-Line Interface
- Library Usage
- API Reference
- Supported tables
- Contributing
- Changelog
- 1.0.12 (2023-09-19)
- 1.0.11 (2023-08-17)
- 1.0.10 (2022-04-07)
- 1.0.9b10 (2021-10-17)
- 1.0.9b9 (2021-10-15)
- 1.0.9b8 (2021-09-22)
- 1.0.8b8 (2021-09-20)
- 1.0.7b8 (2021-09-20)
- 1.0.7b7 (2021-09-10)
- 1.0.6b7 (2021-09-09)
- 1.0.6b6 (2021-07-14)
- 1.0.5b6 (2021-07-14)
- 1.0.5b5 (2021-06-24)
- 1.0.5b4 (2021-06-18)
- 1.0.4b4 (2021-06-17)
- 1.0.4b3 (2021-06-15)
- 1.0.3b3 (2021-06-15)
- 1.0.3b2 (2021-06-07)
- 1.0.2b1 (2021-06-02)
- 1.0.1b1 (2021-05-27)
- 1.0.0b1 (2021-05-26)
Copyright (c) 2021 Open Contracting Partnership, released under the BSD license