A simple Python package to fetch system health metrics.
Project description
systemhealthcheck
systemhealthcheck is a small, production-style Python package that exposes system health metrics such as:
- CPU usage percentage
- Memory usage percentage
- Disk usage percentage
- Uptime in seconds
- Basic system information
It is designed as a portfolio-ready project to showcase skills in Python packaging, testing, and CI/CD.
🚀 Installation (local development)
Clone the repository and install in editable mode:
pip install -e ".[dev]"
This installs the package and dev dependencies (like
pytest).
🧪 Usage
from systemhealthcheck import get_health
print(get_health())
Example output:
{
"cpu_percent": 12.5,
"memory_percent": 67.2,
"disk_percent": 55.0,
"uptime_seconds": 120,
"system": "Linux",
"hostname": "my-machine",
"pid": 1234
}
🧪 Running tests
pytest
🏗️ Building the package
python -m build
This will create distribution artifacts inside the dist/ folder.
📦 (Optional) Upload to PyPI
- Install twine:
pip install twine
- Upload:
twine upload dist/*
📁 Project structure
systemhealthcheck/
├── src/
│ └── systemhealthcheck/
│ ├── __init__.py
│ ├── health.py
│ └── utils.py
├── tests/
│ └── test_health.py
├── pyproject.toml
├── README.md
├── LICENSE
└── .github/
└── workflows/
└── ci.yml
✅ Features demonstrated
- Modern Python packaging with
pyproject.toml src/layout and automatic package discovery- Unit tests with
pytest - CI pipeline using GitHub Actions
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file systemhealthcheck-0.1.0.tar.gz.
File metadata
- Download URL: systemhealthcheck-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d907711e30683fc60d67528db690b36efdfe66999158097e9a0308c866c5221
|
|
| MD5 |
5d2ae79fd06b6588f0eab67e9282e771
|
|
| BLAKE2b-256 |
021dbe56278249b9304c68416473e10253c89ab20e98e27ae7239f98c667b572
|
File details
Details for the file systemhealthcheck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: systemhealthcheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab829bf70d84487244f6b984626786a8e6add4b0c45d669c071828bdaaed8a9b
|
|
| MD5 |
75006421b479b683b3956d0ce1f19c31
|
|
| BLAKE2b-256 |
d2b00f9a18b4749946608db4ade147fd7335d22d579ef2dfb040299e39f83ddc
|