Skip to main content

wait-for-dep

Waits for a dependency before continuing. It's ment to be used in startup scripts like Docker's entrypoint.

Installing

pip install wait-for-dep

Usage

wait-for-dep dependency-url-1 dependency-url-2 ... dependency-url-n

ie:

wait-for-dep https://my-server/healthz/ psql://user@db-host/db-name

Available checks

HTTP(s)

HTTP and HTTPS are available by default. Follows redirects; only response with HTTP code 2XX is accepted as valid.

Accepted URL schemas

  • http://
  • https://

Example

wait-for-dep https://my-server/healthz/ http://my-server/healthz/

PostgreSQL

RDBMS has to accept connection and allow to perform simple SELECT query.

Installation

pip install wait-for-dep[postgres]

Accepted URL schemas

  • postgres://
  • postgresql://
  • psql://

Example

wait-for-dep psql://admin:password@db-host/db_name

MySQL

RDBMS has to accept connection and allow to perform simple SELECT query.

Installation

pip install wait-for-dep[mysql]

Accepted URL schemas

  • mysql://

Example

wait-for-dep mysql://admin:password@db-host/db_name

Redis

Rdis has to accept connection to selected database (defaults to 0).

Installation

pip install wait-for-dep[redis]

Accepted URL schemas

  • redis://

Example

wait-for-dep redis://redis-host/5

Memcached

Memcached has to accept connection.

Installation

pip install wait-for-dep[memcached]

Accepted URL schemas

  • memcached://

Example

wait-for-dep memcached://memcached-host/

MongoDB

MongoDB has to accept connection.

Installation

pip install wait-for-dep[mongodb]

Accepted URL schemas

  • mongodb://

Example

wait-for-dep mongodb://admin:password@db-host/db_name

RabbitMQ

RabbitMQ has to accept connection to given vhost. You can use optional querystring params require_queue and require_exchange to additionaly check if particular queue or exchange exists (check will fail otherwise).

Installation

pip install wait-for-dep[amqp]

Accepted URL schemas

  • amqp://

Example

wait-for-dep amqp://admin:password@rabbit-host/vhost
wait-for-dep amqp://admin:password@rabbit-host/vhost?require_queue=myqueue
wait-for-dep amqp://admin:password@rabbit-host/vhost?require_exchange=myexchange
wait-for-dep amqp://admin:password@rabbit-host/vhost?require_exchange=myexchange&require_exchange=mysecondexchange&require_queue=myqueue&require_queue=mysecondqueue

Apache Kafka

Kafka has to accept connection. In HA mode (node count > 1) only one node is required to accept the connection.

Installation

pip install wait-for-dep[kafka]

Accepted URL schemas

  • kafka://

Example

wait-for-dep kafka://kafka-host/
wait-for-dep kafka://kafka-first-host/,kafka://kafka-second-host/

TCP

Plain TCP is available by default. Service port is required.

Accepted URL schemas

  • tcp://

Example

wait-for-dep tcp://my-server:7624

Unix

Unix sockets are available by default.

Accepted URL schemas

  • unix://

Example

wait-for-dep unix:///var/run/docker.sock

Metadata

Release files for wait-for-dep 0.5.0

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

Source distribution (sdist)

Source distribution for wait-for-dep 0.5.0
File Size Uploaded Provenance
wait_for_dep-0.5.0.tar.gz 8.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wait-for-dep 0.5.0
File Interpreter ABI Platform
wait_for_dep-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / wait_for_dep-0.5.0.tar.gz

Download URL wait_for_dep-0.5.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f12e839f797ba39a53dc4645864a2b443e920261275b0fd0981a87f7937cf00d
BLAKE2b-256 checksum
How to use checksums
ee0d9345ed046fa1111c8312369be9207c1c005041b6f0c8a2c9935089b7cffe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.21

Release files / wait_for_dep-0.5.0-py3-none-any.whl

Download URL wait_for_dep-0.5.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c58edd0709270a010e58d8cdd8078d61881cfc3b16bb14eff9e3afc66a25464d
BLAKE2b-256 checksum
How to use checksums
c548eb612b5abe375a25ff1b19565e6fdbcf9b8fc9cc0e6045855fea5b49bfdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.21

Security for wait-for-dep 0.5.0

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.

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