Metadata-Version: 2.4
Name: ptymini
Version: 0.0.5
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Dist: fastcore>=2.1.18
Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: nbdev>=3 ; extra == 'dev'
Requires-Dist: fastship ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Asyncio pty sessions: spawn, write, multi-client attach with replay, and a named registry
Home-Page: https://github.com/AnswerDotAI/ptymini
Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://AnswerDotAI.github.io/ptymini/
Project-URL: Repository, https://github.com/AnswerDotAI/ptymini

# ptymini


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

`ptymini` fills the gap between `ptyprocess` (a raw pty fd), `pexpect` (sync expect loops), and `terminado` (a pty server welded to tornado): asyncio-native pty *sessions*. A `PtySession` is one spawned pty that any number of clients can attach to as independent byte streams, each primed from a byte-bounded replay buffer — so a reconnecting client resumes with recent scrollback instead of a blank screen. The ring and the pty process live in a compiled Rust core; the asyncio surface is pure Python.

A `PtyRegistry` adds named get-or-create sessions, injected shell setup (`rc`), and inactivity culling. It carries no server, no framework, and no session persistence beyond the process. Web exposure belongs to the embedding app (e.g. [jupygate](https://github.com/AnswerDotAI/jupygate)), and durable session management belongs to tmux.

`ptymini.bg` is the sync surface, for callers outside an event loop: kernel tools, plain scripts, an LLM deciding between actions. It is the [bgterm](https://github.com/AnswerDotAI/bgterm) API, folded in, with sid-named sessions and blocking calls. The wait parameters are `fastmux.bg`’s. `wait_ms` bounds the wait for new output. `until=` returns as soon as the accumulated text matches that regex. `settle_ms` keeps collecting until output has stopped for that long.

### Installation

``` sh
$ pip install ptymini
```

