OC4IDS

ocdskit.oc4ids.check_type(item, item_type)[source]

Check type and if incorrect return empty version of type so that future processing works with bad data. Should be used with dicts or lists that are then accessed later.

ocdskit.oc4ids.cast_number_or_zero(item)[source]

Cast to decimal if fail return 0 so summing still works.

ocdskit.oc4ids.cast_string(item)[source]

Cast to string if possible. Does not try to convert dict, list, or None to string. Returns empty string on failure so future processing works.

ocdskit.oc4ids.run_transforms(config, releases, project_id=None, records=None, output=None)[source]

Transforms a list of OCDS releases into a OC4IDS project.

Parameters:
  • config (dict) – contains optional tranform options.
  • releases (list) – list of OCDS releases or release packages
  • project_id (string) – project ID of resulting project
  • records (list) – pre computed list of records
  • output (dict) – initial project output template project where transformed data will be added
class ocdskit.oc4ids.InitialTransformState(releases_or_release_packages, project_id=None, records=None, output=None)[source]
party_analysis()[source]
ocdskit.oc4ids.copy_party_to_party_list(state, party)[source]
ocdskit.oc4ids.copy_party_by_role(state, role, new_roles=None)[source]
ocdskit.oc4ids.copy_document(state, document)[source]

Copies a document. If it finds clashing ids change ids to autoincrement numbers

ocdskit.oc4ids.copy_document_by_type(state, documents, document_type)[source]

Copies documents of specific documentType from planning.documents to documents

ocdskit.oc4ids.concat_ocid_and_string(state, path_to_string)[source]

Places the ocid of a release in front of a string (eg. description or title) so that it can be joined unambiguously with others, separated by new lines

ocdskit.oc4ids.public_authority_role(state)[source]

CoST IDS element: Project owner

ocdskit.oc4ids.buyer_role(state)[source]

CoST IDS element: Project owner

ocdskit.oc4ids.sector(state)[source]

CoST IDS element: Sector

ocdskit.oc4ids.additional_classifications(state)[source]

CoST IDS element: Subsector

ocdskit.oc4ids.title(state)[source]

CoST IDS element: Project name

ocdskit.oc4ids.title_from_tender(state)[source]

CoST IDS element: Project name

ocdskit.oc4ids.contracting_process_setup(state)[source]

This will initailly create the contracting process objects and the summary object within. All transforms that use contracting processes need to run this tranform first.

ocdskit.oc4ids.procuring_entity(state)[source]

CoST IDS element: Procuring entity

ocdskit.oc4ids.administrative_entity(state)[source]

CoST IDS element: Contract administrative entity

ocdskit.oc4ids.contract_status(state)[source]

CoST IDS element: Contract status

ocdskit.oc4ids.procurement_process(state)[source]

CoST IDS element: Procurement process

ocdskit.oc4ids.number_of_tenderers(state)[source]

CoST IDS element: Number of firms tendering

ocdskit.oc4ids.location(state)[source]

CoST IDS element: Project location

ocdskit.oc4ids.location_from_items(state)[source]

CoST IDS element: Project location

ocdskit.oc4ids.budget(state)[source]

CoST IDS element: Budget

ocdskit.oc4ids.budget_approval(state)[source]

CoST IDS element: Project budget approval date

ocdskit.oc4ids.environmental_impact(state)[source]

CoST IDS element: Environmental impact

ocdskit.oc4ids.land_and_settlement_impact(state)[source]

CoST IDS element: Land and settlement impact

ocdskit.oc4ids.purpose(state)[source]

CoST IDS element: Purpose

ocdskit.oc4ids.purpose_needs_assessment(state)[source]

CoST IDS element: Purpose

ocdskit.oc4ids.description(state)[source]

CoST IDS element: Project description

ocdskit.oc4ids.description_tender(state)[source]

CoST IDS element: Project description

ocdskit.oc4ids.funding_sources(state)[source]

CoST IDS element: Funding sources

ocdskit.oc4ids.cost_estimate(state)[source]

CoST IDS element: Cost estimate

ocdskit.oc4ids.contract_title(state)[source]

CoST IDS element: Contract title

ocdskit.oc4ids.suppliers(state)[source]

CoST IDS element: Contract firm(s)

ocdskit.oc4ids.contract_price(state)[source]

CoST IDS element: Contract price

ocdskit.oc4ids.contract_process_description(state)[source]

CoST IDS element: Contract scope of work

ocdskit.oc4ids.contract_period(state)[source]

CoST IDS element: Contract start date and contract period (duration)

ocdskit.oc4ids.project_scope(state)[source]

CoST IDS element: Project Scope (main output) and Project Scope (projected)

ocdskit.oc4ids.project_scope_summary(state)[source]

CoST IDS element: Project Scope (main output)

ocdskit.oc4ids.final_audit(state)[source]

CoST IDS element: Reference to audit and evaluation reports