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.0.tar.gz (5.4 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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyservercheck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3fb40d094c150b6a5e73c388ca380acb2bd36d9860fe5cdb0dc77f1b3e00ee0
MD5 a43514ce4bb9633182c1ed9b7f76ba00
BLAKE2b-256 dd65cb49104f27de44fe0cf3e6b89c582c618e6497c2409efce6986438db7981

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyservercheck-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe6c969cdb4c051707b06fb0b0d2e9f9d47b5ad91b6d8f3531434edc79097e81
MD5 d8060abf722e151f267bbfaf17fee3c4
BLAKE2b-256 ee72fbf95dc932e7e48bb6fb34088093d91fc56b5ec9e46421f83ee4fbd231be

See more details on using hashes here.

Release history Release notifications | RSS feed

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