Coder Social home page Coder Social logo

waffle-iron / pyspectator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from it-geeks-club/pyspectator

0.0 1.0 0.0 673 KB

:eyes: Cross-platform tool for monitoring resources of OS

Home Page: http://uzumaxy.github.io/pyspectator/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

pyspectator's Introduction

'Stories in Ready'

Summary

pyspectator is a Python cross-platform tool for monitoring resources of OS: CPU, memory, disk, network.

Requirements

  • OS: Linux, Windows, FreeBSD, Solaris
  • Python version: 3.X
  • Packages: psutil, netifaces, wmi (only on Windows), enum34 (only on python 3.0.0 - 3.4.0)

How to install

Run as root user:

pip install pyspectator

Example of usage

There is simple project named pyspectator_tornado developed special for demonstration of pyspectator features.

General information CPU Disk devices Network

How to use

You can use pyspectator as module for your own project. Simple example of usage is presented in file "console.py".

NOTE: on Windows pyspectator can require elevated privileges.

Class "Computer"

>>> from pyspectator.computer import Computer
>>> computer = Computer()
>>> computer.os
'Linux 3.14.4-1-MANJARO'
>>> computer.python_version
'CPython ver. 3.4.1'
>>> computer.uptime
'1:07:52'
>>> computer.processor.name
'Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz'

Class "Cpu"

>>> from pyspectator.processor import Cpu
>>> from time import sleep
>>> cpu = Cpu(monitoring_latency=1)
>>> with cpu:
...     for _ in range(8):
...        cpu.load, cpu.temperature
...        sleep(1.1)
...
(22.6, 55)
(6.1, 55)
(5.5, 54)
(7.1, 54)
(5.6, 54)
(7.0, 54)
(10.2, 54)
(6.6, 54)

pyspectator's People

Contributors

eterey avatar waffle-iron avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.