mirror of
https://github.com/NetherlandsForensicInstitute/hansken-extraction-plugin-sdk-documentation.git
synced 2026-05-07 10:46:32 +00:00
225 lines
17 KiB
HTML
225 lines
17 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" data-content_root="../../../">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>hansken_extraction_plugin.api.search_result — Hansken Extraction Plugins for plugin developers 0.9.16
|
||
documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=d75fae25" />
|
||
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
||
<link rel="stylesheet" type="text/css" href="../../../_static/wider_pages.css?v=32ad70ab" />
|
||
|
||
|
||
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
||
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="../../../_static/documentation_options.js?v=433a2a34"></script>
|
||
<script src="../../../_static/doctools.js?v=9a2dae69"></script>
|
||
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="../../../_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||
<link rel="search" title="Search" href="../../../search.html" />
|
||
<link rel="next" title="hansken_extraction_plugin.api.search_sort_option" href="hansken_extraction_plugin.api.search_sort_option.html" />
|
||
<link rel="prev" title="hansken_extraction_plugin.api.plugin_info" href="hansken_extraction_plugin.api.plugin_info.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="../../../index.html" class="icon icon-home">
|
||
Hansken Extraction Plugins for plugin developers
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="../../introduction.html">Introduction</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../concepts.html">General concepts</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../spec.html">Extraction Plugin specifications</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../java.html">Java</a></li>
|
||
<li class="toctree-l1 current"><a class="reference internal" href="../../python.html">Python</a><ul class="current">
|
||
<li class="toctree-l2"><a class="reference internal" href="../api_changelog.html">Python API Changelog</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../prerequisites.html">Prerequisites</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../getting_started.html">Getting started</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../packaging.html">Packaging</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../snippets.html">Python code snippets</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../transformers.html">Using Transformers for on-demand execution</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../testing.html">Advanced use of the Test Framework in Python</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../hanskenpy.html">Run plugins with Hansken.py</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="../debugging.html">How to debug an Extraction Plugin</a></li>
|
||
<li class="toctree-l2 current"><a class="reference internal" href="../../python.html#api-documentation">API Documentation</a><ul class="current">
|
||
<li class="toctree-l3 current"><a class="reference internal" href="hansken_extraction_plugin.api.html">hansken_extraction_plugin.api</a><ul class="current">
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.data_context.html">hansken_extraction_plugin.api.data_context</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.extraction_plugin.html">hansken_extraction_plugin.api.extraction_plugin</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.extraction_trace.html">hansken_extraction_plugin.api.extraction_trace</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.plugin_info.html">hansken_extraction_plugin.api.plugin_info</a></li>
|
||
<li class="toctree-l4 current"><a class="current reference internal" href="#">hansken_extraction_plugin.api.search_result</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.search_sort_option.html">hansken_extraction_plugin.api.search_sort_option</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.trace_searcher.html">hansken_extraction_plugin.api.trace_searcher</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.tracelet.html">hansken_extraction_plugin.api.tracelet</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.transformation.html">hansken_extraction_plugin.api.transformation</a></li>
|
||
<li class="toctree-l4"><a class="reference internal" href="hansken_extraction_plugin.api.transformer.html">hansken_extraction_plugin.api.transformer</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../examples.html">Examples</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../faq.html">Frequently Asked Questions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../../contact.html">Contact</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../../changes.html">Changelog</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="../../../index.html">Hansken Extraction Plugins for plugin developers</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item"><a href="../../python.html">Python</a></li>
|
||
<li class="breadcrumb-item"><a href="hansken_extraction_plugin.api.html">hansken_extraction_plugin.api</a></li>
|
||
<li class="breadcrumb-item active">hansken_extraction_plugin.api.search_result</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="../../../_sources/dev/python/api/hansken_extraction_plugin.api.search_result.rst.txt" rel="nofollow"> View page source</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="module-hansken_extraction_plugin.api.search_result">
|
||
<span id="hansken-extraction-plugin-api-search-result"></span><h1>hansken_extraction_plugin.api.search_result<a class="headerlink" href="#module-hansken_extraction_plugin.api.search_result" title="Link to this heading"></a></h1>
|
||
<p>This module contains a representation of a search result.</p>
|
||
<p class="rubric">Classes</p>
|
||
<table class="autosummary longtable docutils align-default">
|
||
<tbody>
|
||
<tr class="row-odd"><td><p><a class="reference internal" href="#hansken_extraction_plugin.api.search_result.SearchResult" title="hansken_extraction_plugin.api.search_result.SearchResult"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SearchResult</span></code></a>()</p></td>
|
||
<td><p>Class representing a stream of traces, returned when performing a search request.</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="hansken_extraction_plugin.api.search_result.SearchResult">
|
||
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SearchResult</span></span><a class="reference internal" href="../../../_modules/hansken_extraction_plugin/api/search_result.html#SearchResult"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#hansken_extraction_plugin.api.search_result.SearchResult" title="Link to this definition"></a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ABC</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">Iterable</span></code></p>
|
||
<p>Class representing a stream of traces, returned when performing a search request.</p>
|
||
<p>This result can only be iterated once. Results can be retrieved in three ways:</p>
|
||
<p>Treating the result as an iterable:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">trace</span> <span class="ow">in</span> <span class="n">result</span><span class="p">:</span>
|
||
<span class="nb">print</span><span class="p">(</span><span class="n">trace</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Calling <cite>.take</cite> to process one or more batches of traces:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">first_100</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">take</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>
|
||
<span class="n">process_batch</span><span class="p">(</span><span class="n">first_100</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Calling <cite>.takeone</cite> to get a single trace:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">first</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">takeone</span><span class="p">()</span>
|
||
<span class="n">second</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">takeone</span><span class="p">()</span>
|
||
|
||
<span class="nb">print</span><span class="p">(</span><span class="n">first</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">second</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="hansken_extraction_plugin.api.search_result.SearchResult.total_results">
|
||
<em class="property"><span class="pre">abstract</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">total_results</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="reference internal" href="../../../_modules/hansken_extraction_plugin/api/search_result.html#SearchResult.total_results"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#hansken_extraction_plugin.api.search_result.SearchResult.total_results" title="Link to this definition"></a></dt>
|
||
<dd><p>Return the total number of hits.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>Total number of hits</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="hansken_extraction_plugin.api.search_result.SearchResult.takeone">
|
||
<span class="sig-name descname"><span class="pre">takeone</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="hansken_extraction_plugin.api.extraction_trace.html#hansken_extraction_plugin.api.extraction_trace.SearchTrace" title="hansken_extraction_plugin.api.extraction_trace.SearchTrace"><span class="pre">SearchTrace</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference internal" href="../../../_modules/hansken_extraction_plugin/api/search_result.html#SearchResult.takeone"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#hansken_extraction_plugin.api.search_result.SearchResult.takeone" title="Link to this definition"></a></dt>
|
||
<dd><p>Return a single trace, if this stream is not exhausted.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>A searchtrace, or None if no trace is available</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="hansken_extraction_plugin.api.search_result.SearchResult.take">
|
||
<span class="sig-name descname"><span class="pre">take</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="hansken_extraction_plugin.api.extraction_trace.html#hansken_extraction_plugin.api.extraction_trace.SearchTrace" title="hansken_extraction_plugin.api.extraction_trace.SearchTrace"><span class="pre">SearchTrace</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../../../_modules/hansken_extraction_plugin/api/search_result.html#SearchResult.take"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#hansken_extraction_plugin.api.search_result.SearchResult.take" title="Link to this definition"></a></dt>
|
||
<dd><p>Return a list containing at most num number of traces, or less if they are not available.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p><strong>num</strong> – Number of traces to take</p>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>List containing zero or more traces</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt class="sig sig-object py" id="hansken_extraction_plugin.api.search_result.SearchResult.close">
|
||
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/hansken_extraction_plugin/api/search_result.html#SearchResult.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#hansken_extraction_plugin.api.search_result.SearchResult.close" title="Link to this definition"></a></dt>
|
||
<dd><p>Close this SearchResult if no more traces are to be retrieved.</p>
|
||
<p>Required to keep compatibility with hansken.py.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="hansken_extraction_plugin.api.plugin_info.html" class="btn btn-neutral float-left" title="hansken_extraction_plugin.api.plugin_info" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
<a href="hansken_extraction_plugin.api.search_sort_option.html" class="btn btn-neutral float-right" title="hansken_extraction_plugin.api.search_sort_option" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2020-2026 Netherlands Forensic Institute.</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |