Skip to main content

System resource info, processor usage logging, RAM limit — standalone module from the SciTeX ecosystem

Project description

scitex-resource

System resource info, processor usage logging, and RAM limiting helpers, extracted from the SciTeX ecosystem as a standalone package.

Install

pip install scitex-resource

API

import scitex_resource as r

# Snapshot of CPU / RAM / disk / GPU / monitor info
specs = r.get_specs()

# CPU/RAM samples (one-shot)
usage = r.get_processor_usages()

# Continuous logging (CSV)
r.log_processor_usages("/tmp/usage.csv", limit_min=30, interval_s=1)

# Cap process RAM
r.limit_ram(0.5)

Status

Standalone fork of scitex.resource. Deps: pandas, psutil, PyYAML, matplotlib.

Decoupling notes:

  • scitex.str.readable_bytes / scitex.gen.fmt_size / scitex.str.printc → vendored as 3 small helpers in _compat.py.
  • scitex.io._load.load / scitex.io._save.save → use pandas.read_csv / to_csv directly for the CSV log files; defer to scitex.io only if a non-CSV path is requested (raises ImportError without scitex installed).
  • scitex.sh.sh → prefer scitex_sh if installed, fall back to plain subprocess.run (list-only).
  • scitex.session.start/close __main__ block → simplified to plain main().

The umbrella package's scitex.resource import path is preserved via a sys.modules-alias bridge. 65/65 tests pass.

License

AGPL-3.0-only (see 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

scitex_resource-0.1.0.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

scitex_resource-0.1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_resource-0.1.0.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scitex_resource-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0012c475ba992fc6be43a056471a34cb3aa032ef806c10376fb717688f904506
MD5 c0b6b510b0d0e6e60473676b0db2fa94
BLAKE2b-256 757731a049f143c1764c679adaf107694475af00f797c1359cd665fb75160796

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scitex_resource-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3da1f9644262b6e09012b01306164905dfbce9a342ec4254e7ed0a6c2a2aa1bd
MD5 58a1c06bc6058e402bfb28b83d702613
BLAKE2b-256 c5d0671e2416868830a8111cc5e9d260cd2c15837cb19ec87a5ba65473448e12

See more details on using hashes here.

Supported by

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