Skip to content

Commit

Permalink
#144 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Nov 20, 2024
1 parent bfad7b7 commit 720d511
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 78 deletions.
5 changes: 5 additions & 0 deletions httpserver/static/root/component/bottom-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<li><a class="dropdown-item"
href="https://senzing-garage.github.io/sz-sdk-python-abstract/">Senzing Python SDK
Documentation</a></li>
<li><a class="dropdown-item" href="#">Senzing Java SDK Documentation</a></li>
<li><a class="dropdown-item"
href="https://pkg.go.dev/github.com/senzing-garage/sz-sdk-go-grpc">Senzing Go SDK
Documentation</a></li>
<li><a class="dropdown-item" href="#">Senzing C# SDK Documentation</a></li>
</ul>
</li>
</ul>
Expand Down
10 changes: 10 additions & 0 deletions httpserver/static/root/component/install-python-package.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<p>
Prepare your Python environment by installing the <a href="https://pypi.org/project/senzing-grpc/">senzing-grpc</a>
package into your environment.
<br>Example:
<div class="mb-6 bg-light">
<pre><code>
python3 -m pip install --upgrade senzing-grpc
</code></pre>
</div>
</p>
4 changes: 4 additions & 0 deletions httpserver/static/root/component/sdk-doc-python.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p>
The Senzing SDK for Python methods are documented in the <i class="bi bi-box-arrow-up-right me-1"></i>
<a href="https://senzing-garage.github.io/sz-sdk-python-abstract/">Senzing Software Development Kit (SDK)</a>.
</p>
8 changes: 8 additions & 0 deletions httpserver/static/root/component/serve-grpc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p>
In the future, if you only need a gRPC server (Sandbox), but not the Senzing Playground, run:
</p>
<div class="mb-6 bg-light">
<pre><code>
docker run -it --name senzing-serve-grpc -p 8261:8261 --pull always --rm senzing/serve-grpc
</code></pre>
</div>
9 changes: 5 additions & 4 deletions httpserver/static/templates/site/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>Playground & Sandbox</h1>
allow you to examine Senzing without installing anything
on your workstation.
The <b>Sandbox</b> helps you set up an environment on your
workstation to use Senzing via gRPC server.
workstation to use Senzing via a gRPC server.
</p>
<p>
So the question is: &nbsp;<i>What is your goal?</i>
Expand All @@ -47,12 +47,14 @@ <h1>Playground & Sandbox</h1>
Choose your goal:
</p>


<div class="accordion" id="accordionGoal">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#tabPlayground" aria-expanded="true" aria-controls="tabPlayground">
<h6>1. <b class="text-primary">I want to try Senzing without installing anything.</b> (Playground)</h6>
<h6>1. <b class="text-primary">I want to try Senzing SDK without installing anything.</b> (Playground)
</h6>
</button>
</h2>
<div id="tabPlayground" class="accordion-collapse collapse" data-bs-parent="#accordionGoal">
Expand Down Expand Up @@ -142,7 +144,7 @@ <h6>2. <b class="text-primary">I want to use my Jupyter Lab.</b> (Sandbox)</h6>
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#tabSDK" aria-expanded="true" aria-controls="tabSDK">
<h6>3. <b class="text-primary">I want to try Senzing with my development environment.</b>
<h6>3. <b class="text-primary">I want to try Senzing SDK in my development environment.</b>
(Sandbox)</h6>
</button>
</h2>
Expand Down Expand Up @@ -228,7 +230,6 @@ <h6>4. <b class="text-primary">I want to migrate from using Senzing gRPC SDK to
</ul>
</div>
</div>

</div>
</div>

Expand Down
35 changes: 6 additions & 29 deletions httpserver/static/templates/site/python.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,7 @@ <h6>Start a gRPC server</h6>
<div id="jupyterGrpcServer" class="accordion-collapse collapse"
data-bs-parent="#accordionJupyter">
<div class="accordion-body">
<p>
In the future, if you only need a gRPC server, but not the entire Senzing
Playground, run:
</p>
<div class="mb-6 bg-light">
<pre><code>
docker run -it --name senzing-serve-grpc -p 8261:8261 --pull always --rm senzing/serve-grpc
</code></pre>
</div>
<div id="serve-grpc-jupyter" w3-include-html="/component/serve-grpc.html"> </div>
</div>
</div>
</div>
Expand Down Expand Up @@ -180,17 +172,10 @@ <h6>Download and run example Python programs</h6>
<div id="pythonSdkDownload" class="accordion-collapse collapse"
data-bs-parent="#accordionPythonSdk">
<div class="accordion-body">
<p>
Prepare your python environment by installing the Python
<a href="https://pypi.org/project/senzing-grpc/">senzing-grpc</a>
package into your environment.
<br>Example:
<div class="mb-6 bg-light">
<pre><code>
python3 -m pip install --upgrade senzing-grpc
</code></pre>
</div>
</p>
<div id="install-python-package"
w3-include-html="/component/install-python-package.html"> </div>


