Skip to content

Repository files navigation

sysprober

PyPI - Version PyPI - Downloads GitHub License Matrix

A Python library for probing system-level information about a machine.

sysprober provides a set of utilities for retrieving details about the CPU, memory, network interfaces, PCI devices, and package manager on a Linux system. It is designed to be used by charms and other tools that need to gather system information programmatically.

Current probing modules shipped in the sysprober package include:

from sysprober import ...

  • cpu: Probe CPU architecture, model, cores, and frequency.
  • memory: Probe total and available memory.
  • network: Probe network interfaces, IP addresses, and MAC addresses.
  • pci: Probe PCI device information.
  • pkgmanager: Detect the system package manager.

✨ Getting Started

Installation

Option 1: Install from PyPI

python3 -m pip install sysprober

Option 2: Install from source

pip install .

Usage

from sysprober import cpu, memory, network

# Probe CPU information
cpu_info = cpu.probe()
print(cpu_info.architecture)

# Probe memory information
mem_info = memory.probe()
print(mem_info.total)

# Probe network interfaces
net_info = network.probe()
for iface in net_info.interfaces:
    print(iface.name, iface.ip_address)

🤔 What's next?

If you want to learn more about all the things you can do with sysprober, here are some further resources for you to explore:

🛠️ Development

The project uses tox for development, which provides some useful commands that will help you while hacking on sysprober:

tox -e fmt           # Apply formatting standards to code
tox -e lint          # Check code against coding style standards
tox -e network       # Run unit tests

If you're interested in contributing your work to sysprober, take a look at our contributing guidelines for further details.

🤝 Project and community

sysprober is a project of the Ubuntu High-Performance Computing community. Interested in contributing bug fixes, new editors, documentation, or feedback? Want to join the Ubuntu HPC community? You've come to the right place 🤩

Here's some links to help you get started with joining the community:

📋 License

sysprober is free software, distributed under the Apache Software License, version 2.0. See the Apache-2.0 LICENSE file for further details.

About

Probe your Linux host for information about itself

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages