sbmlutils.report.api

API for the sbmlreport web service.

This provides basic functionality of parsing the model and returning the JSON representation based on fastAPI.

Module Contents

Functions

examples()

Get examples for reports.

example(example_id)

Get specific example.

report_from_file(request)

Upload file and return JSON report.

report_from_url(url)

Get JSON report via URL.

get_report_from_content(request)

Get JSON report from file contents.

json_for_omex(omex_path)

Create json for omex path.

json_for_sbml(uid, source)

Create JSON content for given SBML source.

_handle_error(e[, info])

Handle exceptions in the backend.

get_annotation_resource(resource)

Get information for annotation_resource.

Attributes

logger

api

origins

sbmlutils.report.api.logger[source]
sbmlutils.report.api.api[source]
sbmlutils.report.api.origins = ['*'][source]
sbmlutils.report.api.examples()[source]

Get examples for reports.

Return type

Dict[Any, Any]

sbmlutils.report.api.example(example_id)[source]

Get specific example.

Parameters

example_id (str) –

Return type

Dict[Any, Any]

async sbmlutils.report.api.report_from_file(request)[source]

Upload file and return JSON report.

Parameters

request (fastapi.Request) –

Return type

Dict[Any, Any]

sbmlutils.report.api.report_from_url(url)[source]

Get JSON report via URL.

Parameters

url (str) –

Return type

Dict[Any, Any]

async sbmlutils.report.api.get_report_from_content(request)[source]

Get JSON report from file contents.

Parameters

request (fastapi.Request) –

Return type

Dict[Any, Any]

sbmlutils.report.api.json_for_omex(omex_path)[source]

Create json for omex path.

Path can be either Omex or an SBML file.

Parameters

omex_path (pathlib.Path) –

Return type

Dict[str, Any]

sbmlutils.report.api.json_for_sbml(uid, source)[source]

Create JSON content for given SBML source.

Source is either path to SBML file or SBML string.

Parameters
  • uid (str) –

  • source (Union[pathlib.Path, str, bytes]) –

Return type

Dict

sbmlutils.report.api._handle_error(e, info=None)[source]

Handle exceptions in the backend.

All calls are wrapped in a try/except which will provide the errors to the frontend.

Parameters
  • info (Optional[Dict]) – optional dictionary with information.

  • e (Exception) –

Return type

Dict[Any, Any]

sbmlutils.report.api.get_annotation_resource(resource)[source]

Get information for annotation_resource.

Used to resolve annotation information.

Parameters

resource (str) – unique identifier of resource (url or miriam urn)

Returns

Response

Return type

Dict[Any, Any]