<p>
Download and run any of the following files:
<ol>
Expand Down Expand Up @@ -243,15 +228,7 @@ <h6>Start a gRPC server</h6>
<div id="pythonSdkGrpcServer" class="accordion-collapse collapse"
data-bs-parent="#accordionPythonSdk">
<div class="accordion-body">
<p>
In the future, if you only need a gRPC server, but not the entire Senzing
Playground, run:
</p>
<div class="mb-6 bg-light">
<pre><code>
docker run -it --name senzing-serve-grpc -p 8261:8261 --pull always --rm senzing/serve-grpc
</code></pre>
</div>
<div id="serve-grpc" w3-include-html="/component/serve-grpc.html"> </div>
</div>
</div>
</div>
Expand Down
16 changes: 12 additions & 4 deletions httpserver/static/templates/site/python/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,26 @@
</ol>
</nav>
<h1>Python</h1>
<p>The Senzing SDK for Python methods are documented in
the <i class="bi bi-box-arrow-up-right me-1"></i><a
href="https://senzing-garage.github.io/sz-sdk-python-abstract/">Senzing Software Development Kit
(SDK)</a>.
</p>
<p>
The next step depends on your goal.
</p>
<p>
<i class="bi bi-arrow-right-circle-fill me-2 text-primary"></i>
Choose your goal:
</p>
<ol>
<li><a href="playground.html">I want to try Senzing without installing anything.</a></li>
<li><a href="jupyter-lab.html">I want to use my Jupyter.</a></li>
<li><a href="local-development.html">I want to try Senzing with my development environment.</a></li>
<li><a href="playground.html">I want to try Senzing SDK without installing anything.</a></li>
<li><a href="jupyter-lab.html">I want to use my Jupyter Lab.</a></li>
<li><a href="local-development.html">I want to try Senzing SDK in my development environment.</a></li>
<li><a href="migrate.html">I want to migrate from using Senzing gRPC SDK to using the Senzing native SDK.</a>
</li>
</ol>
<div class="col-xs-12" style="height:100px;"></div>
<div class="col-xs-12" style="height:30px;"></div>
<div id="bottom-nav" w3-include-html="/component/bottom-nav.html" />
</div>
</main>
Expand Down
19 changes: 5 additions & 14 deletions httpserver/static/templates/site/python/jupyter-lab.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,10 @@
<li class="breadcrumb-item active" aria-current="page">Jupyter Lab</li>
</ol>
</nav>
<h1>Using personal Jupyter Lab</h1>
<h1>Using my Jupyter Lab</h1>
<div id="install-python-package" w3-include-html="/component/install-python-package.html"> </div>
<p>
Add the Python <a href="https://pypi.org/project/senzing-grpc/">senzing-grpc</a> package into your
environment.
<br>Example:
</p>
<div class="mb-6 bg-light">
<pre><code>
python3 -m pip install --upgrade senzing-grpc
</code></pre>
</div>
<p>
Then download and run the following Jupyter notebooks in your Jupyter Lab:
Download and run the following Jupyter notebooks in your Jupyter Lab:
<ol>
<li><a href="/examples/notebooks/python/senzing_hello_world.ipynb">senzing_hello_world.ipynb</a>
- A simple test of connectivity to Senzing engine.</li>
Expand All @@ -50,8 +41,8 @@ <h1>Using personal Jupyter Lab</h1>
</li>
</ol>
</p>


<div id="sdk-doc-python" w3-include-html="/component/sdk-doc-python.html"> </div>
<div id="serve-grpc" w3-include-html="/component/serve-grpc.html"> </div>
<div class="col-xs-12" style="height:10px;"></div>
<div id="bottom-nav" w3-include-html="/component/bottom-nav.html" />
</div>
Expand Down
22 changes: 9 additions & 13 deletions httpserver/static/templates/site/python/local-development.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,11 @@
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/site/home.html">Home</a></li>
<li class="breadcrumb-item" aria-current="page"><a href="/site/python/index.html">Python</a></li>
<li class="breadcrumb-item active" aria-current="page">SDK</li>
<li class="breadcrumb-item active" aria-current="page">Local development</li>
</ol>
</nav>
<h1>Using personal development environment</h1>
<p>
Prepare your python environment by installing the Python
<a href="https://pypi.org/project/senzing-grpc/">senzing-grpc</a>
package into your environment.
<br>Example:
<div class="mb-6 bg-light">
<pre><code>
python3 -m pip install --upgrade senzing-grpc
</code></pre>
</div>
</p>
<h1>Senzing SDK in my development environment</h1>
<div id="install-python-package" w3-include-html="/component/install-python-package.html"> </div>
<p>
Download and run any of the following files:
<ol>
Expand All @@ -54,6 +44,12 @@ <h1>Using personal development environment</h1>
</ol>
</p>

