Scriptconfig

Latest version: v0.8.1

Safety actively analyzes 689550 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

0.7.5

Changed
* Both `Config` and `DataConfig` now support the `.cli` classmethod and should
now be the preferred way of creating a `sys.argv` aware instance.

Fixed
* Issue when specifying `default` to `.cli` or `.load`.

0.7.4

Changed
* Reworked how the "port" functions work under the hood, and added a new one.
* The `default` and `__default__` class variables are now treated as aliases in Config.
* The `normalize` and `__post_init__` methods are now treated as aliases in Config and DataConfig.
* Deprecated `default` class attribute use `__default__` instead.
* Deprecated `normalize` method, use `__post_init__` instead.

Fixed:
* Dataconfigs can now be instantiated with aliased kwargs

0.7.3

Added
* Add `autocomplete` arg for `argcomplete`.
* New `scriptconfig.modal` module with `ModalCLI` class for building modal CLIs
from multiple scriptconfig objects.

Fixed
* DataConfig can now define classmethods

0.7.2

Added
* `parse_args` and `parse_known_args` methods to Config and DataConfig

Changed
* Experimental feature where the CLI can now accept `_` or `-` in sys.argv if `__fuzzy_hyphens__` exists and is truthy
* default, description, and epilog can now be specified with dunder __default__, __description__, and __epilog__ attributes
* Added `cmdline` argument to `DataConfig.cli`

Fixed
* Bug where trying to get a non-existing value raised an AttributeError instead of a KeyError due to aliases
* Fixed issue where using setattr on a DataConfig using a known key did not set its dictionary value.
* Fixed DataConfig issue with aliases
* Issue where `args` contains a `PathLike` object. This is now detected and cast to a string for convenience.

0.7.1

Added

* Added basic support for groups and mutually exclusive groups by specifying an id in each value.


Changed

* Options marked as isflag can now accept any type for the key/val style of
argument. The flag style will still return a boolean.

0.7.0

Changed

* Flag variables are now accepted on the command line. Variables marked as `isflag` can be specified by either a flag `--varname` or as a key/value pair `--varname=True`.

* The config object now allows aliases to be used in setitem and getitem calls.
This should be used sparingly.

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.