A simple tool to use dataclass as your config
Project description
Argdcls
A simple tool to use dataclass as your config
Usage
from dataclasses import dataclass
import argdcls
@dataclass
class Config:
lr: float
adam: bool = False
config = argdcls.load(Config)
print(config.lr)
print(config.adam)
print(config.outdir) # type: ignore
$ python3 main.py lr=1.0 +adam=True ++outdir="results"
1.0
True
results
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
argdcls-0.1.1.tar.gz
(2.9 kB
view hashes)