interject
A durable ask() primitive. A program can stop, ask a human, and resume —
days later, on another machine, in one tap.
from interject import ask
vehicle = ask(
"Is this a car?",
options=["car", "motorcycle", "boat", "trailer"],
id="vehicle_type",
context={"title": listing.title, "price": listing.price},
suggest={"value": "motorcycle", "confidence": 0.94},
)
That call registers a question, lets everything not downstream of it keep running, reaches you wherever you are, and returns the answer to this line of this program — even if the process exited and was restarted two days later on different hardware. It may also never reach you at all, if the triage layer is confident enough. That is the point.
Why
Modern pipelines are mostly autonomous with a handful of points where human
judgment is irreducible. Today each of those is a bespoke JSON file nobody is
watching, a blocking input() at a terminal nobody is sitting at, or a hard
stop.
How it behaves
It does not block. By default ask long-polls briefly and then raises
Suspended, so the caller exits cleanly. The next run recomputes the same
content-addressed key and gets the stored answer immediately:
import interject
try:
kind = interject.ask("Is this a car?", options=["car", "moto"],
id="vehicle_type", context=listing, wait=0)
except interject.Suspended:
return # somebody will answer; the next run picks it up
Pass on_timeout="block" for an interactive script, or on_timeout="default"
with a default= for best-effort enrichment.
Scanning a backlog does not create a backlog of questions. ask registers as
it checks, so use peek to look without creating:
key = interject.key_for("vehicle_type", listing)
if interject.peek_answer(key) is None:
... # not answered yet
Silence is the other half. A job can declare what it owes you, and going quiet becomes an event:
interject.heartbeat("nightly.etl", expect_every="26h")
Installation
pip install interject
No dependencies, Python 3.9+. It talks to an interjectd daemon over HTTP —
see the repository for running one,
for the one-tap phone inbox, and for the triage layer that makes it ask less
over time.
Configuration
| variable | default | meaning |
|---|---|---|
INTERJECT_URL |
http://127.0.0.1:8787 |
daemon base URL |
INTERJECT_TOKEN |
(none) | project or device token |
INTERJECT_PROJECT |
default |
project name, for daemons without tokens |
INTERJECT_IDENTITY |
(none) | who you answer as, for routing |
Licensed under Apache-2.0.
Metadata
Release files for interject 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| interject-0.1.0.tar.gz | 22.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| interject-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.6 kB
Release files / interject-0.1.0.tar.gz
| Download URL | interject-0.1.0.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
404ad2f3359381a75347bb67fa30ecccd9046dc0ac0e4b526c95bd6b1f915590
|
|
BLAKE2b-256 checksum How to use checksums |
577835ad88831c9ec5837bc4891b1d320bb007805260675a2d0999e1ad0d9b10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency logRelease files / interject-0.1.0-py3-none-any.whl
| Download URL | interject-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9992ce0ab2af0f0170e3455960840a04dd38f511b7cdfd482af4d321fda54f54
|
|
BLAKE2b-256 checksum How to use checksums |
963bfd5be79199cd8838a7b0cbdde5ccd511f39c8107620138163054a03582aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency log