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.2.tar.gz (35.8 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.2-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: herethere-0.2.2.tar.gz
  • Upload date:
  • Size: 35.8 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.2.tar.gz
Algorithm Hash digest
SHA256 6c2e29ba0325fcce21ef08ac68ba96220808a10ed76ce021847aaf6138a41fc7
MD5 f175b64ec69cd68a6e1edcff38db31bc
BLAKE2b-256 f42611487efbce08f47abb23a570db9e73588a4489252c9450b9dcfbffc880eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: herethere-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 37.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec9485a27dba7550622c8f1ea87e7a032865fc454860eff2e2f39e30d4a5bd5f
MD5 1920a2cac54fe8093f473dae1c600da8
BLAKE2b-256 aecdda4f8dd86aeac1761a38bbd7c56c8a85ee19df4be8d6760613ef9003430b

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