diff --git a/README.md b/README.md index 943f6f6..6e552cd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# service-monitor -Service monitor for Linux and macOS +# PyNinja +Light weight OS agnostic service monitoring API diff --git a/monitor/__init__.py b/pyninja/__init__.py similarity index 93% rename from monitor/__init__.py rename to pyninja/__init__.py index a7d5609..70af379 100644 --- a/monitor/__init__.py +++ b/pyninja/__init__.py @@ -4,7 +4,7 @@ import click -from monitor.main import start # noqa: F401 +from pyninja.main import start # noqa: F401 version = "0.0.0-a" @@ -21,7 +21,7 @@ help="Environment configuration filepath.", ) def commandline(*args, **kwargs) -> None: - """Starter function to invoke service-monitor via CLI commands. + """Starter function to invoke PyNinja via CLI commands. **Flags** - ``--version | -V``: Prints the version. @@ -46,7 +46,7 @@ def commandline(*args, **kwargs) -> None: for k, v in options.items() ) if kwargs.get("version"): - click.echo(f"service-monitor {version}") + click.echo(f"PyNinja {version}") sys.exit(0) if kwargs.get("help"): click.echo( diff --git a/monitor/auth.py b/pyninja/auth.py similarity index 95% rename from monitor/auth.py rename to pyninja/auth.py index d7f4668..8b289d9 100644 --- a/monitor/auth.py +++ b/pyninja/auth.py @@ -4,7 +4,7 @@ from fastapi import Depends from fastapi.security import HTTPBasicCredentials, HTTPBearer -from monitor import exceptions, squire +from pyninja import exceptions, squire SECURITY = HTTPBearer() diff --git a/monitor/exceptions.py b/pyninja/exceptions.py similarity index 100% rename from monitor/exceptions.py rename to pyninja/exceptions.py diff --git a/monitor/main.py b/pyninja/main.py similarity index 94% rename from monitor/main.py rename to pyninja/main.py index 8394005..2589a08 100644 --- a/monitor/main.py +++ b/pyninja/main.py @@ -4,7 +4,7 @@ import uvicorn from fastapi import FastAPI -from monitor import router, squire +from pyninja import router, squire def start(env_file: str = None) -> None: diff --git a/monitor/router.py b/pyninja/router.py similarity index 85% rename from monitor/router.py rename to pyninja/router.py index fa29d5a..2c80a5f 100644 --- a/monitor/router.py +++ b/pyninja/router.py @@ -4,13 +4,13 @@ from fastapi.responses import RedirectResponse from fastapi.routing import APIRoute -from monitor import auth, exceptions, service +from pyninja import auth, exceptions, service logging.getLogger("uvicorn.access").disabled = True LOGGER = logging.getLogger("uvicorn.error") -async def service_monitor(service_name: str): +async def service_status(service_name: str): """API function to monitor a service.""" service_status = service.get_service_status(service_name) LOGGER.info( @@ -32,8 +32,8 @@ async def docs(): routes = [ APIRoute( - path="/service-monitor", - endpoint=service_monitor, + path="/status", + endpoint=service_status, methods=["GET"], dependencies=[Depends(auth.authenticator)], ), diff --git a/monitor/service.py b/pyninja/service.py similarity index 98% rename from monitor/service.py rename to pyninja/service.py index a166a0d..00131f2 100644 --- a/monitor/service.py +++ b/pyninja/service.py @@ -4,7 +4,7 @@ import psutil -from monitor import exceptions, squire +from pyninja import exceptions, squire current_os = platform.system() diff --git a/monitor/squire.py b/pyninja/squire.py similarity index 100% rename from monitor/squire.py rename to pyninja/squire.py diff --git a/pyproject.toml b/pyproject.toml index 06a3f8e..854a933 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "PyNinja" dynamic = ["version", "dependencies"] -description = "OS agnostic service monitoring API" +description = "Light weight OS agnostic service monitoring API" readme = "README.md" authors = [{ name = "Vignesh Rao", email = "svignesh1793@gmail.com" }] license = { file = "LICENSE" } @@ -12,15 +12,16 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", + "Topic :: System :: Monitoring", ] -keywords = ["service-monitor"] +keywords = ["service-monitor", "PyNinja"] requires-python = ">=3.10" [tool.setuptools] packages = ["monitor"] [tool.setuptools.dynamic] -version = {attr = "monitor.version"} +version = {attr = "pyninja.version"} dependencies = { file = ["requirements.txt"] } [project.optional-dependencies] @@ -28,15 +29,15 @@ dev = ["sphinx==5.1.1", "pre-commit", "recommonmark", "gitverse"] [project.scripts] # sends all the args to commandline function, where the arbitary commands as processed accordingly -monitor = "monitor:commandline" +pyninja = "pyninja:commandline" [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project.urls] -Homepage = "https://github.com/thevickypedia/service-monitor" -Docs = "https://thevickypedia.github.io/service-monitor" -Source = "https://github.com/thevickypedia/service-monitor" -"Bug Tracker" = "https://github.com/thevickypedia/service-monitor/issues" -"Release Notes" = "https://github.com/thevickypedia/service-monitor/blob/main/release_notes.rst" +Homepage = "https://github.com/thevickypedia/PyNinja" +Docs = "https://thevickypedia.github.io/PyNinja" +Source = "https://github.com/thevickypedia/PyNinja" +"Bug Tracker" = "https://github.com/thevickypedia/PyNinja/issues" +"Release Notes" = "https://github.com/thevickypedia/PyNinja/blob/main/release_notes.rst"