Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# onion_config

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bybatkhuu/mod.python-config/2.build-publish.yml?logo=GitHub)](https://github.com/bybatkhuu/mod.python-config/actions/workflows/2.build-publish.yml)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/bybatkhuu/mod.python-config?logo=GitHub)](https://github.com/bybatkhuu/mod.python-config/releases)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bybatkhuu/module.python-config/2.build-publish.yml?logo=GitHub)](https://github.com/bybatkhuu/module.python-config/actions/workflows/2.build-publish.yml)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/bybatkhuu/module.python-config?logo=GitHub)](https://github.com/bybatkhuu/module.python-config/releases)
[![PyPI](https://img.shields.io/pypi/v/onion-config?logo=PyPi)](https://pypi.org/project/onion-config)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/onion-config?logo=Python)](https://docs.conda.io/en/latest/miniconda.html)

Expand Down Expand Up @@ -47,12 +47,12 @@ pip install -U onion-config

```sh
# Install package by git:
pip install git+https://github.com/bybatkhuu/mod.python-config.git
pip install git+https://github.com/bybatkhuu/module.python-config.git
```

**C.** Install from **pre-built release** files

1. Download **`.whl`** or **`.tar.gz`** file from **releases** - <https://github.com/bybatkhuu/mod.python-config/releases>
1. Download **`.whl`** or **`.tar.gz`** file from **releases** - <https://github.com/bybatkhuu/module.python-config/releases>
2. Install with pip:

```sh
Expand All @@ -66,7 +66,7 @@ pip install ./onion_config-[VERSION].tar.gz

```sh
# Clone repository by git:
git clone https://github.com/bybatkhuu/mod.python-config.git onion_config
git clone https://github.com/bybatkhuu/module.python-config.git onion_config
cd ./onion_config

# Install python build tool:
Expand All @@ -87,7 +87,7 @@ pip install ./dist/onion_config-${_VERSION}.tar.gz

```sh
# Clone repository by git:
git clone https://github.com/bybatkhuu/mod.python-config.git onion_config
git clone https://github.com/bybatkhuu/module.python-config.git onion_config
cd ./onion_config

# Install with editable development mode:
Expand All @@ -98,7 +98,7 @@ pip install -e .

```sh
# Clone repository by git:
git clone https://github.com/bybatkhuu/mod.python-config.git onion_config
git clone https://github.com/bybatkhuu/module.python-config.git onion_config
cd ./onion_config

# Install python dependencies:
Expand All @@ -124,13 +124,13 @@ config: BaseConfig = ConfigLoader(auto_load=True).config

### **Simple**

[**`.env`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/simple/.env)
[**`.env`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/simple/.env)

```sh
ENV=production
```

[**`configs/1.base.yml`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/simple/configs/1.base.yml):
[**`configs/1.base.yml`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/simple/configs/1.base.yml):

```yaml
env: test
Expand All @@ -142,7 +142,7 @@ app:
key: "value"
```

[**`configs/2.extra.yml`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/simple/configs/2.extra.yml):
[**`configs/2.extra.yml`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/simple/configs/2.extra.yml):

```yaml
app:
Expand All @@ -155,7 +155,7 @@ another_val:
extra: 1
```

[**`main.py`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/simple/main.py)
[**`main.py`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/simple/main.py)

```python
import sys
Expand Down Expand Up @@ -184,7 +184,7 @@ if __name__ == "__main__":
logger.info(f" Config:\n{pprint.pformat(config.model_dump())}\n")
```

Run the [**`examples/simple`**](https://github.com/bybatkhuu/mod.python-config/tree/main/examples/simple):
Run the [**`examples/simple`**](https://github.com/bybatkhuu/module.python-config/tree/main/examples/simple):

```sh
cd ./examples/simple
Expand All @@ -207,7 +207,7 @@ INFO:__main__: Config:

### **Advanced**

[**`.env.base`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/.env.base):
[**`.env.base`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/.env.base):

```sh
ENV=development
Expand All @@ -216,15 +216,15 @@ APP_NAME="Old App"
ONION_CONFIG_EXTRA_DIR="extra_configs"
```

[**`.env.prod`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/.env.prod):
[**`.env.prod`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/.env.prod):

```sh
ENV=production
APP_NAME="New App"
APP_SECRET="my_secret"
```

[**`configs/config.yml`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/configs/config.yml):
[**`configs/config.yml`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/configs/config.yml):

```yaml
env: local
Expand All @@ -240,7 +240,7 @@ logger:
output: "file"
```

[**`configs/logger.json`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/configs/logger.json):
[**`configs/logger.json`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/configs/logger.json):

```json
{
Expand All @@ -251,23 +251,23 @@ logger:
}
```

[**`configs_2/config.yml`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/configs_2/config.yml):
[**`configs_2/config.yml`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/configs_2/config.yml):

```yaml
extra:
config:
key1: 1
```

[**`configs_2/config_2.yml`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/configs_2/config_2.yml):
[**`configs_2/config_2.yml`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/configs_2/config_2.yml):

```yaml
extra:
config:
key2: 2
```

[**`extra_configs/extra.json`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/extra_configs/extra.json):
[**`extra_configs/extra.json`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/extra_configs/extra.json):

```json
{
Expand All @@ -277,7 +277,7 @@ extra:
}
```

[**`logger.py`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/logger.py):
[**`logger.py`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/logger.py):

```python
import sys
Expand All @@ -287,7 +287,7 @@ logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger(__name__)
```

[**`schema.py`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/schema.py):
[**`schema.py`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/schema.py):

```python
from enum import Enum
Expand Down Expand Up @@ -325,7 +325,7 @@ class ConfigSchema(BaseConfig):
app: AppConfig = Field(...)
```

[**`config.py`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/config.py):
[**`config.py`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/config.py):

```python
from onion_config import ConfigLoader
Expand Down Expand Up @@ -357,7 +357,7 @@ except Exception:
exit(2)
```

[**`app.py`**](https://github.com/bybatkhuu/mod.python-config/blob/main/examples/advanced/app.py):
[**`app.py`**](https://github.com/bybatkhuu/module.python-config/blob/main/examples/advanced/app.py):

```python
import pprint
Expand All @@ -382,7 +382,7 @@ if __name__ == "__main__":
logger.error(f" {e}\n")
```

Run the [**`examples/advanced`**](https://github.com/bybatkhuu/mod.python-config/tree/main/examples/advanced):
Run the [**`examples/advanced`**](https://github.com/bybatkhuu/module.python-config/tree/main/examples/advanced):

```sh
cd ./examples/advanced
Expand Down Expand Up @@ -450,16 +450,16 @@ Load order:

## Environment Variables

You can use the following environment variables inside [**`.env.example`**](https://github.com/bybatkhuu/mod.python-config/blob/main/.env.example) file:
You can use the following environment variables inside [**`.env.example`**](https://github.com/bybatkhuu/module.python-config/blob/main/.env.example) file:

```sh
ONION_CONFIG_EXTRA_DIR="./extra_configs"
```

## Documentation

- [docs](https://github.com/bybatkhuu/mod.python-config/blob/main/docs/README.md)
- [scripts](https://github.com/bybatkhuu/mod.python-config/blob/main/docs/scripts/README.md)
- [docs](https://github.com/bybatkhuu/module.python-config/blob/main/docs/README.md)
- [scripts](https://github.com/bybatkhuu/module.python-config/blob/main/docs/scripts/README.md)

---

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
long_description_content_type="text/markdown",
author="Batkhuu Byambajav",
author_email="batkhuu10@gmail.com",
url="https://github.com/bybatkhuu/mod.python-config",
download_url=f"https://github.com/bybatkhuu/mod.python-config/archive/v{_package_version}.tar.gz",
url="https://github.com/bybatkhuu/module.python-config",
download_url=f"https://github.com/bybatkhuu/module.python-config/archive/v{_package_version}.tar.gz",
keywords=[
_package_name,
"config",
Expand Down