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

Features

  • Execute Python snippets inside a live target process namespace.

  • Connect from Python code or from Jupyter notebooks with %connect-there and %%there.

  • Use SSH authentication and encrypted transport through AsyncSSH.

  • Run shell commands and upload files, depending on server configuration.

  • Generate reviewable code cells from natural-language requests with %%there ai.

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.3.tar.gz (35.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.3-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: herethere-0.2.3.tar.gz
  • Upload date:
  • Size: 35.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.3.tar.gz
Algorithm Hash digest
SHA256 a7646562ec62a624a50a531ce0bf6b7943223f8a6c27e2e1a0a346070fefedd0
MD5 ec35f55546f2de357e7a6236089eef74
BLAKE2b-256 c171cbee79cf68f61555e01ceb8df420364a693f20a726b2e63eaa1b27c23d88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: herethere-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 37.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f12edcf4ff6659da91686dea038ac35da018831c51b65a9f9aaf9d953e831ed2
MD5 d726dd5e26a6c665937df1cc6e23b55a
BLAKE2b-256 9d2eb33b11cda79f6043caa2329a6a34a5b9ecc563fc071f179a714e0f49abdc

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