smartscan 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. smartscan-0.1.0/.copier-answers.yaml +29 -0
  2. smartscan-0.1.0/.devcontainer/devcontainer.json +19 -0
  3. smartscan-0.1.0/.dockerignore +8 -0
  4. smartscan-0.1.0/.editorconfig +20 -0
  5. smartscan-0.1.0/.github/workflows/docs.yaml +59 -0
  6. smartscan-0.1.0/.github/workflows/publish-to-pypi.yaml +40 -0
  7. smartscan-0.1.0/.github/workflows/publish-to-test-pypi.yaml +51 -0
  8. smartscan-0.1.0/.gitignore +351 -0
  9. smartscan-0.1.0/.pre-commit-config.yaml +27 -0
  10. smartscan-0.1.0/.prettierignore +2 -0
  11. smartscan-0.1.0/.yamlfmt.yaml +41 -0
  12. smartscan-0.1.0/AGENTS.md +60 -0
  13. smartscan-0.1.0/CHANGELOG.md +39 -0
  14. smartscan-0.1.0/Dockerfile +15 -0
  15. smartscan-0.1.0/LICENSE +19 -0
  16. smartscan-0.1.0/PKG-INFO +55 -0
  17. smartscan-0.1.0/README.md +32 -0
  18. smartscan-0.1.0/docs/index.md +192 -0
  19. smartscan-0.1.0/justfile +45 -0
  20. smartscan-0.1.0/pyproject.toml +59 -0
  21. smartscan-0.1.0/ruff.toml +78 -0
  22. smartscan-0.1.0/src/smartscan/__init__.py +6 -0
  23. smartscan-0.1.0/src/smartscan/__main__.py +4 -0
  24. smartscan-0.1.0/src/smartscan/cli.py +139 -0
  25. smartscan-0.1.0/src/smartscan/commands.py +144 -0
  26. smartscan-0.1.0/src/smartscan/config.py +54 -0
  27. smartscan-0.1.0/src/smartscan/constants.py +86 -0
  28. smartscan-0.1.0/src/smartscan/database.py +183 -0
  29. smartscan-0.1.0/src/smartscan/exceptions.py +25 -0
  30. smartscan-0.1.0/src/smartscan/llm.py +105 -0
  31. smartscan-0.1.0/src/smartscan/logging.py +43 -0
  32. smartscan-0.1.0/src/smartscan/models.py +71 -0
  33. smartscan-0.1.0/src/smartscan/output.py +204 -0
  34. smartscan-0.1.0/src/smartscan/smartctl.py +284 -0
  35. smartscan-0.1.0/src/smartscan/thresholds.py +109 -0
  36. smartscan-0.1.0/tests/conftest.py +37 -0
  37. smartscan-0.1.0/tests/test_cli.py +85 -0
  38. smartscan-0.1.0/tests/test_core.py +454 -0
  39. smartscan-0.1.0/tests/test_output.py +219 -0
  40. smartscan-0.1.0/uv.lock +1103 -0
  41. smartscan-0.1.0/zensical.toml +34 -0
