Skip to main content

herethere

Project description

Latest version on PyPI Supported Python versions CI Status Code coverage status

Run Python interactively inside live apps and devices.

herethere starts a small SSH-backed server inside a Python process, then lets you connect from another Python session or Jupyter notebook to inspect, modify, and interact with a namespace in that running process.

It was created for workflows where Python is running inside an app, device, or environment that is awkward to interact with directly. The same idea is useful for Raspberry Pi and robotics projects, Kivy/mobile apps, containers, long-running experiments, server-side apps, and other cases where logs or a separate remote shell are not enough.

herethere is based on the AsyncSSH library. AsyncSSH provides the SSH toolkit; herethere adds a small Python and Jupyter workflow layer on top.

Code repository:

https://github.com/b3b/herethere

Documentation:

https://herethere.me/library

Installation

Install herethere in the Python environment that will start the server:

pip install herethere

If you want to connect from Jupyter using the IPython magics, install the magic extra in the notebook/client environment:

pip install "herethere[magic]"

Quickstart

Target process

Start herethere inside the Python process you want to interact with.

from herethere.here import ServerConfig, start_server

state = {"speed": 1}

await start_server(ServerConfig.load(prefix="here"), namespace=globals())

Jupyter notebook / client

Connect from your local Jupyter notebook:

%load_ext herethere.magic
%connect-there

Use the %%there cell magic to inspect variables, call functions, or update state while the target process keeps running:

%%there

print(state)
state["speed"] = 3
print(state)

Trust model

A connected client can execute Python code inside the target process. Treat access to herethere like access to a Python REPL running inside your app.

Use it only for development workflows where you control both sides of the connection. Do not expose it publicly or give access to untrusted users.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

herethere-0.2.1.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

herethere-0.2.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file herethere-0.2.1.tar.gz.

File metadata

  • Download URL: herethere-0.2.1.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for herethere-0.2.1.tar.gz
Algorithm Hash digest
SHA256 be4fd93485ca633320e15b66e8d3df9c680a5a981cea27ea079b8fef3f9749d4
MD5 262114e7bb5efd9db933d9871c7737ee
BLAKE2b-256 38c9a4fea92b31e272866422f0ca46232cc8959768d7412758b726d564d74284

See more details on using hashes here.

File details

Details for the file herethere-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: herethere-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for herethere-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5a509ad723b82e7984a3315d8dbe772501bf3b8ef30717c71cd049e7cf0ea94
MD5 9e388e10397f88066ca30341262f14bd
BLAKE2b-256 86332c9dfabe56c14e8e19000596b045aec69dde465a84d7c923346dfc8d7093

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page