Skip to main content

z4j-bare

PyPI version Python License

The framework-free agent runtime for z4j.

Bootstraps a z4j agent inside any Python process, Celery worker, RQ worker, Dramatiq actor, plain script, custom service, and connects it to z4j over an authenticated WebSocket. Used directly when there's no framework adapter (z4j-django / z4j-flask / z4j-fastapi); used indirectly by those framework adapters too.

Compatibility

Python 3.11+. No framework or engine pinned; pair with whichever engine adapter your worker runs (z4j-celery, z4j-rq, z4j-dramatiq, z4j-huey, z4j-arq, z4j-taskiq) and that adapter carries the engine-version floor.

Full per-adapter matrix at https://z4j.dev/reference/compatibility/.

What it ships

  • Agent runtime, connect, authenticate, supervise, reconnect with bounded backoff
  • Outbound buffer, captured events are written to a bounded local SQLite ring before going out on the wire and survive short brain outages and agent restarts. At the configured count or byte limit, the oldest buffered rows are evicted and the loss is logged.
  • Engine signal hooks, wired up by whichever engine adapter you install (z4j-celery, z4j-rq, etc.); the runtime drains them into the buffer
  • Schedule inventory, emits a full snapshot at boot, on a periodic timer (default 15 min), and on demand from the brain's Sync now command. Existing schedules show up automatically.
  • Command dispatcher, receives operator actions from the brain (retry, cancel, restart, schedule.fire, schedule.resync, etc.) and routes them to the right adapter

Install

pip install z4j-bare

Most users install a framework adapter (z4j-django / z4j-flask / z4j-fastapi) which pulls z4j-bare automatically.

Quick start (framework-free worker)

import os

from z4j_bare import install_agent
from z4j_celery import CeleryEngineAdapter

install_agent(
    engines=[CeleryEngineAdapter(celery_app=app)],
    brain_url="https://brain.example.com",
    token="z4j_agent_...",
    project_id="my-project",
    hmac_secret=os.environ["Z4J_HMAC_SECRET"],
)

Reliability

  • Invalid or missing configuration and unsafe buffer initialization fail the explicit install_agent() call; after successful startup, transport work runs off the host application's request and task paths.
  • Engine adapters use bounded in-process event queues and the runtime uses a bounded SQLite buffer. Queue overflow drops new events; buffer pressure evicts the oldest rows. Both paths log the loss.
  • The supervisor retries transient network and TLS failures with bounded backoff. Authentication, configuration, and protocol-version failures are terminal so they do not create reconnect storms.

Documentation

Full docs at z4j.dev/frameworks/bare/.

License

Apache-2.0, see LICENSE.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z4j_bare-1.10.0.tar.gz (273.9 kB view details)

Uploaded Source

Built Distribution

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

z4j_bare-1.10.0-py3-none-any.whl (187.4 kB view details)

Uploaded Python 3

File details

Details for the file z4j_bare-1.10.0.tar.gz.

File metadata

  • Download URL: z4j_bare-1.10.0.tar.gz
  • Upload date:
  • Size: 273.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for z4j_bare-1.10.0.tar.gz
Algorithm Hash digest
SHA256 998e3ed081182e0e4ea7040f0a76258f6a3dbf44095556d32e4d08dddaff55c7
MD5 ef359163ffabb8618942c5d46d78b210
BLAKE2b-256 af9477a95c713a648eb4804167bac3fe5504d779f5d6cc078f7d524e96d0590a

See more details on using hashes here.

File details

Details for the file z4j_bare-1.10.0-py3-none-any.whl.

File metadata

  • Download URL: z4j_bare-1.10.0-py3-none-any.whl
  • Upload date:
  • Size: 187.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for z4j_bare-1.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ab0c7d1071ad8c9945c047c87738118465b4b0f38e6c5c5343743c7df00603a
MD5 cad5eae98718a4e71cd2d35a10fd4b43
BLAKE2b-256 eff3a32edffb84d6cb9075ba770a79e9735e382e4aba702722dd99cee7ec5c56

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.10.0 This release

2 files

1.9.1

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.9

2 files

1.6.8

2 files

1.6.7

2 files

1.6.5

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.2

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

1 file

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.1

2 files

1.0.0

2 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