Skip to main content

checkconnectnet

A tiny, dependency-free Python library for checking whether an HTTP or HTTPS endpoint is reachable.

Installation

pip install checkconnectnet

Usage

from checkconnectnet import is_connected

if is_connected():
    print("Online")
else:
    print("Offline")

You can choose the URL and timeout:

from checkconnectnet import check_connection

result = check_connection("https://example.com", timeout=3)
print(result.connected, result.status_code, result.elapsed_seconds, result.error)

The default URL is https://icanhazip.com/. Any HTTP response proves that the network request reached the server, including responses such as 403 or 404.

Command line

checkconnectnet
checkconnectnet --url https://example.com --timeout 3

The command exits with code 0 when connected and 1 when the request fails.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkconnectnet-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

checkconnectnet-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: checkconnectnet-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for checkconnectnet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c46f229b5f3a982cb55b10d64867196664b8daa928d4bb248afa01da0035dd39
MD5 3455e9edd948e42cd34d1dc304517ae8
BLAKE2b-256 828881e66124ae72029f3d33fbb77ee5955b32a0c88ac4b38e59e06a88527008

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for checkconnectnet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16e30648ccad42e1191a74d3b79d0663a31d61fe93e4d002a5ff307fe082bd0f
MD5 4c33fa40840d35d8561493f765dad8a1
BLAKE2b-256 beb131000218779ad3a94c6a629ce1f84592f54d025e1c051260ab1b3563995c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4

2 files

1.2

2 files

This release

0.1.0 This release

2 files

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