@@ -0,0 +1,29 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: 37da679
3
+ _src_path: .
4
+ author_email: git@ak1ra.xyz
5
+ author_name: ak1ra
6
+ copyright_date: '2026'
7
+ copyright_holder: ak1ra
8
+ copyright_holder_email: git@ak1ra.xyz
9
+ copyright_license: MIT
10
+ default_branch: master
11
+ development_branch: dev
12
+ docs_hosting: github-pages
13
+ docs_site_path: /smartscan/
14
+ docs_site_url: https://ak1ra-lab.github.io/smartscan/
15
+ project_description: 'A CLI tool that runs smartctl on all disks, extracts key SMART
16
+ health metrics, and stores historical results in SQLite for tracking changes over
17
+ time.'
18
+ project_kind: cli
19
+ project_name: smartscan
20
+ python_min_version: '3.11'
21
+ python_package_command_line_name: smartscan
22
+ python_package_distribution_name: smartscan
23
+ python_package_import_name: smartscan
24
+ repository_name: smartscan
25
+ repository_namespace: ak1ra-lab
26
+ repository_provider_host: github.com
27
+ repository_provider_kind: github
28
+ requires_python: '>=3.11'
29
+ with_ansible: false
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "smartscan",
3
+ "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4
+ "features": {
5
+ "ghcr.io/devcontainers/features/python:1": {
6
+ "version": "3.11"
7
+ }
8
+ },
9
+ "postCreateCommand": "pip install --no-cache-dir uv && uv sync --group dev",
10
+ "customizations": {
11
+ "vscode": {
12
+ "extensions": [
13
+ "ms-python.python",
14
+ "ms-python.vscode-pylance",
15
+ "charliermarsh.ruff"
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,8 @@
1
+ .git
2
+ .venv
3
+ .pytest_cache
4
+ .ruff_cache
5
+ __pycache__
6
+ dist
7
+ site
8
+ htmlcov
@@ -0,0 +1,20 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_size = 4
7
+ indent_style = space
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ # https://github.com/torvalds/linux.git
12
+ [{*.{awk,c,dts,dtsi,dtso,h,mk,s,S},Kconfig,Makefile,Makefile.*}]
13
+ indent_style = tab
14
+
15
+ [*.{yml,yaml}]
16
+ indent_size = 2
17
+
18
+ [*.md]
19
+ indent_size = 2
20
+ trim_trailing_whitespace = false
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: docs
3
+
4
+ on:
5
+ workflow_dispatch: ~
6
+ push:
7
+ branches:
8
+ - master
9
+ paths:
10
+ - "docs/**"
11
+ - "README.md"
12
+ - "zensical.toml"
13
+ - ".github/workflows/docs.yaml"
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ pages: write
19
+ id-token: write
20
+
21
+
22
+ concurrency:
23
+ group: docs
24
+ cancel-in-progress: false
25
+
26
+ jobs:
27
+ build:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v6
31
+ with:
32
+ fetch-depth: 0
33
+ fetch-tags: true
34
+
35
+ - name: Install uv
36
+ uses: astral-sh/setup-uv@v7
37
+
38
+ - name: Install the project
39
+ run: uv sync --locked --group docs
40
+
41
+ - name: Build documentation
42
+ run: uv run zensical build
43
+
44
+ - name: Upload artifact
45
+ uses: actions/upload-pages-artifact@v4
46
+ with:
47
+ path: site
48
+
49
+ deploy:
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+ environment:
53
+ name: github-pages
54
+ url: ${{ steps.deployment.outputs.page_url }}
55
+ steps:
56
+ - name: Deploy to GitHub Pages
57
+ id: deployment
58
+ uses: actions/deploy-pages@v5
59
+
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: publish-to-pypi
3
+
4
+ on:
5
+ workflow_dispatch: ~
6
+ push:
7
+ tags:
8
+ - "v*"
9
+
10
+ jobs:
11
+ build-n-push:
12
+ name: upload release to PyPI
13
+ runs-on: ubuntu-latest
14
+ environment:
15
+ name: pypi
16
+ url: https://pypi.org/project/smartscan/
17
+
18
+ permissions:
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ with:
24
+ fetch-depth: 0
25
+ fetch-tags: true
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v7
29
+
30
+ - name: Install the project
31
+ run: uv sync --locked --group dev
32
+
33
+ - name: Run tests
34
+ run: uv run pytest -v tests/
35
+
36
+ - name: Build a binary wheel and a source tarball
37
+ run: uv build -v
38
+
39
+ - name: Publish package distributions to PyPI
40
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: publish-to-test-pypi
3
+
4
+ on:
5
+ workflow_dispatch: ~
6
+ push:
7
+ branches:
8
+ - dev
9
+ paths:
10
+ - "src/**"
11
+ - "tests/**"
12
+ - ".github/workflows/publish-to-test-pypi.yaml"
13
+
14
+ jobs:
15
+ build-n-push:
16
+ name: upload release to Test PyPI
17
+ runs-on: ubuntu-latest
18
+ environment:
19
+ name: test-pypi
20
+ url: https://test.pypi.org/project/smartscan/
21
+
22
+ permissions:
23
+ id-token: write
24
+
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+ with:
28
+ fetch-depth: 0
29
+ fetch-tags: true
30
+
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v7
33
+
34
+ - name: Install the project
35
+ run: uv sync --locked --group dev
36
+
37
+ - name: Run tests
38
+ run: uv run pytest -v tests/
39
+
40
+ - name: Build a binary wheel and a source tarball
41
+ run: |-
42
+ git tag "$(git describe --tags --always | cut -d- -f1,2)"
43
+ uv build -v
44
+
45
+ - name: Publish package distributions to Test PyPI
46
+ uses: pypa/gh-action-pypi-publish@release/v1
47
+ with:
48
+ verbose: true
49
+ print-hash: true
50
+ skip-existing: true
51
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,351 @@
1
+ # https://github.com/github/gitignore/blob/main/Global/Archives.gitignore
2
+ # It's better to unpack these files and commit the raw source because
3
+ # git has its own built in compression methods.
4
+ *.7z
5
+ *.jar
6
+ *.rar
7
+ *.zip
8
+ *.gz
9
+ *.gzip
10
+ *.tgz
11
+ *.bzip
12
+ *.bzip2
13
+ *.bz2
14
+ *.xz
15
+ *.lzma
16
+ *.cab
17
+ *.xar
18
+ *.zst
19
+ *.tzst
20
+
21
+ # Packing-only formats
22
+ *.iso
23
+ *.tar
24
+
25
+ # Package management formats
26
+ *.dmg
27
+ *.xpi
28
+ *.gem
29
+ *.egg
30
+ *.deb
31
+ *.rpm
32
+ *.msi
33
+ *.msm
34
+ *.msp
35
+ *.txz
36
+
37
+ # https://github.com/github/gitignore/blob/main/Global/Linux.gitignore
38
+ *~
39
+
40
+ # temporary files which can be created if a process still has a handle open of a deleted file
41
+ .fuse_hidden*
42
+
43
+ # Metadata left by Dolphin file manager, which comes with KDE Plasma
44
+ .directory
45
+
46
+ # Linux trash folder which might appear on any partition or disk
47
+ .Trash-*
48
+
49
+ # .nfs files are created when an open file is removed but is still being accessed
50
+ .nfs*
51
+
52
+ # Log files created by default by the nohup command
53
+ nohup.out
54
+
55
+ # https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
56
+ # General
57
+ .DS_Store
58
+ __MACOSX/
59
+ .AppleDouble
60
+ .LSOverride
61
+ Icon\[
62
+ ]
63
+
64
+ # Thumbnails
65
+ ._*
66
+
67
+ # Files that might appear in the root of a volume
68
+ .DocumentRevisions-V100
69
+ .fseventsd
70
+ .Spotlight-V100
71
+ .TemporaryItems
72
+ .Trashes
73
+ .VolumeIcon.icns
74
+ .com.apple.timemachine.donotpresent
75
+
76
+ # Directories potentially created on remote AFP share
77
+ .AppleDB
78
+ .AppleDesktop
79
+ Network Trash Folder
80
+ Temporary Items
81
+ .apdisk
82
+
83
+ # https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
84
+ # Windows thumbnail cache files
85
+ Thumbs.db
86
+ Thumbs.db:encryptable
87
+ ehthumbs.db
88
+ ehthumbs_vista.db
89
+
90
+ # Dump file
91
+ *.stackdump
92
+
93
+ # Folder config file
94
+ [Dd]esktop.ini
95
+
96
+ # Recycle Bin used on file shares
97
+ $RECYCLE.BIN/
98
+
99
+ # Windows Installer files
100
+ *.cab
101
+ *.msi
102
+ *.msix
103
+ *.msm
104
+ *.msp
105
+ *.exe
106
+
107
+ # Windows shortcuts
108
+ *.lnk
109
+
110
+ # https://github.com/github/gitignore/blob/main/Python.gitignore
111
+ # Byte-compiled / optimized / DLL files
112
+ __pycache__/
113
+ *.py[codz]
114
+ *$py.class
115
+
116
+ # C extensions
117
+ *.so
118
+
119
+ # Distribution / packaging
120
+ .Python
121
+ build/
122
+ develop-eggs/
123
+ dist/
124
+ downloads/
125
+ eggs/
126
+ .eggs/
127
+ lib/
128
+ lib64/
129
+ parts/
130
+ sdist/
131
+ var/
132
+ wheels/
133
+ share/python-wheels/
134
+ *.egg-info/
135
+ .installed.cfg
136
+ *.egg
137
+ MANIFEST
138
+
139
+ # PyInstaller
140
+ # Usually these files are written by a python script from a template
141
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
142
+ *.manifest
143
+ *.spec
144
+
145
+ # Installer logs
146
+ pip-log.txt
147
+ pip-delete-this-directory.txt
148
+
149
+ # Unit test / coverage reports
150
+ htmlcov/
151
+ .tox/
152
+ .nox/
153
+ .coverage
154
+ .coverage.*
155
+ .cache
156
+ nosetests.xml
157
+ coverage.xml
158
+ *.cover
159
+ *.py.cover
160
+ .hypothesis/
161
+ .pytest_cache/
162
+ cover/
163
+
164
+ # Translations
165
+ *.mo
166
+ *.pot
167
+
168
+ # Django stuff:
169
+ *.log
170
+ local_settings.py
171
+ db.sqlite3
172
+ db.sqlite3-journal
173
+
174
+ # Flask stuff:
175
+ instance/
176
+ .webassets-cache
177
+
178
+ # Scrapy stuff:
179
+ .scrapy
180
+
181
+ # Sphinx documentation
182
+ docs/_build/
183
+
184
+ # PyBuilder
185
+ .pybuilder/
186
+ target/
187
+
188
+ # Jupyter Notebook
189
+ .ipynb_checkpoints
190
+
191
+ # IPython
192
+ profile_default/
193
+ ipython_config.py
194
+
195
+ # pyenv
196
+ # For a library or package, you might want to ignore these files since the code is
197
+ # intended to run in multiple environments; otherwise, check them in:
198
+ .python-version
199
+
200
+ # pipenv
201
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
202
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
203
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
204
+ # install all needed dependencies.
205
+ # Pipfile.lock
206
+
207
+ # UV
208
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
209
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
210
+ # commonly ignored for libraries.
211
+ # uv.lock
212
+
213
+ # poetry
214
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
215
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
216
+ # commonly ignored for libraries.
217
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
218
+ # poetry.lock
219
+ # poetry.toml
220
+
221
+ # pdm
222
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
223
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
224
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
225
+ # pdm.lock
226
+ # pdm.toml
227
+ .pdm-python
228
+ .pdm-build/
229
+
230
+ # pixi
231
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
232
+ # pixi.lock
233
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
234
+ # in the .venv directory. It is recommended not to include this directory in version control.
235
+ .pixi
236
+
237
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
238
+ __pypackages__/
239
+
240
+ # Celery stuff
241
+ celerybeat-schedule
242
+ celerybeat.pid
243
+
244
+ # Redis
245
+ *.rdb
246
+ *.aof
247
+ *.pid
248
+
249
+ # RabbitMQ
250
+ mnesia/
251
+ rabbitmq/
252
+ rabbitmq-data/
253
+
254
+ # ActiveMQ
255
+ activemq-data/
256
+
257
+ # SageMath parsed files
258
+ *.sage.py
259
+
260
+ # Environments
261
+ .env
262
+ .envrc
263
+ .venv
264
+ env/
265
+ venv/
266
+ ENV/
267
+ env.bak/
268
+ venv.bak/
269
+
270
+ # Spyder project settings
271
+ .spyderproject
272
+ .spyproject
273
+
274
+ # Rope project settings
275
+ .ropeproject
276
+
277
+ # mkdocs documentation
278
+ /site
279
+
280
+ # mypy
281
+ .mypy_cache/
282
+ .dmypy.json
283
+ dmypy.json
284
+
285
+ # Pyre type checker
286
+ .pyre/
287
+
288
+ # pytype static type analyzer
289
+ .pytype/
290
+
291
+ # Cython debug symbols
292
+ cython_debug/
293
+
294
+ # PyCharm
295
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
296
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
297
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
298
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
299
+ # .idea/
300
+
301
+ # Abstra
302
+ # Abstra is an AI-powered process automation framework.
303
+ # Ignore directories containing user credentials, local state, and settings.
304
+ # Learn more at https://abstra.io/docs
305
+ .abstra/
306
+
307
+ # Visual Studio Code
308
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
309
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
310
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
311
+ # you could uncomment the following to ignore the entire vscode folder
312
+ .vscode/
313
+
314
+ # Ruff stuff:
315
+ .ruff_cache/
316
+
317
+ # PyPI configuration file
318
+ .pypirc
319
+
320
+ # Marimo
321
+ marimo/_static/
322
+ marimo/_lsp/
323
+ __marimo__/
324
+
325
+ # Streamlit
326
+ .streamlit/secrets.toml
327
+
328
+ # Ansible
329
+ .ansible/*
330
+ inventory/*.yaml
331
+ playbooks/host_vars/**/*.yaml
332
+ playbooks/group_vars/**/*.yaml
333
+ playbooks/host_vars/**/*.patch
334
+ playbooks/group_vars/**/*.patch
335
+
336
+ # Ansible runtime scripts and templates
337
+ playbooks/scripts/*
338
+ playbooks/templates/*
339
+
340
+ # 示例 Ansible inventory
341
+ !inventory/hosts.example.yaml
342
+
343
+ # General configuration file and examples folder
344
+ config/*
345
+ credentials/
346
+ credentials.yaml
347
+ examples/*
348
+
349
+ ## LLM
350
+ docs/sessions/*
351
+ .agents/state/sessions/*
@@ -0,0 +1,27 @@
1
+ ---
2
+ # See https://pre-commit.com for more information
3
+ # See https://pre-commit.com/hooks.html for more hooks
4
+ #
5
+ # Run `uv run pre-commit autoupdate` after init to bump hook revisions.
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v6.0.0
9
+ hooks:
10
+ - id: check-added-large-files
11
+ - id: check-case-conflict
12
+ - id: check-merge-conflict
13
+ - id: detect-aws-credentials
14
+ - id: detect-private-key
15
+ - id: no-commit-to-branch
16
+
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.15.16
19
+ hooks:
20
+ - id: ruff-check
21
+ args: [--fix]
22
+ - id: ruff-format
23
+
24
+ - repo: https://github.com/astral-sh/uv-pre-commit
25
+ rev: 0.11.20
26
+ hooks:
27
+ - id: uv-lock
@@ -0,0 +1,2 @@
1
+ # docs
2
+ docs/api.md
@@ -0,0 +1,41 @@
1
+ ---
2
+ # https://github.com/google/yamlfmt/blob/main/docs/config-file.md
3
+ # go install github.com/google/yamlfmt/cmd/yamlfmt@latest
4
+ continue_on_error: false
5
+ doublestar: false
6
+ exclude: []
7
+ extensions:
8
+ - yaml
9
+ - yml
10
+ # Use gitignore files for exclude paths. This is in addition to the patterns from the exclude option.
11
+ gitignore_excludes: true # default: false
12
+ gitignore_path: .gitignore
13
+ include: []
14
+ line_ending: lf
15
+ match_type: standard
16
+ output_format: default
17
+ regex_exclude: []
18
+ formatter:
19
+ array_indent: 0
20
+ disable_alias_key_correction: false
21
+ disallow_anchors: false
22
+ drop_merge_tag: false
23
+ eof_newline: false
24
+ force_array_style: ""
25
+ force_quote_style: ""
26
+ # Include --- at document start.
27
+ include_document_start: true # default: false
28
+ indent: 2
29
+ indent_root_array: false
30
+ indentless_arrays: false
31
+ line_ending: lf
32
+ max_line_length: 0
33
+ pad_line_comments: 1
34
+ retain_line_breaks: false
35
+ # (NOTE: Takes precedence over retain_line_breaks) Retain line breaks in formatted YAML, but only keep a single line in groups of many blank lines.
36
+ retain_line_breaks_single: true # default: false
37
+ # Option that will preserve newlines in folded block scalars (blocks that start with >).
38
+ scan_folded_as_literal: true # default: false
39
+ strip_directives: false
40
+ trim_trailing_whitespace: false
41
+ type: basic