📌 Service-Kit is a collection of functions and objects designed to help the Monkey team bootstrap, build, and maintain various services efficiently.
- Service Bootstrapping: Provides templates and utilities to stand up new services quickly.
- Common Utilities: Provides common utilities for logging, configuration, and error handling.
- Service Configuration: Provides a base class for service configuration that can be easily extended.
- Testing Support: Provides utilities for testing services.
- api: Provides components for setting up an API with FastAPI
- base_model: Provides a Pydantic BaseModel with extra features
- configuration: Provides models, types, and utilities for configuring a service
- errors: Enables exceptions using structured errors
- logging: Provides a logger that enables structured logging
- testing: Provides useful pytest fixtures
You can install Service-Kit using poetry:
$ poetry add git+https://github.com/guardicode/service-kit.git
or by using pip:
$ pip install git+https://github.com/guardicode/service-kit.git
After installation, you can start using Service-Kit like any other Python package.
For a more detailed example and usage patterns, refer to the
template_service.py
file included in the repository.
Run the following commands to install the necessary prerequisites:
$ pip install poetry pre-commit
$ poetry install
$ pre-commit install -t pre-commit -t prepare-commit-msg
Run automated tests with:
$ poetry run pytest
To run automated tests with test coverage, run:
$ poetry run pytest --cov-report=html --cov=service-kit
$ firefox ./htmlcov/index.html
The docs
directory contains the needed file to automatically generate code documentation using Sphinx.
To change the Sphinx configuration, change the attributes in source/conf.py
.
The documentation uses source/_static
to keep the custom media, stylesheets, js scripts etc.
source/index.rst
is the main rst file in which the look of the index HTML page is defined.
The make script generates the documentation using sphinx-build.
The generated documentation is stored in build/html/
.
- From
service-kit
, install python dependencies:
$ poetry install
- Activate the python venv
$ poetry env activate
- Generate the documentation:
$ cd docs
$ make html
- From
service-kit
, install python dependencies:
$ poetry install
- Activate the python venv
$ poetry env activate
- Generate the documentation:
$ cd docs
$ make html
To deploy the documentation locally, build/html/index.html