This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

hazelnut is an APACHE licensed library written in Python designed to provide a simple and pythonic way to parse the /proc/meminfo file on LINUX based systems.

Installation:

From source use

$ python setup.py install

or install from PyPi

$ pip install hazelnut

Documentation:

  • Basic use:
>>> from hazelnut import MemInfo
>>> mem = MemInfo()
>>> mem
MemTotal:        8092252 kB
MemFree:         5444872 kB
MemAvailable:    7138880 kB
Buffers:          484724 kB
Cached:          1299716 kB
SwapCached:            0 kB
Active:          1732744 kB
Inactive:         671312 kB
Active(anon):     509420 kB
Inactive(anon):   111312 kB
Active(file):    1223324 kB
Inactive(file):   560000 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      16776188 kB
SwapFree:       16776188 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        619632 kB
Mapped:            96216 kB
Shmem:              1120 kB
Slab:             184200 kB
SReclaimable:     159252 kB
SUnreclaim:        24948 kB
KernelStack:        3856 kB
PageTables:         5664 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    20822312 kB
Committed_AS:    1755880 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      362896 kB
VmallocChunk:   34359343324 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       97980 kB
DirectMap2M:     8187904 kB
  • Return output as dict:
>>> mem.dict()
{
    "Inactive": "671312 kB",
    "Mlocked": "0 kB",
    "HardwareCorrupted": "0 kB",
    "Bounce": "0 kB",
    "Active": "1746544 kB",
    "Cached": "1299720 kB",
    "Unevictable": "0 kB",
    "SReclaimable": "159256 kB",
    "DirectMap2M": "8187904 kB",
    "Buffers": "484736 kB",
    "Hugepagesize": "2048 kB",
    "MemAvailable": "7126028 kB",
    "HugePages_Rsvd": "0",
    "Inactive(anon)": "111312 kB",
    "CommitLimit": "20822312 kB",
    "SUnreclaim": "24940 kB",
    "Inactive(file)": "560000 kB",
    "SwapCached": "0 kB",
    "HugePages_Total": "0",
    "Active(file)": "1223340 kB",
    "Writeback": "0 kB",
    "Dirty": "0 kB",
    "PageTables": "5700 kB",
    "Shmem": "1120 kB",
    "MemFree": "5432004 kB",
    "Mapped": "96256 kB",
    "WritebackTmp": "0 kB",
    "Slab": "184196 kB",
    "HugePages_Free": "0",
    "AnonPages": "633396 kB",
    "HugePages_Surp": "0",
    "DirectMap4k": "97980 kB",
    "Committed_AS": "1774860 kB",
    "VmallocUsed": "362896 kB",
    "MemTotal": "8092252 kB",
    "SwapTotal": "16776188 kB",
    "NFS_Unstable": "0 kB",
    "VmallocTotal": "34359738367 kB",
    "Active(anon)": "523204 kB",
    "KernelStack": "3856 kB",
    "SwapFree": "16776188 kB",
    "AnonHugePages": "0 kB",
    "VmallocChunk": "34359343324 kB"
}
  • Search (is case insensitive):
>>> mem.search('Swap')
['SwapCached:            0 kB\n', 'SwapTotal:      16776188 kB\n', 'SwapFree:       16776188 kB\n']
  • Get memory usage as int (is case sensitive):
>>> mem.get('Inactive(anon)')
111312

License:

Apache v2.0 License
Copyright 2014-2015 Martin Simon

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

Buy me a coffee?

If you feel like buying me a coffee (or a beer?), donations are welcome:

WDC : WbcWJzVD8yXt3yLnnkCZtwQo4YgSUdELkj
HBN : F2Zs4igv8r4oJJzh4sh4bGmeqoUxLQHPki
DOGE: DRBkryyau5CMxpBzVmrBAjK6dVdMZSBsuS
Release History

Release History

0.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
hazelnut-0.4.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Apr 28, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting