Lightweight OS-agnostic service monitoring API
Project description
PyNinja
Lightweight OS-agnostic service monitoring API
Platform Supported
Deployments
Kick off
Recommendations
- Install
python
3.10 or 3.11 - Use a dedicated virtual environment
Install PyNinja
python -m pip install pyninja
Initiate - IDE
import pyninja
if __name__ == '__main__':
pyninja.start()
Initiate - CLI
pyninja start
Use
pyninja --help
for usage instructions.
Environment Variables
Sourcing environment variables from an env file
By default,
PyNinja
will look for a.env
file in the current working directory.
- NINJA_HOST - Hostname for the API server.
- NINJA_PORT - Port number for the API server.
- WORKERS - Number of workers for the uvicorn server.
- REMOTE_EXECUTION - Boolean flag to enable remote execution.
- API_SECRET - Secret access key for running commands on server remotely.
- MONITOR_USERNAME - Username to authenticate the monitoring page.
- MONITOR_PASSWORD - Password to authenticate the monitoring page.
- MONITOR_SESSION - Session timeout for the monitoring page.
- MAX_CONNECTIONS - Maximum number of monitoring sessions allowed in parallel.
- SERVICE_MANAGER - Service manager filepath to handle the service status requests.
- DATABASE - FilePath to store the auth database that handles the authentication errors.
- RATE_LIMIT - List of dictionaries with
max_requests
andseconds
to apply as rate limit. - APIKEY - API Key for authentication.
⚠️ Enabling remote execution can be extremely risky and a major security threat. So use caution and set the API_SECRET to a strong value.
Refer samples directory for examples.
Coding Standards
Docstring format: Google
Styling conventions: PEP 8
and isort
Release Notes
Requirement
python -m pip install gitverse
Usage
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
python -m pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
Pypi Package
https://pypi.org/project/PyNinja/
Runbook
https://thevickypedia.github.io/PyNinja/
License & copyright
© Vignesh Rao
Licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file PyNinja-0.0.6a0-py3-none-any.whl
.
File metadata
- Download URL: PyNinja-0.0.6a0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421d67c0883f703101709cea73cf63e92dbc2fa5f517d88205e63e14e1a89fa9 |
|
MD5 | 9a07be0e409464089d29bb81b0aeaf91 |
|
BLAKE2b-256 | cb5de1fcaa2ede466625cdab45199ac3dc4707a2d8f2dcd7611f94c8d1bfb4a7 |