Skip to main content

microservice-utils

Utilities and adapters for speeding up microservice development.

Optional Dependencies (Extras)

The package offers optional functionality through extras. Extras can be installed with the package using the following syntax:

pip install microservice-utils[gcp_pubsub]

Available extras:

  • events: Support for event-driven architectures using pydantic for data validation and parsing.
  • gcp_cloud_run: Support for Google Cloud Run with the google-cloud-run client library.
  • gcp_cloud_tasks: Support for Google Cloud Tasks with the google-cloud-tasks client library.
  • gcp_pubsub: Support for Google Cloud Pub/Sub using the google-cloud-pubsub client library and tenacity for retries.
  • gcp_storage: Use GCP Cloud Storage with the async gcloud-aio-storage library.
  • novu: Support for the open-source novu notification center. Can copy every write Novu accepts to a second, Novu-compatible endpoint (docs/novu/mirror.md).
  • openai: Support for completions with the OpenAI API.
  • pinecone: Support for semantic search with Pinecone. The adapter embeds documents with sentence-transformers, so this extra installs it too, and with it PyTorch — expect a large download.
  • telnyx: Support for the Telnyx messaging API.

To install multiple extras, separate them with commas:

pip install microservice-utils[events,gcp_cloud_run,gcp_cloud_tasks,gcp_pubsub,openai,pinecone]

Checks

The checks run with nox, the same way locally and in CI:

nox              # format, lint and test
nox -e check_base check_extras
nox -e check_extras_heavy

CI runs every session with --default-venv-backend uv, so the environments install with uv instead of pip. With uv installed, add the same flag locally for much faster installs.

test installs every extra into one environment, so it cannot tell whether an extra declares what its own modules import. check_base and check_extras close that gap: each installs the package with one extra and nothing else, then imports the modules that extra exists for, so an extra that under-declares its dependencies fails here instead of on a user's machine. The mapping from extra to modules lives in noxfile.py, and adding an extra to setup.py without listing it there fails the check. check_extras_heavy is the same check for the extras that pull PyTorch. CI runs it on every pull request as well, in a job of its own so that a download that large does not hold up the quick checks.

GCP Pub/Sub

You can subscribe to multiple subscriptions by subsequently calling subscribe(). wait_for_shutdown will block IO for all the subscriptions and wait for the app to be signaled to shut down.

from microservice_utils.google_cloud.adapters.pubsub import Subscriber

subscriber = Subscriber("your-gcp-project-id", prepend_value="staging")

with subscriber:
    subscriber.subscribe(
        "accounts__users", sample_handler
    )

    try:
        subscriber.wait_for_shutdown()
    except KeyboardInterrupt:
        # Gracefully shut down in response to Ctrl+C (or other events)
        subscriber.shutdown()

Releasing a new version

  • Update the package version using semver rules (microservice-utils/__init__.py)
  • Commit and push change
  • Create a new tag with the version (e.g. git tag -a vx.x.x -m '')
  • git push --tags to push the new tag and start the release workflow

Todos

  • Events
  • GCP Pub/Sub
  • GCP Cloud Tasks
  • JWT validation utils
  • Logging

Metadata

Release files for microservice-utils 0.19.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 microservice-utils 0.19.1
File Size Uploaded Provenance Actions
microservice_utils-0.19.1.tar.gz 44.9 kB With provenance Details for microservice_utils-0.19.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for microservice-utils 0.19.1
File Interpreter ABI Platform Actions
microservice_utils-0.19.1-py3-none-any.whl Python 3 none any Details for microservice_utils-0.19.1-py3-none-any.whl

Total release size: 99.6 kB

Release files / microservice_utils-0.19.1.tar.gz

Download URL microservice_utils-0.19.1.tar.gz
Size 44.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9376a0a144284d43b23ce01e4417763567b180fa7acc71b9d9ea046316b4296a
BLAKE2b-256 checksum
How to use checksums
ff30a8d92d86cef3613a2254f27a27b01883347aea7efea8d356522ccab6e1b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / microservice_utils-0.19.1-py3-none-any.whl

Download URL microservice_utils-0.19.1-py3-none-any.whl
Size 54.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf582ba9f97aab7f7280e95fc1b518db644eb3bc7893ae08fe1c5b4e7a7a7888
BLAKE2b-256 checksum
How to use checksums
4b63456f484bb36bb0805935ebcb3587ca16f4c7cf75eaa5c4edb137f42298f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for microservice-utils 0.19.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for microservice_utils-0.19.1.tar.gz

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 Nov 20, 2026.

Transparency log

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.19.1 This release

2 release files Full 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