API¶
Here: server classes¶
-
async
herethere.here.
start_server
(config: herethere.here.config.ServerConfig, namespace: Optional[dict] = None, server_factory: Type[herethere.here.server.SSHServerHere] = <class 'herethere.here.server.SSHServerHere'>) → herethere.here.server.RunningServer[source]¶ Start SSH server.
- Parameters
config – server configuration options
namespace – dictionary in which Python code commands will be executed
server_factory – optional protocol handler class
-
class
herethere.here.
ServerConfig
(host: str, port: int, username: str, password: str, key_path: str, chroot: str)[source]¶ Bases:
herethere.everywhere.config.ConnectionConfig
SSH server configuration.
-
property
asdict
¶ Dict represntation of the instance.
-
classmethod
load
(prefix: str = '', path: Optional[str] = None) → herethere.everywhere.config.ConnectionConfig¶ Load configuration from the environment, and file with configurations variables. If path is not specified, variables are loaded from a file named {prefix}.env in the current directory or any of its parents.
- Parameters
prefix – prefix for variables ({PREFIX}_HOST), and a configuration file name to search for: {prefix}.env
path – explicit configuration file location
-
classmethod
load_from_dict
(*, env: Dict[str, str], prefix: str) → herethere.everywhere.config.ConnectionConfig¶ Load config from dictionary.
-
save
(path: str, prefix: str = '')¶ Save config to the given location.
-
property
There: client classes¶
-
class
herethere.there.
Client
[source]¶ Client for remote interpreter.
-
async
connect
(config: herethere.everywhere.config.ConnectionConfig)[source]¶ Connect to remote.
-
async
runcode
(code: str, stdout: Optional[TextIO] = None, stderr: Optional[TextIO] = None) → str[source]¶ Execute python code on the remote side.
-
async
runcode_background
(code: str, stdout: Optional[TextIO] = None, stderr: Optional[TextIO] = None) → str[source]¶ Execute python code in a separate thread on the remote side.
-
async
-
class
herethere.everywhere.config.
ConnectionConfig
(host: str, port: int, username: str, password: str)[source]¶ Remote connection configuration.
-
property
asdict
¶ Dict represntation of the instance.
-
classmethod
load
(prefix: str = '', path: Optional[str] = None) → herethere.everywhere.config.ConnectionConfig[source]¶ Load configuration from the environment, and file with configurations variables. If path is not specified, variables are loaded from a file named {prefix}.env in the current directory or any of its parents.
- Parameters
prefix – prefix for variables ({PREFIX}_HOST), and a configuration file name to search for: {prefix}.env
path – explicit configuration file location
-
classmethod
load_from_dict
(*, env: Dict[str, str], prefix: str) → herethere.everywhere.config.ConnectionConfig[source]¶ Load config from dictionary.
-
property
-
herethere.there.commands.
there_code_shortcut
(handler: Callable[[str], str]) → Callable[[click.core.Context], None][source]¶ Decorator to register %there subcommand to execute Python code.
- Parameters
handler – a function, that receives text from the Jupyter cell, and returns Python code to execute on the remote side