Skip to main content

imnot

imnot — stateful API mock server

CI codecov PyPI version

YAML in. Mock server out. Define external APIs in a single file, run imnot start, and get a fully functional local mock server — stateful flows, session isolation, and an Admin UI included. No code required.


Why imnot?

  • Zero code. One YAML file per external API. No JVM, no framework, no boilerplate.
  • Stateful, not just stubbed. OAuth, polling, callbacks, paginated lists, and per-test session isolation — all modeled in YAML.
  • Validation-aware. Declare field rules in YAML — imnot rejects malformed requests with realistic 422 errors before returning a mock response.
  • Rate-limit aware. Declare a requests_per_minute ceiling on fetch endpoints — imnot enforces it with a token bucket and returns realistic 429 responses with a Retry-After header.
  • Ships with your tests. Partner definitions are version-controlled alongside the integration they test and run anywhere Docker runs.

Quick start

Requires Python 3.11+.

pipx install imnot
imnot init
imnot start

pipx installs CLI tools into isolated environments. Alternatively: pip install imnot inside an existing virtual environment.

imnot init creates a partners/ directory with two working example partners (staylink and bookingco) that cover all six patterns. Edit or replace them whenever you're ready.


Patterns

Pattern What it mocks
oauth Client-credentials token endpoint — returns a standard JWT
static Any fixed-response endpoint — health checks, custom auth, lookup tables
fetch Synchronous GET that returns an uploaded payload
polling N-step async flow: submit → status check(s) → fetch result
callback Webhook simulation — imnot fires the outbound call after receiving a submit
paginated Paginated list endpoints (offset/limit, cursor, or page-number) sliced from an uploaded array at request time

All fetch, polling, and paginated endpoints support X-Imnot-Session for per-test isolation — parallel test runs stay independent.

→ Full pattern reference with YAML examples


Admin UI

imnot ships an embedded Admin UI at GET /imnot/admin/ui. No setup required — it's enabled by default and auth-gated by the same Bearer token as the rest of the admin API.

From the browser you can:

  • Browse loaded partners and their datapoints
  • Upload and inspect payloads (global or session-scoped)
  • Run end-to-end endpoint tests — including full polling flows
  • Manage active sessions
  • Hot-reload YAML without restarting the server
  • Run load tests against any HTTP endpoint (standalone or partner-bound)

→ Load Test reference


AI-ready

Don't want to write the YAML yourself? Paste one of these into Claude, ChatGPT, or your AI assistant:

From a description:

I use imnot to mock external APIs for integration testing.
Generate a partner.yaml file in imnot format for [service name].
Schema reference: https://github.com/edu2105/imnot/blob/main/partners/README.md
Endpoints to mock: [describe them]
Output only the YAML — no code, no explanation.

From an OpenAPI spec:

I use imnot to mock external APIs for integration testing.
Convert this OpenAPI spec into a partner.yaml file in imnot format.
Schema: https://github.com/edu2105/imnot/blob/main/partners/README.md
Output only the YAML — no code, no explanation.
[paste your spec here]

Learn more

Topic Doc
Pattern reference docs/patterns.md
Admin API reference docs/admin-api.md
Load Test docs/load-test.md
CLI & configuration docs/cli.md
Docker & deployment docs/deployment.md
Partner YAML schema partners/README.md
Contributing CONTRIBUTING.md

Limitations

  • Callback retries — no built-in retry logic; use the retrigger endpoint to re-fire.
  • JSON only — response bodies are always JSON, no XML support.
  • Single-node — SQLite session store is not shared across instances.
  • Admin UI — desktop layout only; no mobile breakpoints.
  • No native TLS — use a reverse proxy (Nginx, Caddy) to terminate HTTPS.

Metadata

Release files for imnot 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imnot 1.4.0
File Size Uploaded
imnot-1.4.0.tar.gz 3.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for imnot 1.4.0
File Interpreter ABI Platform
imnot-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.8 MB

Release files / imnot-1.4.0.tar.gz

Download URL imnot-1.4.0.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
af9e0e91773bdbfd929921dcef373c3de8f77aa5686c1d6dafd2cb2ecfafd4ca
BLAKE2b-256 checksum
How to use checksums
56bddac8d3e4460b77224c7a5119bb85aefd516005ab17f3bd8eebe707a1e9c4
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 Aug 28, 2026.

Transparency log

Release files / imnot-1.4.0-py3-none-any.whl

Download URL imnot-1.4.0-py3-none-any.whl
Size 92.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b142d47d5eff28ef99e1e1332c5f7ee70bd358a9631765a8c0e9e6441fe57a07
BLAKE2b-256 checksum
How to use checksums
714c3ea6f8b3e99b5b91bc71810ba6cb6dbb262c8eab459a4ff4c60fa98ca718
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 Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

1.5.0

2 release files

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page