# ParseCDI
An (unofficial) library for parsing the output of Crystal Disk Info.
Be sure to install Crystal Disk Info before trying to use.
# Installation
```
pip install parsecdi
```
# Live API Example
```
# Run as admin for best experience
In [1]: from parsecdi import CrystalDiskInfo
# This actually fetches info from Crystal Disk Info on the current system
In [2]: ds = CrystalDiskInfo.get().get_disks()
# If you wanted to parse an existing output file, use:
# ds = CrystalDiskInfo(None).get_disks(pathlib.Path(<FILE>))
In [3]: ds
Out[3]:
[<Disk - Samsung SSD 980 PRO 1TB - S5P2NG0NB05964V - 1000.2 GB>,
<Disk - WDS100T3X0C-00SJG0 - 20379E802164 - 1000.2 GB>]
In [4]: d = ds[0]
In [5]: d.model
Out[5]: 'Samsung SSD 980 PRO 1TB'
In [6]: d.firmware
Out[6]: '5B2QGXA7'
In [7]: d.health.status
Out[7]: 'Good'
In [8]: d.health.percent
Out[8]: 87
In [9]: d.health.smart
Out[9]:
(DiskSMARTAttribute(id=1, name='Critical Warning', raw=0, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=2, name='Composite Temperature', raw=325, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=3, name='Available Spare', raw=100, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=4, name='Available Spare Threshold', raw=10, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=5, name='Percentage Used', raw=13, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=6, name='Data Units Read', raw=151350782, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=7, name='Data Units Written', raw=264526622, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=8, name='Host Read Commands', raw=5047763158, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=9, name='Host Write Commands', raw=7843108273, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=10, name='Controller Busy Time', raw=19141, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=11, name='Power Cycles', raw=663, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=12, name='Power On Hours', raw=3451, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=13, name='Unsafe Shutdowns', raw=36, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=14, name='Media and Data Integrity Errors', raw=0, current=None, worst=None, threshold=None),
DiskSMARTAttribute(id=15, name='Number of Error Information Log Entries', raw=0, current=None, worst=None, threshold=None))
```
See [https://csm10495.github.io/parsecdi/](https://csm10495.github.io/parsecdi/) for full API documentation.
## License
MIT License
Raw data
{
"_id": null,
"home_page": "http://github.com/csm10495/parsecdi",
"name": "parsecdi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "",
"author": "csm10495",
"author_email": "csm10495@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/81/a5/a2675ccb487b59f8a62d5514657b073336b6744402a76cc44020e1b93d80/parsecdi-0.0.2.tar.gz",
"platform": null,
"description": "# ParseCDI\n\nAn (unofficial) library for parsing the output of Crystal Disk Info.\nBe sure to install Crystal Disk Info before trying to use.\n\n# Installation\n```\npip install parsecdi\n```\n\n# Live API Example\n```\n# Run as admin for best experience\n\nIn [1]: from parsecdi import CrystalDiskInfo\n\n# This actually fetches info from Crystal Disk Info on the current system\nIn [2]: ds = CrystalDiskInfo.get().get_disks()\n# If you wanted to parse an existing output file, use:\n# ds = CrystalDiskInfo(None).get_disks(pathlib.Path(<FILE>))\n\nIn [3]: ds\nOut[3]:\n[<Disk - Samsung SSD 980 PRO 1TB - S5P2NG0NB05964V - 1000.2 GB>,\n <Disk - WDS100T3X0C-00SJG0 - 20379E802164 - 1000.2 GB>]\n\nIn [4]: d = ds[0]\n\nIn [5]: d.model\nOut[5]: 'Samsung SSD 980 PRO 1TB'\n\nIn [6]: d.firmware\nOut[6]: '5B2QGXA7'\n\nIn [7]: d.health.status\nOut[7]: 'Good'\n\nIn [8]: d.health.percent\nOut[8]: 87\n\nIn [9]: d.health.smart\nOut[9]:\n(DiskSMARTAttribute(id=1, name='Critical Warning', raw=0, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=2, name='Composite Temperature', raw=325, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=3, name='Available Spare', raw=100, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=4, name='Available Spare Threshold', raw=10, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=5, name='Percentage Used', raw=13, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=6, name='Data Units Read', raw=151350782, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=7, name='Data Units Written', raw=264526622, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=8, name='Host Read Commands', raw=5047763158, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=9, name='Host Write Commands', raw=7843108273, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=10, name='Controller Busy Time', raw=19141, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=11, name='Power Cycles', raw=663, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=12, name='Power On Hours', raw=3451, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=13, name='Unsafe Shutdowns', raw=36, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=14, name='Media and Data Integrity Errors', raw=0, current=None, worst=None, threshold=None),\n DiskSMARTAttribute(id=15, name='Number of Error Information Log Entries', raw=0, current=None, worst=None, threshold=None))\n```\n\nSee [https://csm10495.github.io/parsecdi/](https://csm10495.github.io/parsecdi/) for full API documentation.\n\n## License\nMIT License\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "",
"version": "0.0.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1eedc82327cea72a41481b2aa0ee41b7ebcd7550f23329211faed6e2624a0b06",
"md5": "a6f7b18ca59be7c7680644fd879bd7e3",
"sha256": "c790bed591291f1259573dc69acda1a5c8e066a35e70a2e0a39962322c4694fe"
},
"downloads": -1,
"filename": "parsecdi-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a6f7b18ca59be7c7680644fd879bd7e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5735,
"upload_time": "2023-03-26T20:59:59",
"upload_time_iso_8601": "2023-03-26T20:59:59.120584Z",
"url": "https://files.pythonhosted.org/packages/1e/ed/c82327cea72a41481b2aa0ee41b7ebcd7550f23329211faed6e2624a0b06/parsecdi-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "81a5a2675ccb487b59f8a62d5514657b073336b6744402a76cc44020e1b93d80",
"md5": "20f38bbe3ed7032e5d5352bb4bb86351",
"sha256": "817139adcfa7243b53e783d6471615a375d43a6ae61148ca665db9b759d230c2"
},
"downloads": -1,
"filename": "parsecdi-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "20f38bbe3ed7032e5d5352bb4bb86351",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 5452,
"upload_time": "2023-03-26T21:00:00",
"upload_time_iso_8601": "2023-03-26T21:00:00.371347Z",
"url": "https://files.pythonhosted.org/packages/81/a5/a2675ccb487b59f8a62d5514657b073336b6744402a76cc44020e1b93d80/parsecdi-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-26 21:00:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "csm10495",
"github_project": "parsecdi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "parsecdi"
}