Extension Version

class ocdsextensionregistry.extension_version.ExtensionVersion(data)[source]
__init__(data)[source]

Accepts a row from extension_versions.csv and assigns values to properties.

__repr__()[source]

Return repr(self).

update(other)[source]

Merges in the properties of another Extension or ExtensionVersion object.

as_dict()[source]

Returns the object’s public properties as a dictionary.

get_url(basename)[source]

Returns the URL of the file within the extension.

remote(basename)[source]

Returns the contents of the file within the extension.

If the extension has a download URL, caches all the files’ contents. Otherwise, downloads and caches the requested file’s contents. Raises an HTTPError if a download fails.

Raises:DoesNotExist – if the file isn’t in the extension
files

Returns the unparsed contents of all files. Decodes the contents of CSV, JSON and Markdown files.

If the extension has a download URL, caches all the files’ contents. Otherwise, returns an empty dict. Raises an HTTPError if the download fails.

zipfile()[source]

If the extension has a download URL, downloads and returns the ZIP archive.

Raises:NotAvailableInBulk – if the extension has no download URL
metadata

Retrieves and returns the parsed contents of the extension’s extension.json file.

Adds language maps if not present.

schemas

Retrieves and returns the parsed contents of the extension’s schemas files.

codelists

Retrieves and returns the parsed contents of the extension’s codelists files.

If the extension has no download URL, and if no codelists are listed in extension.json, returns an empty dict.

repository_full_name

Returns the full name of the extension’s repository, which should be a unique identifier on the hosting service, e.g. open-contracting-extensions/ocds_bid_extension

Experimental

repository_name

Returns the short name of the extension’s repository, i.e. omitting any organizational prefix, which can be used to create directories, e.g. ocds_bid_extension

Experimental

repository_user

Returns the user or organization to which the extension’s repository belongs, e.g. open-contracting-extensions

Experimental

repository_user_page

Returns the URL to the landing page of the user or organization to which the extension’s repository belongs, e.g. https://github.com/open-contracting-extensions

Experimental

repository_html_page

Returns the URL to the landing page of the extension’s repository, e.g. https://github.com/open-contracting-extensions/ocds_bid_extension

Experimental

repository_url

Returns the URL of the extension’s repository, in a format that can be input to a VCS program without modification, e.g. https://github.com/open-contracting-extensions/ocds_bid_extension.git

Experimental