CXN - Connection
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--retriesoption 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.
Metadata
Release files for cxn 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cxn-0.0.5.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cxn-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / cxn-0.0.5.tar.gz
| Download URL | cxn-0.0.5.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0053afb15b84266f78bc219db2c61add17993b75eeafff1bf7a42cca1892761
|
|
BLAKE2b-256 checksum How to use checksums |
7421f892f5f9f258e1b7ba416e9c51a5e925e795eaae9f099a649a929fbe1b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|
Release files / cxn-0.0.5-py3-none-any.whl
| Download URL | cxn-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85ee28def2634a1effb0b00760fca18d984c4d26fd93f02fbd22e804722c2cfd
|
|
BLAKE2b-256 checksum How to use checksums |
d466d5e97a1eae99aa61b70c1750a2fca115e433e859653c431a35a5229f8144
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|