A shared utility library for event management system based on microservices architecture.
Project description
Shared Library Approach in Microservices
Why Use a Shared Library?
In a microservices architecture, multiple services often need common functionalities such as logging, error handling, authentication, and utility functions. Instead of duplicating code across services, we use a shared library to:
Reduce Code Duplication : Avoid repeating the same logic in every service.
Ensure Consistency : Standardized utilities across all services.
Simplify Maintenance : Fix issues or update features in one place.
Improve Scalability : Microservices remain lightweight and focused.
Enhance Deployment : Easier to manage updates and dependencies.
Installation
To install the shared library in your microservices, run:
pip install shared-utils
Or specify it in your requirements.txt:
shared-utils>=1.0.0
Usage
Inside any microservice, import and use the shared utilities:
from shared_utils.logging import setup_logger
logger = setup_logger(__name__)
logger.info("Shared utilities are working!")
Updating shared_utils
If a new feature or bug fix is added to shared_utils, follow these steps:
-
Modify the code: Implement your changes in
shared_utils. -
Update version: Change the version in
setup.py(e.g.,1.0.1to1.0.2). -
Build the package:
python setup.py sdist bdist_wheel
-
Publish to PyPI:
twine upload dist/*
-
Upgrade in services:
pip install --upgrade shared-utils
Versioning
We follow Semantic Versioning (SemVer):
- MAJOR – Breaking changes.
- MINOR – New features (backward compatible).
- PATCH – Bug fixes and improvements.
release history
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters