Skip to main content

syspulse (Python)

Python SDK for Syspulse, a cross-platform daemon/process manager.

The syspulse package provides Python bindings to the Syspulse core runtime so you can manage background services from Python on Windows, macOS, and Linux.

Install

pip install syspulse

Supported Python versions

  • Python 3.9+
  • CPython implementation

Quick example

import syspulse

print(syspulse.__version__)

What this package contains

  • Native extension module built with PyO3
  • Typed Python package (py.typed)
  • Async-friendly client helpers

Build notes

  • Distributed as wheels and source distribution on PyPI
  • Built from Rust sources via maturin
  • If building locally, use Python <= 3.13 with current PyO3

##Examples

"""Example Python app that manages a process with syspulse."""

from __future__ import annotations

import sys
import time
from pathlib import Path

from syspulse import (  # type: ignore[reportMissingImports]  # pylint: disable=import-error
    Daemon,
    DaemonAlreadyExistsError,
    SyspulseClient,
)


DAEMON_NAME = "py-app-worker"
HERE = Path(__file__).resolve().parent
WORKER = HERE / "worker.py"


def ensure_manager_running(client: SyspulseClient) -> None:
    if not client.is_running():
        raise SystemExit(
            "syspulse manager is not running.\n"
            "Start it in another terminal with: syspulse daemon"
        )


def build_daemon() -> Daemon:
    return Daemon(
        name=DAEMON_NAME,
        command=[sys.executable, str(WORKER)],
        working_dir=str(HERE),
        description="Example worker started from a Python app",
        tags=["example", "python"],
    )


def main() -> None:
    daemon = build_daemon()

    with SyspulseClient() as client:
        ensure_manager_running(client)

        try:
            client.add(daemon)
            print(f"added daemon: {DAEMON_NAME}")
        except DaemonAlreadyExistsError:
            print(f"daemon already exists: {DAEMON_NAME} (reusing)")

        client.start(DAEMON_NAME, wait=True, timeout=15)
        status = client.status(DAEMON_NAME)
        print(f"started: state={status.state}, pid={status.pid}")

        time.sleep(5)
        logs = client.logs(DAEMON_NAME, lines=10)
        print("recent logs:")
        for line in logs:
            print(f"  {line}")

        client.stop(DAEMON_NAME)
        client.remove(DAEMON_NAME)
        print("stopped and removed daemon")


if __name__ == "__main__":
    main()

worker example to go with above

"""Tiny worker process managed by syspulse."""

from __future__ import annotations

import signal
import time


def main() -> None:
    state = {"running": True}

    def _handle_stop(_signum: int, _frame) -> None:
        print("worker: received stop signal, exiting")
        state["running"] = False

    signal.signal(signal.SIGTERM, _handle_stop)
    signal.signal(signal.SIGINT, _handle_stop)

    print("worker: started")
    i = 0
    while state["running"]:
        i += 1
        print(f"worker: heartbeat {i}")
        time.sleep(2)

    print("worker: shutdown complete")


if __name__ == "__main__":
    main()

License

MIT

Metadata

Release files for syspulse 0.1.1

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

Source distribution (sdist)

Source distribution for syspulse 0.1.1
File Size Uploaded Provenance Actions
syspulse-0.1.1.tar.gz 53.3 kB Without provenance Details for syspulse-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for syspulse 0.1.1
File Interpreter ABI Platform Actions
syspulse-0.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for syspulse-0.1.1-cp312-cp312-win_amd64.whl

Total release size: 1.8 MB

Release files / syspulse-0.1.1.tar.gz

Download URL syspulse-0.1.1.tar.gz
Size 53.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e069d1575d167e9a13d4d1f31815724aa907da132189287e8804e4b7f659da85
BLAKE2b-256 checksum
How to use checksums
0941c57d007b5e5877ed92d379a367abd049668c96a63cf9304083932be5ca81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.12.4

Release files / syspulse-0.1.1-cp312-cp312-win_amd64.whl

Download URL syspulse-0.1.1-cp312-cp312-win_amd64.whl
Size 1.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
593997ace989d2eab579ab892f76e96816dfd2d399caeb0095993ab73bf900da
BLAKE2b-256 checksum
How to use checksums
0d27ed53ca2c24c06cd627e93f3841eda48d75e43bae2d6b6490511b75c76de7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.12.4

Security for syspulse 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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