Giter Club home page Giter Club logo

psutil-nim's Introduction

Psutil-Nim

Port of Python psutil to Nim.

Pull requests with bug fixes and support for other platforms are welcome!

Table of Contents

Background

I love Python and psutil but bundling a Python app is a pain. Having a psutil library in Nim seemed like the logical next step.

Install

  • nimble install psutil

This package works Ok as of Nim 1.0.6. Pull requests welcome.

Usage

Just some basic usage below until I get the example apps working and can mirror what's in psutil's documentation. Take a look at the scripts folder for some basic examples as well.

import psutil

echo net_if_addrs()
echo boot_time()
echo users()

Troubleshooting

If you are running on CentOS or RedHat you may or may not find errors with the Network related functions, complaining about missing Linux C Headers sockios.h to Compile, this is not a Bug on the code but that Distro not having development libraries or having too old versions of it.

You can try installing the package kernel-headers for CentOS/RedHat, to see if that fixes the problem about missing libraries.

If you know how to fix that Distro-specific detail feel free to send pull requests.

The failing functions are:

net_io_counters()
per_nic_net_io_counters()
net_if_stats()
net_connections()

You can workaround by using Distros module:

when not detectOs(CentOS):
  # Do something here with the Network functions.
  echo net_io_counters()
  echo per_nic_net_io_counters()
  echo net_if_stats()
  echo net_connections()

Stars

Star psutil-nim on GitHub

Contribute

PRs accepted! Adding a single function to any platform is a huge help and can usually be done with less than an hour of work.

License

  • MIT

psutil-nim's People

Contributors

johnscillieri avatar bung87 avatar juancarlospaco avatar techno-fox avatar iffy avatar xbello 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.