fdc-shared-kernel 0.0.3__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/PKG-INFO +4 -35
- fdc_shared_kernel-0.0.4/README_pypi.md +99 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/pyproject.toml +3 -2
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/PKG-INFO +4 -35
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/SOURCES.txt +1 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/README.md +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/requirements.txt +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/setup.cfg +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/dependency_links.txt +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/requires.txt +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/top_level.txt +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/config/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/database/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/configuration_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/custom_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/data_validation_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/http_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/infrastructure_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/operational_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/security_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/interfaces/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/interfaces/databus.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/logger/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/messaging/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/messaging/nats_databus.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/models/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/config/test_config.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/logger/test_logger.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/messaging/test_nats_interface.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/utils/test_data_validators.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/utils/test_date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/utils/test_string_utils.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/utils/utils.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/__init__.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/data_validators_utils.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/string_utils.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
|
-
Author-email: Shikhil S <shikhil.s@dbizsolution.com>
|
|
5
|
+
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
@@ -27,7 +27,7 @@ Requires-Dist: setuptools==71.0.0
|
|
|
27
27
|
Requires-Dist: SQLAlchemy==2.0.31
|
|
28
28
|
Requires-Dist: typing_extensions==4.12.2
|
|
29
29
|
|
|
30
|
-
# Shared Kernel
|
|
30
|
+
# FDC Shared Kernel
|
|
31
31
|
|
|
32
32
|
Shared Kernel is a lightweight, modular Python library designed to facilitate rapid development of microservices. It provides essential utilities for data manipulation, logging, configuration management, and database connectivity, making it an ideal foundation for building scalable and maintainable microservices.
|
|
33
33
|
|
|
@@ -53,40 +53,9 @@ Shared Kernel is a lightweight, modular Python library designed to facilitate ra
|
|
|
53
53
|
To install Shared Kernel, clone the repository and install it using pip:
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
|
|
57
|
-
cd shared-kernel pip install .
|
|
56
|
+
pip install fdc-shared-kernel
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
##### Step 1: Set Up Your Environment
|
|
61
|
-
First, ensure you have Python installed on your system. Then, set up a virtual environment for your project to manage dependencies cleanly. Open your terminal and navigate to your project directory:
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
cd path/to/shared-kernel
|
|
65
|
-
python -m venv venv
|
|
66
|
-
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
##### Step 2: Install Python build frontend.
|
|
70
|
-
Ensure you python's build frontend. installed in your environment. This is necessary for building the wheel package from **.toml** file. You can install them using pip:
|
|
71
|
-
```sh
|
|
72
|
-
pip install --upgrade build
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
##### Step 3: Build the Wheel Package
|
|
76
|
-
```sh
|
|
77
|
-
python -m build
|
|
78
|
-
```
|
|
79
|
-
This command will build a wheel distribution and also a source distribution. After running this command, you'll find the .whl and a tar file inside the dist/ directory within your project folder.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
##### Step 4: Distribute the Wheel
|
|
83
|
-
Now that you have a .whl file, you can distribute it to others. Users can install your library using pip by pointing to the .whl file:
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
pip install dist/shared_kernel-0.1.0-py3-none-any.whl
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
59
|
## Usage
|
|
91
60
|
|
|
92
61
|
### Importing Modules
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# FDC Shared Kernel
|
|
2
|
+
|
|
3
|
+
Shared Kernel is a lightweight, modular Python library designed to facilitate rapid development of microservices. It provides essential utilities for data manipulation, logging, configuration management, and database connectivity, making it an ideal foundation for building scalable and maintainable microservices.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Getting Started](#getting-started)
|
|
8
|
+
- [Prerequisites](#prerequisites)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Importing Modules](#importing-modules)
|
|
12
|
+
- [Initializing Database Connection](#initializing-database-connection)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Python 3.6+
|
|
20
|
+
- Pip
|
|
21
|
+
|
|
22
|
+
### Installation
|
|
23
|
+
|
|
24
|
+
To install Shared Kernel, clone the repository and install it using pip:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pip install fdc-shared-kernel
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Importing Modules
|
|
33
|
+
|
|
34
|
+
Import the required modules from Shared Kernel into your project:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
from shared_kernel.logger import Logger
|
|
38
|
+
from shared_kernel.config import Config
|
|
39
|
+
from dotenv import find_dotenv
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def main():
|
|
43
|
+
logger = Logger(name="my_app")
|
|
44
|
+
logger.configure_logger()
|
|
45
|
+
|
|
46
|
+
# Specify the path to the .env file if it's not in the current directory
|
|
47
|
+
config_manager = Config(env_path=find_dotenv())
|
|
48
|
+
|
|
49
|
+
# Access environment variables
|
|
50
|
+
api_key = config_manager.get("KEY", "default_api_key")
|
|
51
|
+
|
|
52
|
+
# Example usage
|
|
53
|
+
logger.logger.info("This is an info message.")
|
|
54
|
+
logger.logger.error("This is an error message.")
|
|
55
|
+
logger.logger.info(api_key)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if __name__ == "__main__":
|
|
59
|
+
main()
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Initializing Database Connection
|
|
65
|
+
|
|
66
|
+
Use the `DB` class to initialize a database connection:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
from shared_kernel.DB import DB
|
|
70
|
+
|
|
71
|
+
db_instance = DB("postgresql://user:password@localhost/dbname")
|
|
72
|
+
engine, SessionLocal = db_instance.init_db_connection()
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Initializing NATS Connection
|
|
80
|
+
|
|
81
|
+
Use the `NATSClient` class to initialize a messaging connection:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
from shared_kernel.messaging import NATSClient
|
|
85
|
+
import asyncio
|
|
86
|
+
|
|
87
|
+
def run():
|
|
88
|
+
nats_instance = NATSClient("nats://localhost:4222")
|
|
89
|
+
await nc_interface.connect()
|
|
90
|
+
|
|
91
|
+
async def message_callback(data):
|
|
92
|
+
print(f"Received a message: {data}")
|
|
93
|
+
|
|
94
|
+
await nc_interface.subscribe("example_subject", message_callback)
|
|
95
|
+
await nc_interface.publish("example_subject", "Hello NATS!")
|
|
96
|
+
|
|
97
|
+
if __name__ == '__main__':
|
|
98
|
+
asyncio.run(run())
|
|
99
|
+
```
|
|
@@ -4,12 +4,13 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fdc_shared_kernel"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.4"
|
|
8
8
|
requires-python = ">=3.7"
|
|
9
|
-
readme = "
|
|
9
|
+
readme = "README_pypi.md"
|
|
10
10
|
description = "Shared library for microservice"
|
|
11
11
|
authors = [
|
|
12
12
|
{name="Shikhil S", email="shikhil.s@dbizsolution.com"},
|
|
13
|
+
{name="Ahammed Akdham N", email="ahammedakdham.n@dbizsolution.com"},
|
|
13
14
|
]
|
|
14
15
|
classifiers = [
|
|
15
16
|
"Programming Language :: Python :: 3",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
|
-
Author-email: Shikhil S <shikhil.s@dbizsolution.com>
|
|
5
|
+
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
@@ -27,7 +27,7 @@ Requires-Dist: setuptools==71.0.0
|
|
|
27
27
|
Requires-Dist: SQLAlchemy==2.0.31
|
|
28
28
|
Requires-Dist: typing_extensions==4.12.2
|
|
29
29
|
|
|
30
|
-
# Shared Kernel
|
|
30
|
+
# FDC Shared Kernel
|
|
31
31
|
|
|
32
32
|
Shared Kernel is a lightweight, modular Python library designed to facilitate rapid development of microservices. It provides essential utilities for data manipulation, logging, configuration management, and database connectivity, making it an ideal foundation for building scalable and maintainable microservices.
|
|
33
33
|
|
|
@@ -53,40 +53,9 @@ Shared Kernel is a lightweight, modular Python library designed to facilitate ra
|
|
|
53
53
|
To install Shared Kernel, clone the repository and install it using pip:
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
|
|
57
|
-
cd shared-kernel pip install .
|
|
56
|
+
pip install fdc-shared-kernel
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
##### Step 1: Set Up Your Environment
|
|
61
|
-
First, ensure you have Python installed on your system. Then, set up a virtual environment for your project to manage dependencies cleanly. Open your terminal and navigate to your project directory:
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
cd path/to/shared-kernel
|
|
65
|
-
python -m venv venv
|
|
66
|
-
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
##### Step 2: Install Python build frontend.
|
|
70
|
-
Ensure you python's build frontend. installed in your environment. This is necessary for building the wheel package from **.toml** file. You can install them using pip:
|
|
71
|
-
```sh
|
|
72
|
-
pip install --upgrade build
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
##### Step 3: Build the Wheel Package
|
|
76
|
-
```sh
|
|
77
|
-
python -m build
|
|
78
|
-
```
|
|
79
|
-
This command will build a wheel distribution and also a source distribution. After running this command, you'll find the .whl and a tar file inside the dist/ directory within your project folder.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
##### Step 4: Distribute the Wheel
|
|
83
|
-
Now that you have a .whl file, you can distribute it to others. Users can install your library using pip by pointing to the .whl file:
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
pip install dist/shared_kernel-0.1.0-py3-none-any.whl
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
59
|
## Usage
|
|
91
60
|
|
|
92
61
|
### Importing Modules
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/requires.txt
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/fdc_shared_kernel.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/exceptions/http_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/interfaces/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/messaging/nats_databus.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/config/test_config.py
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/tests/logger/test_logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/data_validators_utils.py
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.3 → fdc_shared_kernel-0.0.4}/src/shared_kernel/utils/date_format_utils.py
RENAMED
|
File without changes
|
|
File without changes
|