Metadata-Version: 2.2
Name: sat_config_reader
Version: 0.0.1
Summary: Package to read config files
Home-page: https://gitlab.com/markus2110-public/python/packages/config-reader
Author: Markus
Author-email: markus2110@gmail.com
Keywords: config,reader,ini files
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.9,<3.13
Description-Content-Type: text/markdown
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Provides-Extra: test
Requires-Dist: flake8; extra == "test"
Requires-Dist: coverage; extra == "test"
Requires-Dist: tox; extra == "test"
Requires-Dist: mypy; extra == "test"
Provides-Extra: dev
Requires-Dist: flake8; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: tox; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# Python config file reader
[![coverage report](https://gitlab.com/markus2110-public/python/packages/config-reader/badges/develop/coverage.svg)](https://gitlab.com/markus2110-public/python/packages/config-reader/-/commits/develop)
[![pipeline status](https://gitlab.com/markus2110-public/python/packages/config-reader/badges/develop/pipeline.svg)](https://gitlab.com/markus2110-public/python/packages/config-reader/-/commits/develop) 


## Description
TBD

## Installation
```commandline
pip install sat_config_reader
```
or
```commandline
python -m pip install sat_config_reader
```

## Usage
`tests/mocks/config_1/my_defaults.ini`
```ini
[DEFAULT]
NAME = localhost
PORT = 8080
LOG_FILE = /tmp/logfile.log

[config1]
PORT = 12345
LOG_FILE = /tmp/config1.log

[config2]
NAME = remote_server
PORT = 80
LOG_FILE = /path/to/file.log
```
***
`main.py`   
#### Without dataclass, result will be a `dict[str, dict]`
```python
from src.read_config import config_reader

reader = config_reader("./tests/mocks/config_1/my_defaults.ini")
port = reader.get('config1').get('PORT')
assert 12345 == port
print(port)
```
#### with dataclass, result is a `dict[str, TypeMapping]`
```python
from dataclasses import dataclass
from src.read_config import config_reader

@dataclass
class TypeMapping:
    NAME: str
    PORT: int
    LOG_FILE: str

reader = config_reader("./tests/mocks/config_1/my_defaults.ini", TypeMapping)
config1: TypeMapping = reader.get('config1')
port = config1.PORT
assert 12345 == port
print(port)
```

*** 
## Example
TBD
