Skip to main content

embedded-nats

Platform wheels containing nats-server and a small Python manager. JetStream, KV, and Object Store are provided by that one server. The project targets Python 3.12+ on Windows x64, Linux x86_64/aarch64/armv7l, and macOS x86_64/arm64 (macOS 12+).

The package version tracks the server version plus a packaging revision: 2.15.0.0 bundles NATS 2.15.0, packaging revision 0. No Go toolchain is needed to install a wheel. The only Python runtime dependency is pinned nats-py 2.16.0.

This is independent, unofficial packaging of the NATS™ server; it is not produced, sponsored, or endorsed by the NATS project or the Linux Foundation. The maintainer has chosen to retain the embedded-nats name. This choice is not a claim of affiliation or trademark permission.

Example

import asyncio
import os
from pathlib import Path

import nats
from embedded_nats import get_server


async def put_example(url: str, token: str) -> None:
    client = await nats.connect(url, token=token)
    try:
        js = client.jetstream()
        store = await js.create_object_store(bucket="render_results", max_bytes=64 * 1024 * 1024)
        with Path("preview.png").open("rb") as source:
            await store.put("render/immutable-run-id.png", source)
        temporary = Path("preview.download.tmp")
        try:
            with temporary.open("wb") as destination:
                await store.get("render/immutable-run-id.png", writeinto=destination)
            os.replace(temporary, "preview.download.png")
        finally:
            temporary.unlink(missing_ok=True)
        await js.delete_object_store("render_results")  # only for this disposable example
    finally:
        await client.close()


with get_server("./nats-data") as server:
    print(server.url)  # URL never includes the token
    asyncio.run(put_example(server.url, server.auth_token))

The synchronous manager should be started outside an application's asyncio event loop (for example with await asyncio.to_thread(server.start)). It starts a child, waits for an authenticated NATS roundtrip and JetStream API, then owns that child until stop(). A second manager cannot control the same store. A previous process marker requires manual recovery; the package does not adopt or kill a process identified only by an old PID.

Data and security

The server listens on loopback with token authentication. The token is kept separately from server.url; avoid logging it. Store data remains after a clean restart. The default JetStream sync_interval is always; relaxing it increases the loss window after a crash. Windows managed stop terminates the child, so recovery is tested as a crash, not as graceful server shutdown.

Store directories should be private to the OS user. On POSIX the manager requires mode 0700; on Windows choose a directory with a user-private ACL, for example inside the user's application data directory. The generated configuration contains the token. The JetStream file budget defaults to 1 GB, memory store to 64 MB, and NATS message payload to 1 MiB. These do not cap the process RSS or all disk overhead. Configure per-bucket max bytes and TTL according to each consumer's artifact lifetime. Object Store is not S3 and does not provide a transaction with your database or physical printer. Download to a temporary file and publish it with an atomic rename only after get() completes and verifies the digest; discard partial temporary files after an error. An interrupted upload is not a committed object; consumers must not infer completion from orphan chunks. Bucket TTL/quota and periodic consumer cleanup remain necessary for abandoned artifacts.

If a process crashes, inspect managed-runtime.json (including child_pid when present), verify that its old NATS process is gone by executable and store path rather than PID alone, and only then remove the marker before restarting. A crash between spawn and marker update can leave child_pid null; inspect the old generation's ports file and OS process list in that case. Keep jetstream/ and all bucket data. A live copy of that directory is not a consistent backup; integration with application backup belongs to the consumer. The package neither installs an OS service nor deletes store data.

Build and verification

scripts/build_wheels.py builds six target binaries from the pinned upstream tag and commit with Go 1.26.8 (source minimum 1.26), then packages each in a fresh staging tree. The exact commit, Go version, target, binary SHA256, and Go module inventory are inside every wheel. Linux wheels are tagged manylinux_2_17 because the Go binary is built with CGO disabled; minimum kernel compatibility is checked separately. macOS uses a 12.0 deployment floor because Go 1.26 does not support macOS 11. Windows requires Windows 10+ or Server 2016+ under that toolchain. These are packaging targets, not a claim of native tests on every platform from one workstation.

python scripts/build_wheels.py all
python -m pytest tests/ -v

