PyNinja


NamePyNinja JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryLightweight OS-agnostic service monitoring API
upload_time2025-01-07 03:23:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 TheVickypedia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords service-monitor pyninja
VCS
bugtrack_url
requirements click docker fastapi Jinja2 psutil PyArchitecture pydantic pydantic-settings python-multipart PyUdisk PyYaml requests uvicorn
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyNinja
Lightweight OS-agnostic service monitoring API

![Python][label-pyversion]

**Platform Supported**

![Platform][label-platform]

**Deployments**

[![pages][label-actions-pages]][gha_pages]
[![pypi][label-actions-pypi]][gha_pypi]
[![markdown][label-actions-markdown]][gha_md_valid]

[![Pypi][label-pypi]][pypi]
[![Pypi-format][label-pypi-format]][pypi-files]
[![Pypi-status][label-pypi-status]][pypi]

## Kick off

**Recommendations**

- Install `python` [3.11] or above
- Use a dedicated [virtual environment]

**Install PyNinja**
```shell
python -m pip install pyninja
```

**Initiate - IDE**
```python
import pyninja


if __name__ == '__main__':
    pyninja.start()
```

**Initiate - CLI**
```shell
pyninja start
```

> Use `pyninja --help` for usage instructions.

## Environment Variables

<details>
<summary><strong>Sourcing environment variables from an env file</strong></summary>

> _By default, `PyNinja` will look for a `.env` file in the current working directory._
</details>

**Basic API**
- **APIKEY** - API Key for authentication.
- **SWAGGER_UI_PARAMETERS** - Dictionary of parameters to be included in the Swagger UI.
- **NINJA_HOST** - Hostname for the API server.
- **NINJA_PORT** - Port number for the API server.

**Functional improvements**
- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.
- **LOG_CONFIG** - Logging configuration file path.

**Remote execution and FileIO**
- **REMOTE_EXECUTION** - Boolean flag to enable remote execution.
- **API_SECRET** - Secret access key for running commands on server remotely.
- **DATABASE** - FilePath to store the auth database that handles the authentication errors.

⚠️ Enabling remote execution can be extremely risky and poses a major security threat.
So use **caution** and set the **API_SECRET** to a strong value.

**Monitoring UI**
- **MONITOR_USERNAME** - Username to authenticate the monitoring page.
- **MONITOR_PASSWORD** - Password to authenticate the monitoring page.
- **MONITOR_SESSION** - Session timeout for the monitoring page.
- **DISK_REPORT** - Boolean flag to enable disk report feature using [PyUdisk].
- **MAX_CONNECTIONS** - Maximum number of monitoring sessions allowed in parallel.
- **NO_AUTH** - Boolean flag to disable authentication for monitoring page.
- **PROCESSES** - List of process names to include in the monitor page.
- **SERVICES** - List of service names to include in the monitor page.
- **SERVICE_LIB** - Library path to retrieve service info.
- **SMART_LIB** - Library path for S.M.A.R.T metrics using [PyUdisk].
- **GPU_LIB** - Library path to retrieve GPU names using [PyArchitecture].
- **DISK_LIB** - Library path to retrieve disk info using [PyArchitecture].
- **PROCESSOR_LIB** - Library path to retrieve processor name using [PyArchitecture].

> Certain environment variables like `SERVICES` and `PROCESSS` are case-sensitive

> Refer [samples] directory for examples.

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Styling conventions: [`PEP 8`][pep8] and [`isort`][isort]

## [Release Notes][release-notes]
**Requirement**
```shell
python -m pip install gitverse
```

**Usage**
```shell
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
```

## Linting
`pre-commit` will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL
markdown files (including Wiki pages)

**Requirement**
```shell
python -m pip install sphinx==5.1.1 pre-commit recommonmark
```

**Usage**
```shell
pre-commit run --all-files
```

## Pypi Package
[![pypi-module][label-pypi-package]][pypi-repo]

