Skip to main content

CXN (short for Connection) is a lightweight command-line tool to verify connectivity between services

Project description

CXN - Connection

PyPI - Version PyPI - Python Version


CXN (short for Connection) is a lightweight command-line tool created to verify connectivity between services. It aims to be as minimalistic as possible by reducing dependency conflicts and utilizing the existing Python environment on your system. The tool leverages pre-installed third-party Python packages to manage connection logic.

Installation

pip install cxn

Arguments

  • provider: The name of the third-party Python package that facilitates the connection.

Note: CXN does not manage the installation of these third-party packages. Ensure that the required packages are installed in your Python environment.

Options

  • -u, --url (required): Specifies the connection URL for the provider.
  • -t, --terminate: Exits with an error if the connection cannot be established.
  • -v, --version: Displays the program's version number and exits.
  • -b, --backoff: Enables exponential backoff for retrying connections indefinitely unless the --retries option is specified.
  • -r, --retries: Specifies the number of retries before giving up. Works with both backoff and non-backoff modes. In backoff mode, defaults to indefinite retries if not specified; in non-backoff mode, defaults to a single attempt.

Available Providers

You can list the available providers and their supported schemas by using the -h or --help option.

Currently, the supported providers are:

  • redis: Supports redis
  • psycopg: Supports postgresql
  • kombu: Supports amqp

Stay tuned for more providers coming soon!

Examples

Check connectivity to a service using a specific provider:

cxn --url redis://localhost:6379/0 kombu
cxn --url postgresql://user:password@localhost:5432/mydatabase?sslmode=disable psycopg

Check connectivity to a service using a specific provider with exponential backoff and unlimited retries:

cxn --url redis://localhost:6379/0 --backoff kombu

Check connectivity to a service with a specific number of retries in both backoff and non-backoff modes:

cxn --url postgresql://user:password@localhost:5432/mydatabase?sslmode=disable --retries 5 psycopg
cxn --url redis://localhost:6379/0 --backoff --retries 3 kombu

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or suggestions.

License

cxn is distributed under the terms of the MIT license.

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

cxn-0.0.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

cxn-0.0.5-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file cxn-0.0.5.tar.gz.

File metadata

  • Download URL: cxn-0.0.5.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for cxn-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a0053afb15b84266f78bc219db2c61add17993b75eeafff1bf7a42cca1892761
MD5 66819d0fd6a471a050b492dccf4e36c9
BLAKE2b-256 7421f892f5f9f258e1b7ba416e9c51a5e925e795eaae9f099a649a929fbe1b73

See more details on using hashes here.

File details

Details for the file cxn-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: cxn-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for cxn-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 85ee28def2634a1effb0b00760fca18d984c4d26fd93f02fbd22e804722c2cfd
MD5 7ccc2c3dda9c3c11b77064fdc0b29820
BLAKE2b-256 d466d5e97a1eae99aa61b70c1750a2fca115e433e859653c431a35a5229f8144

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page