Releases are triggered by v<package-version> tags after full wheel and runtime acceptance. The workflow uses the exact tested wheels for both GitHub Releases and PyPI Trusted Publishing. Creating the repository or committing code does not publish a package.

The bundled server is Apache-2.0. See NOTICE, THIRD_PARTY_NOTICES.md, and each wheel's build manifest for the pinned source and dependency inventory.

Metadata

Release files for embedded-nats 2.15.0.0

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

Built distributions (wheels)

Table of built distributions (wheels) for embedded-nats 2.15.0.0
File
embedded_nats-2.15.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
embedded_nats-2.15.0.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
embedded_nats-2.15.0.0-py3-none-manylinux_2_17_armv7l.whl Python 3 none Linux glibc 2.17+ ARMv7l Details
embedded_nats-2.15.0.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
embedded_nats-2.15.0.0-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details
embedded_nats-2.15.0.0-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details

Total release size: 39.0 MB

Release files / embedded_nats-2.15.0.0-py3-none-win_amd64.whl

Download URL embedded_nats-2.15.0.0-py3-none-win_amd64.whl
Size 6.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8ad8fe0b70846c46c30c5db2890ea8a957508290d1bc876ca8e8ed989e4fea9f
BLAKE2b-256 checksum
How to use checksums
d9a4daa4924dc3c9f34228ca4a8761efac82e253f386d9b9e954d7819b750a5a
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 23, 2026.

Transparency log

Release files / embedded_nats-2.15.0.0-py3-none-manylinux_2_17_x86_64.whl

Download URL embedded_nats-2.15.0.0-py3-none-manylinux_2_17_x86_64.whl
Size 6.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f9d80139d6e8c47063646e9f70ec64b56f27097b662977bcbfbd195cef5373b3
BLAKE2b-256 checksum
How to use checksums
ae1287ea53e4a896f04f05f49d14d3a971795ad099bae2d09899dd886a8b499c
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 23, 2026.

Transparency log

Release files / embedded_nats-2.15.0.0-py3-none-manylinux_2_17_armv7l.whl

Download URL embedded_nats-2.15.0.0-py3-none-manylinux_2_17_armv7l.whl
Size 6.4 MB
Tags Linux glibc 2.17+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
6f90fd7e7b694ab70980a90ca81de9c50a877a3c36b6aa96d1c3d45720deaeff
BLAKE2b-256 checksum
How to use checksums
5545a8bc76324a37512325a1413d50a3b354954c68491a3bcf315a87c1a22d25
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 23, 2026.

Transparency log

Release files / embedded_nats-2.15.0.0-py3-none-manylinux_2_17_aarch64.whl

Download URL embedded_nats-2.15.0.0-py3-none-manylinux_2_17_aarch64.whl
Size 6.0 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b90fb763b7e4bb7a7938df651df733b611121770fa3b44f6114a2c2eaab0864d
BLAKE2b-256 checksum
How to use checksums
926f0d60d0d5a37b14e14cf5322a02a11963a688cf892463a4bbdbd2a57386fa
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 23, 2026.

Transparency log

Release files / embedded_nats-2.15.0.0-py3-none-macosx_12_0_x86_64.whl

Download URL embedded_nats-2.15.0.0-py3-none-macosx_12_0_x86_64.whl
Size 6.8 MB
Tags Python 3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
2695b570767fcb07b05a671cd8241fee611cfd13809b816e54de28e21cf5f1ce
BLAKE2b-256 checksum
How to use checksums
503b5bdfef37fbf332f89d8a2835a8ecab75fd9cfd98ae3dc56eba9e8006d4cf
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 23, 2026.

Transparency log

Release files / embedded_nats-2.15.0.0-py3-none-macosx_12_0_arm64.whl

Download URL embedded_nats-2.15.0.0-py3-none-macosx_12_0_arm64.whl
Size 6.2 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
a2e144fd0886502f9e2edbb113939de207b351a59cb5084bca92d086c6beb057
BLAKE2b-256 checksum
How to use checksums
c06d6eb51fabd5d2c182d23382402a44a1d8ee3873d52f9ebc0f90d8f687911f
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 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.15.0.0 This release

6 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