Metadata-Version: 2.4
Name: qcload
Version: 0.1.0
Summary: Priority-based config loader for qdata ecosystem — hunts config.yaml/.env from home dir upward through parent dirs
Project-URL: Homepage, https://github.com/fengl/qcload
License-Expression: MIT
Keywords: config,configuration,dotenv,env,quantitative,yaml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# qcload

Priority-based config loader for qdata ecosystem.

## Quick start

```python
from qcload import config, load_config, load_from_path

# Auto-search (global singleton, lazy load)
db_url = config["DATABASE_URL"]

# Functional call (new instance each time)
cfg = load_config()

# Load from specific file path
cfg = load_from_path("/path/to/my/config.yaml")

# Reload the global singleton
config = reload_config()
```

## Search priority

`qcload` searches for config files in this order (first found wins):

1. `~/config.yaml` (user home)
2. `~/.env`
3. `./config.yaml` (current directory)
4. `./.env`
5. `../config.yaml` (parent)
6. `../.env`
7. `../../config.yaml` (grandparent)
8. `../../.env`

## Config object

```python
cfg = load_config()

# Dict access
cfg["DATABASE_URL"]

# Attribute access (nested yaml)
cfg.database.host

# Type helpers
cfg.get_int("PORT", 8080)
cfg.get_bool("DEBUG", False)
cfg.get_float("RATE", 0.0)
cfg.get_list("HOSTS", [])

# Metadata
cfg.source       # Path to the loaded file
cfg.file_type    # "yaml" or "env"
cfg.is_empty     # True if no keys loaded
```

## License

MIT