cliconfig

Merging yaml config and set parameters with CLI. Use config processing for more advanced manipulations.

MIT License

Downloads
1.3K
Stars
8
cliconfig - v1.4.0 Latest Release

Published by valentingol 10 months ago

cliconfig - v1.0.0

Published by valentingol over 1 year ago

Major release 1.0.0 🎉

Since the release 1.0.0 the library is considered as sufficiently stable to be used by everyone. No breaking changes will be introduced until 2.0.0 (if it will exist someday).

📝 Shorten the readme (most information are in documentation).
✨ New argument no_cli in make_config to deactivate the CLI parsing

cliconfig - v1.0.0-rc1

Published by valentingol over 1 year ago

✨ New features of create_processing_value/keep_property:

  • Allow passing the whole flat config as 2nd argument of the function to update value or compute property to keep
  • Allow choosing the type of processing for create_processing_value (premerge, postmerge, ...)
cliconfig - v1.0.0-beta4

Published by valentingol over 1 year ago

Beta 4 version

✨ Add ProcessNew associated to @new tag to add new keys absent from current config dict.

Any collaborator can use this library to test it in their real projects.

Issues, features requests, enhancement request are welcolme as well as PR! hugs

cliconfig - v1.0.0-beta3

Published by valentingol over 1 year ago

Beta 3 version

✨ Getting, setting and deleting parameters via config attributes (ex config.training.optimizer.lr = 0.001)

Any collaborator can use this library to test it in their real projects.

Issues, features requests, enhancement request are welcolme as well as PR! 🤗

cliconfig - v1.0.0-beta2

Published by valentingol over 1 year ago

Beta 2 version

✨ Add fallback option in make_config

Any collaborator can use this library to test it in their real projects.

Issues, features requests, enhancement request are welcolme as well as PR! 🤗

cliconfig - v1.0.0-beta1

Published by valentingol over 1 year ago

Beta 1 version

Any collaborator can use this library to test it in their real projects.

Issues, features requests, enhancement request are welcolme as well as PR! 🤗

cliconfig - v0.7.0

Published by valentingol over 1 year ago

New features ✨:

  • New processing timing: end-build (at the end of the config building with make_config or load_config), with endbuild method
  • ProcessDelete with tag @delete to delete a key at the end of pre-merge.
  • Supports multi files in yaml documents (with "---" separator)
  • Supports yaml tags instead (or in addition) to cliconfig tags, e.g: 'key': !tag1@tag2 value instead of 'key@tag1@tag2': value
  • parse_cli's default value is True for CLI parameter

📝 Better docstrings for sphinx
🚀 Improve behavior of ProcessCopy and ProcessTyping

cliconfig - v0.6.0

Published by valentingol over 1 year ago

✨ New features:

  • is_tag_in: tag routine to check if a tag is in a key with robustness (useful in all processing dealing with tags)
  • ProcessSelect processing that remove a sub-config except selecting keys
  • create_processing_keep_property: helper function to make processing that maintain property of a parameter
  • ProcessTyping now supports nested types (nested with nodes List, Dict, Union, Optional)

✔️ Add complex integration test with @select, @merge_add, @type and @copy
🚑 Fix a bug where an error was systematically raised when make_config or load_config were called with a custom process_list

cliconfig - v0.5.0

Published by valentingol over 1 year ago

✨ Introduce Config classs that is a dataclass containing 2 attributes (no methods): the config dict and the list of processing

cliconfig - v0.4.0

Published by valentingol over 1 year ago

🎉 Processings !
This release bring the processings to the config routines (merge, load, save). It is possible to apply any function that modify a configuration after and before merging, after loading and before saving. The processings use the list of processing to apply processings recursively via the routines. To use processing, the tags are usefull (like {'config.param@mytag': value} ). The processings can then trigger on a any tagged key.

Processing module:
-✨ make_processing functions: helpers to create simple processing

  • ✨ Built-in processing ProcessMerge (associated to tags @merge_before/after/add) that allow dynamic config merging just in time.
  • ✨ Built-in processing ProcessCopy (associated to tag @copy) that allow copying a parameter just before merging.
  • ✨ Built-in processing ProcessTyping (associated to tag @type:) that enforces the type of a parameter.
  • ✨ tag routines to facilitate the manipulation of tags
  • 📝 ✔️ Doc and associated tests
cliconfig - v0.2.0

Published by valentingol over 1 year ago

  • ✨ add merge_config_file to merge from path (= merge_config that includes
    config loading)
  • ✨ add clean_pre_flat to solve conflicting flatten and unflatten parameters
    before flattening the config
  • 🚀 avoid changing keys order in merge_config
  • 📝 improve readmes indications and improve docstring examples
  • 🏗️ architectural changes in cliconfig
cliconfig - v0.1.2

Published by valentingol over 1 year ago

Working cliconfig module to make and manipulate configs with yaml files merging and CLI.

  • make_config to make config merging from default configs, additional configs and parameters in CLI.
  • merge to merge two configs together. Support nested config, flat configs (with '.' delimiter) and mix of two.
  • save_config and load_config to save and load config.
  • show_config to visualize config in pretty way.
  • 📝 Complete documentation with Read the Docs here
  • 🎨 10/10 pylint, ruff (flake8 + extensions) and mypy are happy
  • ✔️ 100% test coverage and integration test for show_config
Package Rankings
Top 28.01% on Pypi.org
Badges
Extracted from project README
Release License Ruff_logo Black_logo Ruff Flake8 Pydocstyle MyPy PyLint Tests Coverage Documentation Status Config