Skip to content

Commit

Permalink
Update entrypoint for /login page and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Dec 5, 2023
1 parent 43d56bf commit 90c35a7
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 22 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ python -m pip install stream-localhost

## Usage
```python
import os
import pystream

if __name__ == '__main__':
pystream.start()
kwargs = dict(
username="foo",
password="bar",
video_source=os.path.join(os.path.expanduser('~'), 'Downloads'),
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
```

### Env Variables
Expand Down
12 changes: 10 additions & 2 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@ <h2>Install<a class="headerlink" href="#install" title="Permalink to this headin
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pystream</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">pystream</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
<span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="n">kwargs</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span>
<span class="n">username</span><span class="o">=</span><span class="s2">&quot;foo&quot;</span><span class="p">,</span>
<span class="n">password</span><span class="o">=</span><span class="s2">&quot;bar&quot;</span><span class="p">,</span>
<span class="n">video_source</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">expanduser</span><span class="p">(</span><span class="s1">&#39;~&#39;</span><span class="p">),</span> <span class="s1">&#39;Downloads&#39;</span><span class="p">),</span>
<span class="p">)</span>
<span class="c1"># Add the following to host on local IP address, skip for localhost (127.0.0.1)</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;video_host&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">pystream</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">get_local_ip</span><span class="p">()</span>
<span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
</pre></div>
</div>
<section id="env-variables">
Expand Down
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ python -m pip install stream-localhost

## Usage
```python
import os
import pystream

if __name__ == '__main__':
pystream.start()
kwargs = dict(
username="foo",
password="bar",
video_source=os.path.join(os.path.expanduser('~'), 'Downloads'),
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
```

### Env Variables
Expand Down
10 changes: 9 additions & 1 deletion docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ python -m pip install stream-localhost

## Usage
```python
import os
import pystream

if __name__ == '__main__':
pystream.start()
kwargs = dict(
username="foo",
password="bar",
video_source=os.path.join(os.path.expanduser('~'), 'Downloads'),
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
kwargs["video_host"] = pystream.utils.get_local_ip()
pystream.start(**kwargs)
```

### Env Variables
Expand Down
8 changes: 4 additions & 4 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ <h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.FileIO.index">index (pystream.models.config.FileIO attribute)</a>
</li>
<li><a href="index.html#pystream.routers.auth.index">index() (in module pystream.routers.auth)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.Static.index_endpoint">index_endpoint (pystream.models.config.Static attribute)</a>
</li>
<li><a href="index.html#pystream.models.config.Session.info">info (pystream.models.config.Session attribute)</a>
</li>
</ul></td>
Expand All @@ -148,13 +152,9 @@ <h2 id="L">L</h2>
<li><a href="index.html#pystream.models.config.FileIO.list_files">list_files (pystream.models.config.FileIO attribute)</a>
</li>
<li><a href="index.html#pystream.models.squire.log_connection">log_connection() (in module pystream.models.squire)</a>
</li>
<li><a href="index.html#pystream.routers.auth.login">login() (in module pystream.routers.auth)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.Static.login_endpoint">login_endpoint (pystream.models.config.Static attribute)</a>
</li>
<li><a href="index.html#pystream.routers.auth.logout">logout() (in module pystream.routers.auth)</a>
</li>
<li><a href="index.html#pystream.models.config.Static.logout_endpoint">logout_endpoint (pystream.models.config.Static attribute)</a>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"

<dl class="py class">
<dt class="sig sig-object py" id="pystream.models.config.Static">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.models.config.</span></span><span class="sig-name descname"><span class="pre">Static</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vault</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'stream'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">query_param</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'file'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">login_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/login'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logout_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/logout'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">streaming_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/video'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1048576</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pystream.models.config.Static" title="Permalink to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.models.config.</span></span><span class="sig-name descname"><span class="pre">Static</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vault</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'stream'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">query_param</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'file'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/index'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logout_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/logout'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">streaming_endpoint</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'/video'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1048576</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pystream.models.config.Static" title="Permalink to this definition"></a></dt>
<dd><p>Object to store static values.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Static</span>
</pre></div>
Expand All @@ -264,8 +264,8 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pystream.models.config.Static.login_endpoint">
<span class="sig-name descname"><span class="pre">login_endpoint</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#pystream.models.config.Static.login_endpoint" title="Permalink to this definition"></a></dt>
<dt class="sig sig-object py" id="pystream.models.config.Static.index_endpoint">
<span class="sig-name descname"><span class="pre">index_endpoint</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#pystream.models.config.Static.index_endpoint" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
Expand Down Expand Up @@ -456,8 +456,8 @@ <h1>Routers<a class="headerlink" href="#routers" title="Permalink to this headin
<section id="module-pystream.routers.auth">
<span id="authentication"></span><h1>Authentication<a class="headerlink" href="#module-pystream.routers.auth" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="pystream.routers.auth.login">
<em class="property"><span class="k"><span class="pre">async</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.routers.auth.</span></span><span class="sig-name descname"><span class="pre">login</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">HTTPBasicCredentials</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">Depends(HTTPBasic)</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">TemplateResponse</span></span></span><a class="headerlink" href="#pystream.routers.auth.login" title="Permalink to this definition"></a></dt>
<dt class="sig sig-object py" id="pystream.routers.auth.index">
<em class="property"><span class="k"><span class="pre">async</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.routers.auth.</span></span><span class="sig-name descname"><span class="pre">index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">HTTPBasicCredentials</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">Depends(HTTPBasic)</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">TemplateResponse</span></span></span><a class="headerlink" href="#pystream.routers.auth.index" title="Permalink to this definition"></a></dt>
<dd><p>Login request handler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit 90c35a7

Please sign in to comment.