Export a report¶
To export a report to Google Drive, click the report’s document icon on the homepage.
The exported document is built from templates in Google Docs.
Tags are added to templates to generate content within the document.
Note
The main template, sub-templates and export folder must be shared with the service account. See the SERVICE_ACCOUNT_JSON_FILE environment variable.
Tag syntax¶
A tag starts and ends like:
{% ... %}
A tag contains tokens delimited by spaces. For example:
{% field path:|ocid| template:|1We-5SJ7i8i-d0c7U8t9QRstf0EHkn5zQeVh5UfDkb2c| %}
The first token is the tag’s name (field
). The rest are the tag’s arguments (path:|ocid|
, etc.).
An argument is composed of a name, followed by a colon, followed by its value between vertical bars:
name:|value|
Each tag accepts different arguments.
Arguments can be provided in any order.
An argument can be required or optional.
An argument name must not be repeated.
Tag types¶
There are two types of tags:
- Template tag
This type of tag renders a template and inserts it into the document. Each template tag has access to different sub-tags.
- Leaf tag
This type of tag renders data from Pelican backend into the document. The new content inherits the styles applied to the tag.
Tag library¶
base template tag¶
When exporting a report, you provide the file ID for the base template.
The base
tag is not available within templates. It has the other template tags as sub-tags.
overview template tag¶
This template tag renders a template for metadata about the dataset.
{% overview template:|...| %}
Argument |
Value |
Required |
How to determine the value |
---|---|---|---|
|
The Google Docs ID of the overview template |
The machine-readable path component in the Google Docs URL |
The overview
template tag has leaf tags as sub-tags.
lifecycleObjectCount¶
Renders the number of objects for the specified contracting stage
.
{% lifecycleObjectCount stage:|tender| %}
Argument |
Value |
Required |
---|---|---|
|
One of planning, tender, award, contract, implementation |
✔️ |
field template tag¶
This template tag renders a template for the specified field-level check.
{% field path:|tender.documents.format| template:|...| }
Argument |
Value |
Required |
How to determine the value |
---|---|---|---|
|
The path to the field |
✔️ |
The value in the “field path” column of the field-level checks table |
|
The Google Docs ID of the field-level check template |
The machine-readable path component in the Google Docs URL |
The field
template tag has leaf tags as sub-tags.
All sub-tags except path
require a level
argument, which must be one of:
coverage
(unavailable forname
anddescription
)coverageSet
coverageEmpty
quality
path¶
Renders the path to the field, like tender.documents.format
.
{% path %}
name¶
Renders the name of the test, indicated by the level
argument.
For example, if a field
template tag sets path:|tender.documents.format|
:
{% name level:|quality| %}
will render:
Document format is recognized
description¶
Renders the description of the test, indicated by the level
argument.
For example, if a field
template tag sets path:|tender.documents.format|
:
{% description level:|quality| %}
will render:
The value is a string and is either an IANA Media Type or the ‘offline/print’ code. (The codelist is open.)
resultBoxImage¶
Renders a horizontal bar plot describing the pass/fail rate of the test, indicated by the level
argument.
{% resultBoxImage level:|quality| %}
resource template tag¶
Note
“resource” is “compiled release” in the web report.
This template tag renders a template for the specified compiled release-level check.
{% resource check:|coherent.dates| template:|...| }
Argument |
Value |
Required |
How to determine the value |
---|---|---|---|
|
The name of the check |
✔️ |
The last part of the URL when viewing the check |
|
The Google Docs ID of the compiled release-level check template |
The machine-readable path component in the Google Docs URL |
The resource
template tag has leaf tags as sub-tags.
Simple leaf tags¶
Simple tags accept no arguments.
Tag |
Renders |
---|---|
|
the name of the check |
|
the description of the check |
|
the number of times the test ran |
|
the number of times the test passed |
|
the number of times the test failed |
|
the number of times the test was skipped |
|
a horizontal bar plot describing the pass/fail/not applicable rate of the test |
Sample leaf tags¶
Renders a sample list of OCIDs that passed (or failed, or skipped) the test.
{% passedExamples mode:|multipleLines| max:|5| %}
{% failedExamples mode:|multipleLines| max:|5| %}
{% notAvailableExamples mode:|multipleLines| max:|5| %}
Argument |
Value |
Required |
---|---|---|
|
One of:
|
|
|
The maximum sample size |
dataset template tag¶
Note
“dataset” is “collection” in the web report.
This template tag renders a template for the specified dataset-level check.
{% dataset check:|distribution.tender_value| template:|...| }
Argument |
Value |
Required |
How to determine the value |
---|---|---|---|
|
The name of the check |
✔️ |
The last part of the URL when viewing the check |
|
The Google Docs ID of the dataset-level check template |
The machine-readable path component in the Google Docs URL |
The dataset
template tag has leaf tags as sub-tags.
The available tags vary, depending on the type of check.
Code distribution checks¶
count¶
Renders the number of cases in which the field equals the value
.
If value
isn’t set, renders the number of occurrences of the field.
{% count value:|open| %}
examples¶
Renders a sample list of OCIDs in which the field equals the value
.
If value
isn’t set, renders a sample list of OCIDs in which the field occurs.
{% examples value:|1| mode:|multipleLines| max:|5| %}
resultBoxImage¶
Renders a horizontal bar plot describing the number of occurrences of each field value.
{% resultBoxImage %}
Value distribution checks¶
share¶
Renders the percentage of the total value of all amounts represented by the total value of the amounts in the percentile range indicated by the percentageRange
argument.
0-1
(total value of the top 0-1% of amounts) / (total value of all amounts)
1-5
(total value of the top 1-5% of amounts) / (total value of all amounts)
5-20
(total value of the top 5-20% of amounts) / (total value of all amounts)
20-50
(total value of the top 20-50% of amounts) / (total value of all amounts)
50-100
(total value of the top 50-100% of amounts) / (total value of all amounts)
If percentageRange
isn’t set, renders 100%.
{% share percentageRange:|50-100| decimals:|2| %}
Argument |
Value |
Required |
---|---|---|
|
One of 0-1, 1-5, 5-20, 20-50, 50-100 |
|
|
The number of decimals (default 0) |
count¶
Renders the number of amounts in the percentile range indicated by the percentageRange
argument.
If value
isn’t set, renders the total number of amounts.
{% count percentageRange:|50-100| %}
examples¶
Note
Pelican backend stores at most 10 samples per percentile range.
Renders a sample list of OCIDs in which an amount is within the percentile range indicated by the percentageRange
argument.
If percentageRange
isn’t set, renders a sample list of OCIDs in which an amount occurs.
{% examples percentageRange:|1| mode:|multipleLines| max:|5| %}
sum¶
Renders the total value of the amounts in the percentile range indicated by the percentageRange
argument.
if percentageRange
isn’t set, renders the total value of all amounts.
{% sum percentageRange:|50-100| %}
resultBoxImage¶
Renders a horizontal bar plot describing the number of amounts in each percentile range.
{% resultBoxImage %}
Value repetition checks¶
share¶
Renders the percentage of values in which the amount-currency pair at the specified rank
occurs.
If rank
isn’t set, renders 100%.
{% share rank:|1| decimals:|2| %}
Argument |
Value |
Required |
---|---|---|
|
One of 1, 2, 3, 4, 5 |
|
|
The number of decimals (default 0) |
count¶
Renders the number of values in which the amount-currency pair at the specified rank
occurs.
If rank
isn’t set, renders the number of values in which the 5 most frequent pairs occur.
{% count rank:|1| %}
examples¶
Renders a sample list of OCIDs in which the amount-currency pair at the specified rank
occurs.
If rank
isn’t set, renders a sample list of OCIDs in which the 5 most frequent pairs occur.
{% examples rank:|1| mode:|multipleLines| max:|5| %}
amount¶
Renders the amount-currency pair (like “10000 USD”) at the specified rank
(required argument).
{% amount rank:|1| %}
resultBoxImage¶
Renders a table with the 5 most frequent amount-currency pairs with the columns:
- Value
the amount and currency
- Share
the percentage of values in which the pair occurs
- Occurrences
the number of values in which the pair occurs
{% resultBoxImage %}
Buyer distribution check¶
buyerCount¶
Renders the number of unique buyers that occur the countRange
number of times.
1
the number of unique buyers that occur only once
2-20
the number of unique buyers that occur 2-20 times
21-50
the number of unique buyers that occur 21-50 times
51-100
the number of unique buyers that occur 51-100 times
100+
the number of unique buyers that occur 100+ times
If countRange
isn’t set, renders the total number of unique buyers (same as {% totalBuyerCount %}
).
{% buyerCount countRange:|2-20| %}
ocidCount¶
Renders the number of OCIDs in which the buyer occurs the countRange
number of times.
If countRange
isn’t set, renders the total number of OCIDs (same as {% totalOcidCount %}
).
{% ocidCount countRange:|2-20| %}
Simple leaf tags¶
Tag |
Renders |
---|---|
|
the number of unique buyers for which the |
|
the number of OCIDs in which the buyer’s |
|
a sample list of OCIDs in which the buyer occurs in only that OCID |
Buyer repetition check¶
These include simple and sample leaf tags.
Tag |
Renders |
---|---|
|
the most common buyer’s |
|
the most common buyer’s |
|
the number of OCIDs in which the most common buyer occurs |
|
the percentage of OCIDs in which the most common buyer occurs |
|
the number of OCIDs in which the buyer’s |
|
a sample list of OCIDs in which the most common buyer occurs |
Other checks¶
These include simple and sample leaf tags.
Tag |
Renders |
---|---|
|
the number of times the test was run |
|
the number of times the test passed |
|
the number of times the test failed |
|
a horizontal bar plot describing the pass/fail rate of the test |
|
a sample list of OCIDs that passed the test |
|
a sample list of OCIDs that failed the test |