<p>
Using the files as examples, build your own Python application using the Senzing SDK.
</p>

<div id="sdk-doc-python" w3-include-html="/component/sdk-doc-python.html"> </div>
<div id="serve-grpc" w3-include-html="/component/serve-grpc.html"> </div>
<div class="col-xs-12" style="height:10px;"></div>
<div id="bottom-nav" w3-include-html="/component/bottom-nav.html" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions httpserver/static/templates/site/python/migrate.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<h1>Migrate from gRPC to native SDK</h1>
<div class="accordion-body">
<p>
To migrate your Python application from using the Senzing gRPC SDK to using the Senzing native SDK,
replace the following code:
To migrate your Python application from using the Senzing SDK for Python over gRPC to using the
Senzing SDK for Python, replace the following code:
</p>
<div class="mb-6 bg-light">
<pre><code>
Expand Down
50 changes: 38 additions & 12 deletions httpserver/static/templates/site/python/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
<li class="breadcrumb-item active" aria-current="page">Playground</li>
</ol>
</nav>
<h1>Senzing Playground for Python</h1>
<p>You can use Jupyter notebooks or the Python SDK to explore Senzing. Senzing SDK methods are documented in
the <i class="bi bi-box-arrow-up-right me-1"></i><a
href="https://senzing-garage.github.io/sz-sdk-python-abstract/">Senzing Software Development Kit
(SDK)</a>.
<h1>Senzing SDK without installing anything</h1>
<p>
You can use Jupyter notebooks or the Python SDK to explore Senzing.
</p>
<div id="sdk-doc-python" w3-include-html="/component/sdk-doc-python.html"> </div>
<p class="text-muted fw-lighter">
<b>Hint:</b> If the senzing/playground docker container has been use in a prior
demonstration, restart the docker container for best results.
Expand All @@ -57,7 +56,7 @@ <h1>Senzing Playground for Python</h1>
<h4>Jupyter notebook demonstration</h4>
<p>
In this demonstration, Jupyter notebooks have been created to demonstrate Senzing.
Using these notebooks as a starting point, modify a notebook to explore Senzing.
Using these notebooks as a starting point, modify the notebook to explore Senzing.
</p>
<p>
<i class="bi bi-arrow-right-circle-fill me-2 text-primary"></i>
Expand All @@ -74,25 +73,52 @@ <h4>Jupyter notebook demonstration</h4>
</li>
</ol>
</p>
<p>
Use a notebook as starting point to create your own Jupyter notebooks. Remember that the
notebooks are not permanent and will be deleted when the docker container is destroyed. You can
save a notebook locally by selecting <b>File</b> > <b>Download</b> in Jupyter Lab.
</p>
<p>
You can also upload a Python Notebook (.ipynb) file using a <b>docker</b> command.
<br \>Example:
<div class="mb-6 bg-light">
<pre><code>
docker container cp /tmp/my_local.ipynb senzing-playground:/examples/notebooks/python/my_local.ipynb
</code></pre>
</div>
</p>
</div>
<div class="tab-pane fade" id="python-sdk-tab-pane" role="tabpanel" aria-labelledby="python-sdk-tab"
tabindex="0">
<div class="col-xs-12" style="height:15px;"></div>
<h4>Senzing Python SDK demonstration</h4>
<p>
Select a demonstration:
</p>
<p>
To run the example files, open <a href="/xterm/xterm.html" target="senzing-xterm">Xterm</a> and
run any of the following:
<div class="mb-6 bg-light">
<pre><code>
senzing_hello_world.py
senzing_load_truthsets.py
senzing_load_user_data.py
senzing_hello_world.py
senzing_load_truthsets.py
senzing_load_user_data.py
</code></pre>
</div>
</p>
<p>
By using a <b>docker</b> command, you can upload and download files to/from the running Docker
container. <br /> Example download from Docker container:
<div class="mb-6 bg-light">

<pre><code>
docker container cp senzing-playground:/examples/python/senzing_hello_world.py /tmp/senzing_hello_world.py
</code></pre>
</div>
Example upload to Dockter container:
<div class="mb-6 bg-light">
<pre><code>
docker container cp /tmp/my_local.py senzing-playground:/examples/python/my_local.py
</code></pre>
</div>
</p>


</div>
Expand Down

0 comments on commit 720d511

Please sign in to comment.