[https://pypi.org/project/PyNinja/][pypi]

## Runbook
[![made-with-sphinx-doc][label-sphinx-doc]][sphinx]

[https://thevickypedia.github.io/PyNinja/][runbook]

## License & copyright

&copy; Vignesh Rao

Licensed under the [MIT License][license]

[//]: # (Labels)

[label-actions-markdown]: https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml/badge.svg
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-pyninja-blue?style=for-the-badge&logo=Python
[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx
[label-pyversion]: https://img.shields.io/badge/python-3.11%20%7C%203.12-blue
[label-platform]: https://img.shields.io/badge/Platform-Linux|macOS|Windows-1f425f.svg
[label-actions-pages]: https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment/badge.svg
[label-actions-pypi]: https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml/badge.svg
[label-pypi]: https://img.shields.io/pypi/v/PyNinja
[label-pypi-format]: https://img.shields.io/pypi/format/PyNinja
[label-pypi-status]: https://img.shields.io/pypi/status/PyNinja

[3.11]: https://docs.python.org/3/whatsnew/3.11.html
[virtual environment]: https://docs.python.org/3/tutorial/venv.html
[release-notes]: https://github.com/thevickypedia/PyNinja/blob/main/release_notes.rst
[gha_pages]: https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment
[gha_pypi]: https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml
[gha_md_valid]: https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml
[google-docs]: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
[pep8]: https://www.python.org/dev/peps/pep-0008/
[isort]: https://pycqa.github.io/isort/
[sphinx]: https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html
[pypi]: https://pypi.org/project/PyNinja
[pypi-files]: https://pypi.org/project/PyNinja/#files
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/
[license]: https://github.com/thevickypedia/PyNinja/blob/main/LICENSE
[runbook]: https://thevickypedia.github.io/PyNinja/
[samples]: https://github.com/thevickypedia/PyNinja/tree/main/samples
[PyUdisk]: https://github.com/thevickypedia/PyUdisk
[PyArchitecture]: https://github.com/thevickypedia/PyArchitecture

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "PyNinja",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "service-monitor, PyNinja",
    "author": null,
    "author_email": "Vignesh Rao <svignesh1793@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "# PyNinja\nLightweight OS-agnostic service monitoring API\n\n![Python][label-pyversion]\n\n**Platform Supported**\n\n![Platform][label-platform]\n\n**Deployments**\n\n[![pages][label-actions-pages]][gha_pages]\n[![pypi][label-actions-pypi]][gha_pypi]\n[![markdown][label-actions-markdown]][gha_md_valid]\n\n[![Pypi][label-pypi]][pypi]\n[![Pypi-format][label-pypi-format]][pypi-files]\n[![Pypi-status][label-pypi-status]][pypi]\n\n## Kick off\n\n**Recommendations**\n\n- Install `python` [3.11] or above\n- Use a dedicated [virtual environment]\n\n**Install PyNinja**\n```shell\npython -m pip install pyninja\n```\n\n**Initiate - IDE**\n```python\nimport pyninja\n\n\nif __name__ == '__main__':\n    pyninja.start()\n```\n\n**Initiate - CLI**\n```shell\npyninja start\n```\n\n> Use `pyninja --help` for usage instructions.\n\n## Environment Variables\n\n<details>\n<summary><strong>Sourcing environment variables from an env file</strong></summary>\n\n> _By default, `PyNinja` will look for a `.env` file in the current working directory._\n</details>\n\n**Basic API**\n- **APIKEY** - API Key for authentication.\n- **SWAGGER_UI_PARAMETERS** - Dictionary of parameters to be included in the Swagger UI.\n- **NINJA_HOST** - Hostname for the API server.\n- **NINJA_PORT** - Port number for the API server.\n\n**Functional improvements**\n- **RATE_LIMIT** - List of dictionaries with `max_requests` and `seconds` to apply as rate limit.\n- **LOG_CONFIG** - Logging configuration file path.\n\n**Remote execution and FileIO**\n- **REMOTE_EXECUTION** - Boolean flag to enable remote execution.\n- **API_SECRET** - Secret access key for running commands on server remotely.\n- **DATABASE** - FilePath to store the auth database that handles the authentication errors.\n\n\u26a0\ufe0f Enabling remote execution can be extremely risky and poses a major security threat.\nSo use **caution** and set the **API_SECRET** to a strong value.\n\n**Monitoring UI**\n- **MONITOR_USERNAME** - Username to authenticate the monitoring page.\n- **MONITOR_PASSWORD** - Password to authenticate the monitoring page.\n- **MONITOR_SESSION** - Session timeout for the monitoring page.\n- **DISK_REPORT** - Boolean flag to enable disk report feature using [PyUdisk].\n- **MAX_CONNECTIONS** - Maximum number of monitoring sessions allowed in parallel.\n- **NO_AUTH** - Boolean flag to disable authentication for monitoring page.\n- **PROCESSES** - List of process names to include in the monitor page.\n- **SERVICES** - List of service names to include in the monitor page.\n- **SERVICE_LIB** - Library path to retrieve service info.\n- **SMART_LIB** - Library path for S.M.A.R.T metrics using [PyUdisk].\n- **GPU_LIB** - Library path to retrieve GPU names using [PyArchitecture].\n- **DISK_LIB** - Library path to retrieve disk info using [PyArchitecture].\n- **PROCESSOR_LIB** - Library path to retrieve processor name using [PyArchitecture].\n\n> Certain environment variables like `SERVICES` and `PROCESSS` are case-sensitive\n\n> Refer [samples] directory for examples.\n\n## Coding Standards\nDocstring format: [`Google`][google-docs] <br>\nStyling conventions: [`PEP 8`][pep8] and [`isort`][isort]\n\n## [Release Notes][release-notes]\n**Requirement**\n```shell\npython -m pip install gitverse\n```\n\n**Usage**\n```shell\ngitverse-release reverse -f release_notes.rst -t 'Release Notes'\n```\n\n## Linting\n`pre-commit` will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL\nmarkdown files (including Wiki pages)\n\n**Requirement**\n```shell\npython -m pip install sphinx==5.1.1 pre-commit recommonmark\n```\n\n**Usage**\n```shell\npre-commit run --all-files\n```\n\n## Pypi Package\n[![pypi-module][label-pypi-package]][pypi-repo]\n\n[https://pypi.org/project/PyNinja/][pypi]\n\n## Runbook\n[![made-with-sphinx-doc][label-sphinx-doc]][sphinx]\n\n[https://thevickypedia.github.io/PyNinja/][runbook]\n\n## License & copyright\n\n&copy; Vignesh Rao\n\nLicensed under the [MIT License][license]\n\n[//]: # (Labels)\n\n[label-actions-markdown]: https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml/badge.svg\n[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-pyninja-blue?style=for-the-badge&logo=Python\n[label-sphinx-doc]: https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&logo=Sphinx\n[label-pyversion]: https://img.shields.io/badge/python-3.11%20%7C%203.12-blue\n[label-platform]: https://img.shields.io/badge/Platform-Linux|macOS|Windows-1f425f.svg\n[label-actions-pages]: https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment/badge.svg\n[label-actions-pypi]: https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml/badge.svg\n[label-pypi]: https://img.shields.io/pypi/v/PyNinja\n[label-pypi-format]: https://img.shields.io/pypi/format/PyNinja\n[label-pypi-status]: https://img.shields.io/pypi/status/PyNinja\n\n[3.11]: https://docs.python.org/3/whatsnew/3.11.html\n[virtual environment]: https://docs.python.org/3/tutorial/venv.html\n[release-notes]: https://github.com/thevickypedia/PyNinja/blob/main/release_notes.rst\n[gha_pages]: https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment\n[gha_pypi]: https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml\n[gha_md_valid]: https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml\n[google-docs]: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings\n[pep8]: https://www.python.org/dev/peps/pep-0008/\n[isort]: https://pycqa.github.io/isort/\n[sphinx]: https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html\n[pypi]: https://pypi.org/project/PyNinja\n[pypi-files]: https://pypi.org/project/PyNinja/#files\n[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/\n[license]: https://github.com/thevickypedia/PyNinja/blob/main/LICENSE\n[runbook]: https://thevickypedia.github.io/PyNinja/\n[samples]: https://github.com/thevickypedia/PyNinja/tree/main/samples\n[PyUdisk]: https://github.com/thevickypedia/PyUdisk\n[PyArchitecture]: https://github.com/thevickypedia/PyArchitecture\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 TheVickypedia  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Lightweight OS-agnostic service monitoring API",
    "version": "2.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/thevickypedia/PyNinja/issues",
        "Docs": "https://thevickypedia.github.io/PyNinja",
        "Homepage": "https://github.com/thevickypedia/PyNinja",
        "Release Notes": "https://github.com/thevickypedia/PyNinja/blob/main/release_notes.rst",
        "Source": "https://github.com/thevickypedia/PyNinja"
    },
    "split_keywords": [
        "service-monitor",
        " pyninja"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7324018545c1cc4e30c075ff2871079979d4233d42f0b70db12e05185077ac45",
                "md5": "c5bc773bf14c93ed58f502383b32f956",
                "sha256": "3c91a1e30ab723d670c4b8095b2457eb070c99a79b7471e276972ac5cf47f907"
            },
            "downloads": -1,
            "filename": "PyNinja-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c5bc773bf14c93ed58f502383b32f956",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 70959,
            "upload_time": "2025-01-07T03:23:35",
            "upload_time_iso_8601": "2025-01-07T03:23:35.431743Z",
            "url": "https://files.pythonhosted.org/packages/73/24/018545c1cc4e30c075ff2871079979d4233d42f0b70db12e05185077ac45/PyNinja-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-07 03:23:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thevickypedia",
    "github_project": "PyNinja",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.*"
                ]
            ]
        },
        {
            "name": "docker",
            "specs": [
                [
                    "==",
                    "7.1.*"
                ]
            ]
        },
        {
            "name": "fastapi",
            "specs": [
                [
                    "==",
                    "0.112.*"
                ]
            ]
        },
        {
            "name": "Jinja2",
            "specs": [
                [
                    "==",
                    "3.1.*"
                ]
            ]
        },
        {
            "name": "psutil",
            "specs": [
                [
                    "==",
                    "6.0.*"
                ]
            ]
        },
        {
            "name": "PyArchitecture",
            "specs": [
                [
                    "==",
                    "0.3.*"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.*"
                ]
            ]
        },
        {
            "name": "pydantic-settings",
            "specs": [
                [
                    "==",
                    "2.*"
                ]
            ]
        },
        {
            "name": "python-multipart",
            "specs": [
                [
                    ">=",
                    "0.0.19"
                ]
            ]
        },
        {
            "name": "PyUdisk",
            "specs": [
                [
                    "==",
                    "2.0.*"
                ]
            ]
        },
        {
            "name": "PyYaml",
            "specs": [
                [
                    "==",
                    "6.0.*"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.*"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": [
                [
                    "==",
                    "0.32.*"
                ]
            ]
        }
    ],
    "lcname": "pyninja"
}
        
Elapsed time: 0.48012s