mirror of https://github.com/gsi-upm/senpy
Removed nbsphinx
It requires pandoc, which cannot be installed with pip. We can either link to the nbfile or convert the file manually/automatically: ``` nbconvert SenpyClientUse.ipynb --to rst ```pull/39/merge
parent
955e17eb2a
commit
188c33332a
@ -1,10 +0,0 @@
|
|||||||
Client demo
|
|
||||||
===========
|
|
||||||
|
|
||||||
This video shows how to use senpy through command-line tool.
|
|
||||||
|
|
||||||
.. image:: https://asciinema.org/a/9uwef1ghkjk062cw2t4mhzpyk.png
|
|
||||||
:width: 100%
|
|
||||||
:target: https://asciinema.org/a/9uwef1ghkjk062cw2t4mhzpyk
|
|
||||||
:alt: CLI demo
|
|
||||||
|
|
@ -1,24 +1,9 @@
|
|||||||
Command line
|
Command line
|
||||||
============
|
============
|
||||||
|
|
||||||
In case you want to load modules, which are located in different folders under the root folder, use the next option.
|
This video shows how to analyse text directly on the command line using the senpy tool.
|
||||||
|
|
||||||
.. code:: bash
|
.. image:: https://asciinema.org/a/9uwef1ghkjk062cw2t4mhzpyk.png
|
||||||
|
:width: 100%
|
||||||
senpy -f .
|
:target: https://asciinema.org/a/9uwef1ghkjk062cw2t4mhzpyk
|
||||||
|
:alt: CLI demo
|
||||||
The default port used by senpy is 5000, but you can change it using the `--port` flag.
|
|
||||||
|
|
||||||
.. code:: bash
|
|
||||||
|
|
||||||
senpy --port 8080
|
|
||||||
|
|
||||||
Also, the host can be changed where senpy is deployed. The default value is `127.0.0.1`.
|
|
||||||
|
|
||||||
.. code:: bash
|
|
||||||
|
|
||||||
senpy --host 0.0.0.0
|
|
||||||
|
|
||||||
For more options, see the `--help` page.
|
|
||||||
|
|
||||||
Alternatively, you can use the modules included in senpy to build your own application.
|
|
||||||
|
@ -1,8 +1,48 @@
|
|||||||
Senpy server
|
Senpy server
|
||||||
============
|
============
|
||||||
|
|
||||||
Once the server is launched, there is a basic endpoint in the server, which provides a playground to use the plugins that have been loaded.
|
The senpy server is launched via the `senpy` command:
|
||||||
|
|
||||||
In case you want to know the different endpoints of the server, there is more information available in the NIF API section_.
|
::
|
||||||
|
|
||||||
|
usage: senpy [-h] [--level logging_level] [--debug] [--default-plugins]
|
||||||
|
[--host HOST] [--port PORT] [--plugins-folder PLUGINS_FOLDER]
|
||||||
|
[--only-install]
|
||||||
|
|
||||||
|
Run a Senpy server
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--level logging_level, -l logging_level
|
||||||
|
Logging level
|
||||||
|
--debug, -d Run the application in debug mode
|
||||||
|
--default-plugins Load the default plugins
|
||||||
|
--host HOST Use 0.0.0.0 to accept requests from any host.
|
||||||
|
--port PORT, -p PORT Port to listen on.
|
||||||
|
--plugins-folder PLUGINS_FOLDER, -f PLUGINS_FOLDER
|
||||||
|
Where to look for plugins.
|
||||||
|
--only-install, -i Do not run a server, only install plugin dependencies
|
||||||
|
|
||||||
|
|
||||||
|
When launched, the server will recursively look for plugins in the specified plugins folder (the current working directory by default).
|
||||||
|
The default server includes a playground and an endpoint with all plugins found.
|
||||||
|
|
||||||
|
By default, senpy will listen only on the `127.0.0.1` address.
|
||||||
|
That means you can only access the API from your (or localhost).
|
||||||
|
You can listen on a different address using the `--host` flag.
|
||||||
|
The default port is 5000.
|
||||||
|
You can change bothbut you can change it using the `--port` flag.
|
||||||
|
|
||||||
|
For instance, to accept connections on port 6000 on any interface:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
senpy --host 0.0.0.0 --port 6000
|
||||||
|
|
||||||
|
For more options, see the `--help` page.
|
||||||
|
|
||||||
|
|
||||||
|
Customizing senpy
|
||||||
|
=================
|
||||||
|
Senpy is built on top of Flask, the web framework.
|
||||||
|
Although it is not the recommendad way, you may customize senpy by extending the extensions, blueprints and modules provided in the senpy module.
|
||||||
|
Loading…
Reference in New Issue