Metadata-Version: 2.3
Name: keven_core
Version: 1.0.0
Summary: Core utilities and shared components for KEVEN's microservices.
License: AGPL-3.0
Author: Craig Holland
Author-email: craig_holland@hotmail.com
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: PyJWT (>=2.6.0,<3.0.0)
Requires-Dist: aenum (>=3.1.15,<4.0.0)
Requires-Dist: confluent-kafka (>=2.8.2,<3.0.0)
Requires-Dist: grpcio (==1.71.0)
Requires-Dist: grpcio-tools (==1.71.0)
Requires-Dist: jsonpickle (>=4.0.2,<5.0.0)
Requires-Dist: kafka-python (>=2.0.2,<3.0.0)
Requires-Dist: loguru (>=0.7.0,<0.8.0)
Requires-Dist: protobuf (>=5.26.1,<6.0)
Requires-Dist: psycopg2-binary (>=2.9.6,<3.0.0)
Requires-Dist: pydantic (>=2.0,<3.0)
Requires-Dist: pydantic-settings (>=2.8.1,<3.0.0)
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
Requires-Dist: sqlalchemy (>=2.0.0,<3.0.0)
Requires-Dist: types-requests (>=2.28.11,<3.0.0)
Description-Content-Type: text/markdown

# keven_core v1.0.0
Python package containing common utilities, functions, and helpers across all microservices

keven_core offers the following subpackages:
- configuration
- database
- exceptions
- grpc
- kafka
- logging
- models
- security
- utils

## Configuration
Classes and utilities for Configuration
### BaseConfig: Dynamic Environment Configuration Management
`BaseConfig` is the foundational configuration class in **keven_core**, designed to **dynamically load and inherit environment variables** across multiple microservice submodules.

#### How It Works:
- **Multi-Level Inheritance** → Each subclass (`DomainConfig`, `DatabaseConfig`, etc.) retains and extends the environment variables of its parent, ensuring configuration consistency across modules.
- **Priority-Based Loading** → Variables are loaded in the following order:
  1. **Explicitly declared class attributes**
  2. **System environment variables (`os.environ`)**
  3. **`.env` file specific to the subclass (if present)**
- **Automatic Variable Merging** → New environment variables from `.env` files or subclass definitions **merge with inherited values** instead of overwriting them.
- **Case-Insensitive Access** → Variables are normalized and accessible via both **uppercase and lowercase names**.

This approach ensures that each microservice submodule can define its own configurations **while preserving inherited values from parent modules**. This way, the `domain` submodule can be the first to subclass `BaseConfig`, then the `database` submodule can subclass the config class from `domain`, and the resulting instance would contain **all of the env variables** from both `domain` and `database`.🚀

