Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8116fda 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Sep 22, 2024
1 parent c257e74 commit 7f74d11
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 18 deletions.
Binary file modified .doctrees/client.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
51 changes: 35 additions & 16 deletions _modules/pyroclient/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ <h1>Source code for pyroclient.client</h1><div class="highlight"><pre>
<span class="c1"># CAMERAS</span>
<span class="c1">#################</span>
<span class="s2">&quot;cameras-heartbeat&quot;</span><span class="p">:</span> <span class="s2">&quot;/cameras/heartbeat&quot;</span><span class="p">,</span>
<span class="s2">&quot;cameras-image&quot;</span><span class="p">:</span> <span class="s2">&quot;/cameras/image&quot;</span><span class="p">,</span>
<span class="s2">&quot;cameras-fetch&quot;</span><span class="p">:</span> <span class="s2">&quot;/cameras&quot;</span><span class="p">,</span>
<span class="c1">#################</span>
<span class="c1"># DETECTIONS</span>
Expand Down Expand Up @@ -307,6 +308,22 @@ <h1>Source code for pyroclient.client</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;Authorization&quot;</span><span class="p">:</span> <span class="sa">f</span><span class="s2">&quot;Bearer </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">token</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">}</span>

<span class="c1"># CAMERAS</span>
<div class="viewcode-block" id="Client.fetch_cameras"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.fetch_cameras">[docs]</a> <span class="k">def</span> <span class="nf">fetch_cameras</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Response</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;List the cameras accessible to the authenticated user</span>

<span class="sd"> &gt;&gt;&gt; from pyroclient import client</span>
<span class="sd"> &gt;&gt;&gt; api_client = Client(&quot;MY_USER_TOKEN&quot;)</span>
<span class="sd"> &gt;&gt;&gt; response = api_client.fetch_cameras()</span>

<span class="sd"> Returns:</span>
<span class="sd"> HTTP response</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">routes</span><span class="p">[</span><span class="s2">&quot;cameras-fetch&quot;</span><span class="p">],</span>
<span class="n">headers</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">headers</span><span class="p">,</span>
<span class="n">timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timeout</span><span class="p">,</span>
<span class="p">)</span></div>

<div class="viewcode-block" id="Client.heartbeat"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.heartbeat">[docs]</a> <span class="k">def</span> <span class="nf">heartbeat</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Response</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Update the last ping of the camera</span>

Expand All @@ -319,6 +336,24 @@ <h1>Source code for pyroclient.client</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">requests</span><span class="o">.</span><span class="n">patch</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">routes</span><span class="p">[</span><span class="s2">&quot;cameras-heartbeat&quot;</span><span class="p">],</span> <span class="n">headers</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">headers</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timeout</span><span class="p">)</span></div>

<div class="viewcode-block" id="Client.update_last_image"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.update_last_image">[docs]</a> <span class="k">def</span> <span class="nf">update_last_image</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">media</span><span class="p">:</span> <span class="nb">bytes</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Response</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Update the last image of the camera</span>

<span class="sd"> &gt;&gt;&gt; from pyroclient import Client</span>
<span class="sd"> &gt;&gt;&gt; api_client = Client(&quot;MY_CAM_TOKEN&quot;)</span>
<span class="sd"> &gt;&gt;&gt; with open(&quot;path/to/my/file.ext&quot;, &quot;rb&quot;) as f: data = f.read()</span>
<span class="sd"> &gt;&gt;&gt; response = api_client.update_last_image(data)</span>

<span class="sd"> Returns:</span>
<span class="sd"> HTTP response containing the update device info</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">requests</span><span class="o">.</span><span class="n">patch</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">routes</span><span class="p">[</span><span class="s2">&quot;cameras-image&quot;</span><span class="p">],</span>
<span class="n">headers</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">headers</span><span class="p">,</span>
<span class="n">files</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;file&quot;</span><span class="p">:</span> <span class="p">(</span><span class="s2">&quot;logo.png&quot;</span><span class="p">,</span> <span class="n">media</span><span class="p">,</span> <span class="s2">&quot;image/png&quot;</span><span class="p">)},</span>
<span class="n">timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timeout</span><span class="p">,</span>
<span class="p">)</span></div>

