Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: hazelnut – A pythonic library to parse /proc/meminfo (github.com)
33 points by mrsmn on Mar 12, 2016 | hide | past | web | favorite | 8 comments

I happened to have hazelnut.io until recently. Unfortunately I let it expire since the original project I was planning on using there was much more complex than anticipated. So now it's parked by someone else [1], otherwise it was yours

[1] http://who.is/whois/hazelnut.io

Shame I didn't post this earlier, that TLD would have been awesome.

The API of this lib is probably surprising for the typical use-cases because a MemInfo object only represents a path and not a reading/snapshot of the file (each subsequent call to get() re-reads the meminfo file).

> https://github.com/mrsmn/hazelnut/blob/master/hazelnut/core....

So usage like:

   snap_pre = MemInfo()
   # Do stuff here
   snap_post = MemInfo()
   # All three would likely give different values. 
I would suggest caching the read on instantiation or making them top level functions instead of using a class or MemInfoPath()?

You can cross reference of /proc/meminfo output into the kernel source code here:


What are those keys in your donate paragraph?

Those are Worldcoin, Hobonickels and Dogecoin cryptocurrency addresses.

How is this different than psutil?

this is `cat /proc/meminfo | grep Swap`

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact