tooluniverse.graphql_tool module

tooluniverse.graphql_tool.validate_query(query_str, schema_str)[source]
tooluniverse.graphql_tool.remove_none_and_empty_values(json_obj)[source]

Remove all key-value pairs where the value is None or an empty list

tooluniverse.graphql_tool.execute_query(endpoint_url, query, variables=None)[source]
class tooluniverse.graphql_tool.GraphQLTool[source]

Bases: BaseTool

__init__(tool_config, endpoint_url)[source]
run(arguments)[source]

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.

class tooluniverse.graphql_tool.OpentargetTool[source]

Bases: GraphQLTool

__init__(tool_config)[source]
run(arguments)[source]

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.

class tooluniverse.graphql_tool.OpentargetToolDrugNameMatch[source]

Bases: GraphQLTool

__init__(tool_config, drug_generic_tool=None)[source]
run(arguments)[source]

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.

class tooluniverse.graphql_tool.OpentargetGeneticsTool[source]

Bases: GraphQLTool

__init__(tool_config)[source]
class tooluniverse.graphql_tool.DiseaseTargetScoreTool[source]

Bases: GraphQLTool

Tool to extract disease-target association scores from specific data sources

__init__(tool_config, datasource_id=None)[source]
run(arguments)[source]

Extract disease-target scores for a specific datasource Arguments should contain: efoId, datasourceId (optional), pageSize (optional)