<span class="c1"># DETECTIONS</span>
<div class="viewcode-block" id="Client.create_detection"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.create_detection">[docs]</a> <span class="k">def</span> <span class="nf">create_detection</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
Expand Down Expand Up @@ -375,22 +410,6 @@ <h1>Source code for pyroclient.client</h1><div class="highlight"><pre>
<span class="n">timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timeout</span><span class="p">,</span>
<span class="p">)</span></div>

<div class="viewcode-block" id="Client.fetch_cameras"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.fetch_cameras">[docs]</a> <span class="k">def</span> <span class="nf">fetch_cameras</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Response</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;List the cameras accessible to the authenticated user</span>

<span class="sd"> &gt;&gt;&gt; from pyroclient import client</span>
<span class="sd"> &gt;&gt;&gt; api_client = Client(&quot;MY_USER_TOKEN&quot;)</span>
<span class="sd"> &gt;&gt;&gt; response = api_client.fetch_cameras()</span>

<span class="sd"> Returns:</span>
<span class="sd"> HTTP response</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">routes</span><span class="p">[</span><span class="s2">&quot;cameras-fetch&quot;</span><span class="p">],</span>
<span class="n">headers</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">headers</span><span class="p">,</span>
<span class="n">timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">timeout</span><span class="p">,</span>
<span class="p">)</span></div>

<div class="viewcode-block" id="Client.get_detection_url"><a class="viewcode-back" href="../../client.html#pyroclient.client.Client.get_detection_url">[docs]</a> <span class="k">def</span> <span class="nf">get_detection_url</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">detection_id</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Response</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Retrieve the URL of the media linked to a detection</span>

Expand Down
18 changes: 18 additions & 0 deletions client.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,23 @@ <h2>API Client<a class="headerlink" href="#api-client" title="Permalink to this
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyroclient.client.Client.update_last_image">
<span class="sig-name descname"><span class="pre">update_last_image</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">media</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bytes</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Response</span></span></span><a class="reference internal" href="_modules/pyroclient/client.html#Client.update_last_image"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pyroclient.client.Client.update_last_image" title="Permalink to this definition">#</a></dt>
<dd><p>Update the last image of the camera</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyroclient</span> <span class="kn">import</span> <span class="n">Client</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">api_client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="s2">&quot;MY_CAM_TOKEN&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&quot;path/to/my/file.ext&quot;</span><span class="p">,</span> <span class="s2">&quot;rb&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span> <span class="n">data</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">response</span> <span class="o">=</span> <span class="n">api_client</span><span class="o">.</span><span class="n">update_last_image</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>HTTP response containing the update device info</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
Expand Down Expand Up @@ -453,6 +470,7 @@ <h2>API Client<a class="headerlink" href="#api-client" title="Permalink to this
<li><a class="reference internal" href="#pyroclient.client.Client.get_detection_url"><code class="docutils literal notranslate"><span class="pre">Client.get_detection_url()</span></code></a></li>
<li><a class="reference internal" href="#pyroclient.client.Client.heartbeat"><code class="docutils literal notranslate"><span class="pre">Client.heartbeat()</span></code></a></li>
<li><a class="reference internal" href="#pyroclient.client.Client.label_detection"><code class="docutils literal notranslate"><span class="pre">Client.label_detection()</span></code></a></li>
<li><a class="reference internal" href="#pyroclient.client.Client.update_last_image"><code class="docutils literal notranslate"><span class="pre">Client.update_last_image()</span></code></a></li>
</ul>
</li>
</ul>
Expand Down
12 changes: 11 additions & 1 deletion genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@

<section class="genindex-section">
<h1 id="index">Index</h1>
<div class="genindex-jumpbox"><a href="#C"><strong>C</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#L"><strong>L</strong></a></div>
<div class="genindex-jumpbox"><a href="#C"><strong>C</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#U"><strong>U</strong></a></div>
</section>
<section id="C" class="genindex-section">
<h2>C</h2>
Expand Down Expand Up @@ -267,6 +267,16 @@ <h2>L</h2>
</tr></table>
</section>

<section id="U" class="genindex-section">
<h2>U</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="client.html#pyroclient.client.Client.update_last_image">update_last_image() (pyroclient.client.Client method)</a>
</li>
</ul></td>
</tr></table>
</section>


</article>
</div>
Expand Down
Binary file modified objects.inv
Binary file not shown.
Loading

0 comments on commit 7f74d11

Please sign in to comment.