Skip to main content

EnvDetect

EnvDetect is a lightweight Python library for detecting detailed system environment information, including OS, CPU, memory, GPU, Python runtime, and installed packages.

It can be used for debugging, reproducibility, environment validation, or as part of ML/AI pipelines where knowing the exact system setup is crucial.


Features

  • OS Information: Name, version, release, architecture, and more.
  • CPU Information: Count, frequency, brand, cores, cache sizes, etc.
  • Memory Information: Total, available, used, swap, and percentages.
  • GPU Information: Vendor, name, driver version, VRAM, and more (if available).
  • Python Runtime: Version, implementation, executable path, installed packages.
  • Environment Summary: Aggregates all details into one dictionary for easy export/logging.

Installation

pip install envdetect

Usage

from envdetect import os_info, cpu_info, memory_info, gpu_info, python_info, environment_summary

print("=== OS Info ===")
print(os_info())

print("=== CPU Info ===")
print(cpu_info())

print("=== Memory Info ===")
print(memory_info())

print("=== GPU Info ===")
print(gpu_info())

print("=== Python Info ===")
print(python_info())

print("=== Full Environment Summary ===")
print(environment_summary())

CLI

python -m envdetect

This will print a full environment summary in JSON format.

Example Output

{
  "os": {
    "system": "Linux",
    "release": "5.15.0-78-generic",
    "version": "#85-Ubuntu SMP Tue Jun 6 23:34:54 UTC 2023",
    "architecture": ["64bit", "ELF"],
    "machine": "x86_64",
    "processor": "Intel(R) Xeon(R) CPU"
  },
  "cpu": {
    "physical_cores": 4,
    "total_cores": 8,
    "cpu_freq_mhz_max": 4200.0,
    "cpu_freq_mhz_min": 800.0,
    "cpu_freq_mhz_current": 2300.0,
    "l1_cache_kb": 256,
    "l2_cache_kb": 1024,
    "l3_cache_kb": 8192,
    "brand": "Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz"
  },
  "memory": {
    "total": 16,
    "available": 10.5,
    "used": 5.3,
    "percent": 34.5,
    "swap_total": 2,
    "swap_used": 0.1,
    "swap_free": 1.9
  },
  "gpu": [
    {
      "id": "GPU-0",
      "name": "NVIDIA GeForce RTX 3070",
      "driver_version": "535.54",
      "memory_total_MB": 8000,
      "memory_free_MB": 6500,
      "memory_used_MB": 1500
    }
  ],
  "python": {
    "version": "3.10.12",
    "implementation": "CPython",
    "executable": "/usr/bin/python3",
    "packages_count": 240
  }
}

Running Tests

python -m unittest discover -s tests

Release files for envdetect 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envdetect 0.1.0
File Size Uploaded
envdetect-0.1.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for envdetect 0.1.0
File Interpreter ABI Platform
envdetect-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / envdetect-0.1.0.tar.gz

Download URL envdetect-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1615893045b3102f9a801bcd47967ead2a336a85c5db13e8795c57135d915e3f
BLAKE2b-256 checksum
How to use checksums
9df0867ce3c44ac764659c68bb35c63d7ac30aaa18839cfe8560febbb4670a21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / envdetect-0.1.0-py3-none-any.whl

Download URL envdetect-0.1.0-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
160658c58b9cf6c678b857862262cb893a2bf3b19869c614d0fbf787c470b960
BLAKE2b-256 checksum
How to use checksums
14a417ea36c8f287f4789151cc8eedb912d262eb94f5592f947a34a2c4344419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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