Skip to main content

A stateful API mock server for integration testing

Project description

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.
  • 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 Offset/limit list endpoints 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.

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

imnot-1.3.0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imnot-1.3.0-py3-none-any.whl (83.8 kB view details)

Uploaded Python 3

File details

Details for the file imnot-1.3.0.tar.gz.

File metadata

  • Download URL: imnot-1.3.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for imnot-1.3.0.tar.gz
Algorithm Hash digest
SHA256 da2c404b18a9109b2c2e2ecfc0509f389591454e17a7f59b33c15ef3df114ccb
MD5 178fb6056ee4bc7e85df5449cda952dc
BLAKE2b-256 9b4ef669741f1c15e674a00e287f985c59824a46e3fa2ce00a3e3ef75aee63e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for imnot-1.3.0.tar.gz:

Publisher: release.yml on edu2105/imnot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file imnot-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: imnot-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 83.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for imnot-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f89850676159bdc035427bdba5c85112215a5fb6396d748cf643eae77bc91b0
MD5 7c8a748ce775ceed8b0c6b884c5f1410
BLAKE2b-256 5b02a92a42ae74321797172976b4d2d4b1c8cea340341d192f853284b2c75c00

See more details on using hashes here.

Provenance

The following attestation bundles were made for imnot-1.3.0-py3-none-any.whl:

Publisher: release.yml on edu2105/imnot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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