Skip to content

Commit

Permalink
Move instructions from script to readme. Skip ppp extension as it rem…
Browse files Browse the repository at this point in the history
…oves fields.
  • Loading branch information
jpmckinney committed Aug 30, 2019
1 parent aabfeae commit d6ba5e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,20 @@ You can now generate a table for each form, displaying, for each element and att
for i in 01 02 03 04 05 06 07 08 12 13 14 15 20 21 22 23 24 25; rake table LANGUAGE=EN FILES=F$i > path/to/european-union/docs/F$i.md; end
for i in 01 02; rake table LANGUAGE=EN FILES=MOVE FORM=T$i > path/to/european-union/docs/T$i.md; end

### Find fields for which to write extensions

Generate a release schema with all extensions applied, except the PPP extension (which removes fields):

python scripts/patched_release_schema.py > scripts/release-schema-patched.json

Generate a CSV file with all fields from the extended schema, including a column for the extension name:

ocdskit mapping-sheet --infer-required --extension-field extension scripts/release-schema-patched.json > scripts/mapping-sheet.csv

Print a list of fields for which there are no extensions:

python scripts/mapped_ocds_fields.py

## Design

* Label keys are expected to change less frequently than labels. The code therefore focuses on label keys.
Expand Down
8 changes: 3 additions & 5 deletions scripts/patched_release_schema.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
"""
python scripts/patched_release_schema.py > scripts/release-schema-patched.json
ocdskit mapping-sheet --infer-required --extension-field extension release-schema-patched.json > scripts/mapping-sheet.csv
"""

import json
import sys

Expand All @@ -13,9 +8,12 @@

url = 'https://raw.githubusercontent.com/open-contracting/extension_registry/master/extension_versions.csv'
for version in ExtensionRegistry(url):
if version.id == 'ppp': # PPP extension deletes core fields
continue
if version.id not in extensions:
extensions[version.id] = []
extensions[version.id].append(version)

urls = [get_latest_version(versions).download_url for versions in extensions.values()]

# TODO: Uncomment extensions once PRs merged.
Expand Down

0 comments on commit d6ba5e6

Please sign in to comment.