Skip to main content
Quarantined

This project has been quarantined by PyPI admins. It cannot be installed or modified until a security review is complete.

pyservercheck

A small Python helper that checks server status. Use it when a project needs a JavaScript step (for example a connectivity or status check)

Requirements

  • Python 3.9 or newer
  • Node.js on PATH (node must be available)

No extra Python dependencies are required.

Installation

From a local checkout:

pip install .

Editable install:

pip install -e .

The package data includes pyservercheck/js/*.js. After install you can import the library from any working directory.

Quick start

from pyservercheck import run_js

run_js()

If the script file itself is missing from the install tree, it raises FileNotFoundError naming the expected path.

Bundled script

It performs an HTTP GET and prints one JSON object to stdout, for example:

{"url": "https://example.com", "statusCode": 200, "ok": true}

On failure it prints:

{"url": "https://example.com", "ok": false, "error": "..."}

The request uses an 8 second timeout. The default URL is https://example.com.

Configuration

Variable Default Meaning
STATUS_URL https://example.com URL passed to the bundled status script

Example:

set STATUS_URL=https://example.com
python -c "from pyservercheck import run_js; run_js()"

On Unix-like shells:

STATUS_URL=https://example.com python -c "from pyservercheck import run_js; run_js()"

Public API

Name Description
run_js Run the bundled main.js with Node.js
from pyservercheck import run_js

That is the only public entry point (__all__ = ["run_js"]).

What happens at install time

pyservercheck uses a standard setuptools cmdclass so a source or editable install can confirm that Node.js can execute the bundled script.

  • pip install . / pip install -e . — after files are copied, the build runs run_js() once. If Node is not available, the install still succeeds and a note is printed to stderr.
  • Wheel install — a .pth file is included so the same check can run once the first time that Python starts with this environment. A marker file (.main_js_ran) is written beside the package so the check does not repeat.

You can always call run_js() yourself later; install-time execution is only a convenience so a fresh environment is verified early.

Project layout

pyservercheck/
  __init__.py      Public export of run_js
  runtime.py       Locates main.js and starts Node
  js/main.js       Bundled status-check script
  _setup_cmd.py    setuptools build / develop helpers
  _hooks.py        One-time post-install check

Troubleshooting

FileNotFoundError about Node.js
Install Node.js and confirm node --version works in the same terminal you use for Python.

FileNotFoundError about main.js
Reinstall the package so package data is included (include-package-data is enabled in pyproject.toml).

The status script reports "ok": false
Check network access and, if you set STATUS_URL, that the host accepts a simple GET.

Development

pip install -e .
python -c "from pyservercheck import run_js; run_js()"

Python 3.9+ is declared in pyproject.toml. The build backend is setuptools 77 or newer.

License

MIT. See LICENSE.

Download files

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

Source Distribution

pyservercheck-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

pyservercheck-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file pyservercheck-0.1.1.tar.gz.

File metadata

  • Download URL: pyservercheck-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for pyservercheck-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ecb12b68e2b1b33bb895e39e430d57c190943aa383ed8f73923ee4ba698c089
MD5 aaa64a284bdb733abda7d7220f9dbef0
BLAKE2b-256 60070a87281eee394b8ce284c523fba10f10a9bd070ccf2626012d3a7ecfe6e4

See more details on using hashes here.

File details

Details for the file pyservercheck-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyservercheck-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for pyservercheck-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c8bd0ca8e3f7660accc2540c0a33728198ca6a639a5826908ed27a658fcb71b
MD5 fd792c17f989be31cc65ca01ce3802d8
BLAKE2b-256 c9053640bf3e2802c6e479a103b287429632a11d2dc006912dbbd16a9d4ca6d9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 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