Skip to main content

Python wrapper for the Temporal development server CLI

Project description

Temporal Server Python Wrapper (Experimental)

[Experimental AI-generated prototype project; not intended for public use]

PyPI version

This package provides a convenient way to install and run the Temporal development server (temporal server start-dev) via the Python packaging ecosystem, particularly leveraging uv.

It bundles the official pre-compiled temporal CLI binary (currently v1.3.0) for your platform within a Python distribution package named dandavison-temporalio-server. The actual Python code is importable as temporalio_server.

Usage

This package provides the temporal-server command, which acts as a wrapper around the underlying temporal server start-dev command.

Running the Server (Command Line)

The easiest way to run the latest development server without installing it persistently is using uvx:

# Install/run dandavison-temporalio-server, execute its 'temporal-server' command
uvx dandavison-temporalio-server temporal-server start-dev

# Run with custom ports
uvx dandavison-temporalio-server temporal-server start-dev --port 7234 --ui-port 8234

Alternatively, you can install the tool persistently:

# Install the distribution package
uv tool install dandavison-temporalio-server

# Now run the 'temporal-server' command it provides
# (may require shell restart or `uv tool update-shell` first)
temporal-server start-dev

Using the Server in Python (Tests/Scripts)

This package also provides an async context manager (temporalio_server.DevServer) for programmatically starting and stopping the development server.

To use the DevServer context manager, you need to install the distribution package dandavison-temporalio-server with the [examples] extra, which includes the temporalio Python SDK dependency:

# Install the distribution package with extras
uv pip install 'dandavison-temporalio-server[examples]'

# Or, if using uv project management, add it to your pyproject.toml:
# uv add 'dandavison-temporalio-server[examples]'

Example usage in Python (importing from the source module name):

import asyncio
import logging
# Ensure temporalio SDK is installed via the [examples] extra
from temporalio.client import Client
# Import from the source module name
from temporalio_server import DevServer

logging.basicConfig(level=logging.INFO)

async def main():
    logging.info("Starting dev server...")
    # Start server, waits until ready, stops on exit
    async with DevServer(log_level="info") as server:
        logging.info(f"Dev server ready at {server.target}")

        # Connect a client (requires temporalio SDK installed)
        client = await Client.connect(server.target)
        logging.info("Client connected.")

        # ... your code using the client ...
        logging.info("Example task finished.")

    logging.info("Dev server stopped.")

if __name__ == "__main__":
    asyncio.run(main())

See example.py in the repository for a runnable example.

Development

This project uses uv for environment management and hatchling as the build backend.

  • Setup: uv venv && uv sync --all-extras (to install dev dependencies if any are added)
  • Build: uv build
  • Run Example: uv run python example.py

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

dandavison_temporalio_server-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

dandavison_temporalio_server-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file dandavison_temporalio_server-0.1.0.tar.gz.

File metadata

File hashes

Hashes for dandavison_temporalio_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fdde935425446fa0ab7a6d4b50e5839eb94eb1a3a1eb60a3b8409d8f769d9e41
MD5 41fdc7f6292b968185a149ea55d61c4a
BLAKE2b-256 a4c3a27610de7fa0364cda11ad739d648b5129d2fa940504f711b00a0002a248

See more details on using hashes here.

File details

Details for the file dandavison_temporalio_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dandavison_temporalio_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90324ce1f99c3645073ae72ca9be7a269e85193c226852ef130074accb865730
MD5 f7f80f6c70ed79c79144bd8ca4ade74f
BLAKE2b-256 a9e67f2ceeabbe27f35303a117e974f8a22e5a9738ff20b7693d9c5ef482794c

See more details on using hashes here.

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