Skip to content

Commit

Permalink
Merge branch 'master' into kma/app
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Dec 29, 2023
2 parents 2a4e13e + 3685091 commit 0fdc832
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ easily.
The configuration is based on [OmegaConf].
Optionally, loading from toml or using [pydantic] is possible.

To run multiple related tasks, there is an integration with
[invoke](https://www.pyinvoke.org).
If you need something more complex, like running multiple instances of the
script, take a look at [hydra-core](https://hydra.cc) or use another script
to launch multiple instances.

## Demo and application

To run an application, you need...
Expand Down Expand Up @@ -110,7 +104,7 @@ class MyConf(pydantic.BaseModel):
alphaconf.setup_configuration(MyConf, prefix='a')
# read the value
alphaconf.get('a', MyConf)
v = alphaconf.get(MyConf) # because it's registered as a type
v = alphaconf.get(MyConf) # shortcut, because it's registered as a type
```

### Secrets
Expand Down Expand Up @@ -147,7 +141,13 @@ def main(name: str=None, example=None):

### Invoke integration

Just add the lines below to parameterize invoke.
To run multiple related tasks, there is an integration with
[invoke](https://www.pyinvoke.org).
If you need something more complex, like running multiple instances of the
script, take a look at [hydra-core](https://hydra.cc) or use another script
to launch multiple instances.

Just add the lines below to parameterize `invoke`.
Note that the argument parsing to overwrite configuration will work only
when the script is directly called.

Expand All @@ -162,6 +162,9 @@ alphaconf.invoke.run(__name__, ns)
Replace `invoke` with alphaconf and plumbum.

## Way to 1.0
- Make argument parsing separate from the core
- Compare `plumbum` and `invoke` for building scripts
- Secret handling and encryption
- Run a specific function `alphaconf my.module.main`:
find functions and inject args
- Install completions for bash `alphaconf --install-autocompletion`
Expand Down

0 comments on commit 0fdc832

Please sign in to comment.