This repo contains various utility and example packages
- Logger
- Database
- Multithreading
- This python module have a logger.py file and a config folder
- The logger.py file contains log and log_v1 decorators
- The config folder contains a various examples of logging configurations in yaml file
- For the usage of the decorator, please check app.py. The
@log
decorator is used on both thedo_something()
function andTest
Class - New addition to logger.py is the LoggerFactory class, which initialize the logger with the configuration file and name of the logger.
- This package contains a threading.py file.
- The threading.py file contains a HttpClient build using requests library and used Threading library to make the requests concurrent.
- Please check the app.py file on how to use the HttpClient.
- This package contains a database.py file.
- The database.py file contains a Database class which is used to connect to the Mongo DB database and execute the dependent queries with transactions enabled
- Please check app.py file on how to use the Database class.
Please follow below steps after cloning this repository
- There is a Makefile used in this repository. It has various rules that can streamline the developement process
use make run
. It will create .venv virtual environment, download all the required libraries from requirements.txt and installs them to .venv
use make OS=win run
to get the same as mac users
- When a new package is added, update the requirements.txt using make with
make update-requirements
command - To do a safety check of the code, install saftey package from pip as
python -m pip install saftey
- Run
make saftey
to do saftey check. This let us know if we are any vulnerable libraries.
- Run
Please feel free to fork the repository and make changes. Please feel free to contact me at email