{ "info": { "author": "Martin Simon", "author_email": "me@martinsimon.me", "bugtrack_url": null, "classifiers": [], "description": "

\"hazelnut\" hazelnut

\n\n[![PyPi Version](http://img.shields.io/pypi/v/hazelnut.svg)](https://pypi.python.org/pypi/hazelnut/)\n\n\n**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.\nThis library has been tested with Python 2.7.x and Python 3.6.x.\n\n\n## Installation:\n\nFrom source use\n\n\t\t$ python setup.py install\n\nor install from PyPi\n\n\t\t$ pip install hazelnut\n\n## Documentation:\n\n- Basic use:\n\n```\n>>> from hazelnut import MemInfo\n>>> mem = MemInfo()\n>>> mem\nMemTotal: 8092460 kB\nMemFree: 499880 kB\nMemAvailable: 5454920 kB\nBuffers: 219088 kB\nCached: 4980040 kB\nSwapCached: 7576 kB\nActive: 5647392 kB\nInactive: 1628708 kB\nActive(anon): 1794356 kB\nInactive(anon): 492656 kB\nActive(file): 3853036 kB\nInactive(file): 1136052 kB\nUnevictable: 200 kB\nMlocked: 200 kB\nSwapTotal: 16776188 kB\nSwapFree: 16639112 kB\nDirty: 172 kB\nWriteback: 0 kB\nAnonPages: 2070440 kB\nMapped: 204800 kB\nShmem: 210036 kB\nSlab: 247884 kB\nSReclaimable: 219356 kB\nSUnreclaim: 28528 kB\nKernelStack: 4144 kB\nPageTables: 11904 kB\nNFS_Unstable: 0 kB\nBounce: 0 kB\nWritebackTmp: 0 kB\nCommitLimit: 20822416 kB\nCommitted_AS: 3317504 kB\nVmallocTotal: 34359738367 kB\nVmallocUsed: 362844 kB\nVmallocChunk: 34359347296 kB\nHardwareCorrupted: 0 kB\nAnonHugePages: 0 kB\nHugePages_Total: 0\nHugePages_Free: 0\nHugePages_Rsvd: 0\nHugePages_Surp: 0\nHugepagesize: 2048 kB\nDirectMap4k: 83644 kB\nDirectMap2M: 8202240 kB\n```\n\n- Return output as dict:\n\n```\n>>> mem.dict()\n{\n\t\"WritebackTmp\": \"0 kB\",\n\t\"SwapTotal\": \"16776188 kB\",\n\t\"Active(anon)\": \"1794356 kB\",\n\t\"SwapFree\": \"16639112 kB\",\n\t\"DirectMap4k\": \"83644 kB\",\n\t\"KernelStack\": \"4144 kB\",\n\t\"MemFree\": \"499880 kB\",\n\t\"HugePages_Rsvd\": \"0\",\n\t\"Committed_AS\": \"3317504 kB\",\n\t\"SUnreclaim\": \"28528 kB\",\n\t\"NFS_Unstable\": \"0 kB\",\n\t\"VmallocChunk\": \"34359347296 kB\",\n\t\"Writeback\": \"0 kB\",\n\t\"Inactive(file)\": \"1136052 kB\",\n\t\"MemTotal\": \"8092460 kB\",\n\t\"VmallocUsed\": \"362844 kB\",\n\t\"HugePages_Free\": \"0\",\n\t\"AnonHugePages\": \"0 kB\",\n\t\"Shmem\": \"210036 kB\",\n\t\"AnonPages\": \"2070440 kB\",\n\t\"Active\": \"5647392 kB\",\n\t\"Inactive(anon)\": \"492656 kB\",\n\t\"HugePages_Total\": \"0\",\n\t\"Hugepagesize\": \"2048 kB\",\n\t\"Cached\": \"4980040 kB\",\n\t\"SwapCached\": \"7576 kB\",\n\t\"VmallocTotal\": \"34359738367 kB\",\n\t\"Dirty\": \"172 kB\",\n\t\"Mapped\": \"204800 kB\",\n\t\"Unevictable\": \"200 kB\",\n\t\"SReclaimable\": \"219356 kB\",\n\t\"MemAvailable\": \"5454920 kB\",\n\t\"Slab\": \"247884 kB\",\n\t\"DirectMap2M\": \"8202240 kB\",\n\t\"HugePages_Surp\": \"0\",\n\t\"Bounce\": \"0 kB\",\n\t\"Inactive\": \"1628708 kB\",\n\t\"PageTables\": \"11904 kB\",\n\t\"HardwareCorrupted\": \"0 kB\",\n\t\"CommitLimit\": \"20822416 kB\",\n\t\"Mlocked\": \"200 kB\",\n\t\"Buffers\": \"219088 kB\",\n\t\"Active(file)\": \"3853036 kB\"\n}\n```\n\n- Search (is case insensitive):\n\n```\n>>> mem.search('Swap')\n['SwapCached: 7576 kB\\n', 'SwapTotal: 16776188 kB\\n', 'SwapFree: 16639112 kB\\n']\n```\n\n- Get memory usage as int (is case sensitive):\n\n```\n>>> mem.get('Inactive(anon)')\n492656\n```\n\n## License:\n\n## License:\n\n```\nCopyright 2014-2017 Martin Simon\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n```\n\n## Buy me a coffee?\n\nIf you feel like buying me a coffee (or a beer?), donations are welcome:\n\n```\nWDC : WbcWJzVD8yXt3yLnnkCZtwQo4YgSUdELkj\nHBN : F2Zs4igv8r4oJJzh4sh4bGmeqoUxLQHPki\nDOGE: DRBkryyau5CMxpBzVmrBAjK6dVdMZSBsuS\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/mrsmn/hazelnut/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mrsmn/hazelnut", "keywords": "memory,RAM,system information,meminfo,/proc", "license": "Apache v2.0 License", "maintainer": "", "maintainer_email": "", "name": "hazelnut", "package_url": "https://pypi.org/project/hazelnut/", "platform": "", "project_url": "https://pypi.org/project/hazelnut/", "project_urls": { "Download": "https://github.com/mrsmn/hazelnut/archive/master.zip", "Homepage": "https://github.com/mrsmn/hazelnut" }, "release_url": "https://pypi.org/project/hazelnut/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "A pythonic library to parse /proc/meminfo", "version": "0.4.1" }, "last_serial": 3548594, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "89dccfabc47dc22c6e72d04f9a765389", "sha256": "bb570ad11e2a52acd8439c431367b262816db18601eb866acd492a537936709b" }, "downloads": -1, "filename": "hazelnut-0.1.tar.gz", "has_sig": false, "md5_digest": "89dccfabc47dc22c6e72d04f9a765389", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3849, "upload_time": "2015-03-23T18:35:26", "url": "https://files.pythonhosted.org/packages/a5/49/8079e2d02ad9c605c70e3ef15838a39f688afccce6e8dfa506670c19875a/hazelnut-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "11021e61ae441f5bc44ef421cfe276a1", "sha256": "016bf702b35ef4db9af2f28e541803a512e87374e60f961329f5376be41aa507" }, "downloads": -1, "filename": "hazelnut-0.2.tar.gz", "has_sig": false, "md5_digest": "11021e61ae441f5bc44ef421cfe276a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3804, "upload_time": "2015-03-24T11:49:03", "url": "https://files.pythonhosted.org/packages/89/f6/95c88ac79444c5eccf110135b3670063a22622f972acdf9f37b2b85da922/hazelnut-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "712c3f44923d7fd3d6197d7046d318dd", "sha256": "28f3f92b4c02793c5b2c752e552957e4987821a9136738865d4bc70e80c6b7cd" }, "downloads": -1, "filename": "hazelnut-0.3.tar.gz", "has_sig": false, "md5_digest": "712c3f44923d7fd3d6197d7046d318dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3798, "upload_time": "2015-04-18T10:30:09", "url": "https://files.pythonhosted.org/packages/ad/c0/a5c92ce6e61fb786016f006768af9005271381e4a4e3898b0d742e103017/hazelnut-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "36077cdd534d9670755b39c58df16cfa", "sha256": "3b7060fa943ef52172c211ebd0eec6e5b74e268af69fb1d4c5d4673e49c11bcd" }, "downloads": -1, "filename": "hazelnut-0.4.tar.gz", "has_sig": false, "md5_digest": "36077cdd534d9670755b39c58df16cfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3957, "upload_time": "2015-04-28T11:26:47", "url": "https://files.pythonhosted.org/packages/2d/83/0389282adc5178000e6328d18c3e0273944710e5a4f46562ff26af5050d3/hazelnut-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "a37709233bf15da3ee84abdab52e08cb", "sha256": "d6a014766fe7e0655d06a3116279e5742d49488b3f585693054adee9c540626d" }, "downloads": -1, "filename": "hazelnut-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a37709233bf15da3ee84abdab52e08cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7069, "upload_time": "2017-09-23T13:54:39", "url": "https://files.pythonhosted.org/packages/4d/6f/2484baf3ab197dbde47dcfb753cfcaaded037b6087e2618f85e083529f1c/hazelnut-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a37709233bf15da3ee84abdab52e08cb", "sha256": "d6a014766fe7e0655d06a3116279e5742d49488b3f585693054adee9c540626d" }, "downloads": -1, "filename": "hazelnut-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a37709233bf15da3ee84abdab52e08cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7069, "upload_time": "2017-09-23T13:54:39", "url": "https://files.pythonhosted.org/packages/4d/6f/2484baf3ab197dbde47dcfb753cfcaaded037b6087e2618f85e083529f1c/hazelnut-0.4.1.tar.gz" } ] }