Settingsclass

Latest version: v0.1.4

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

Scan your dependencies

0.1.4

Leaving out the type hint for members will now set a type inferred based on the default value. These will be placed towards the end of the .ini file and print a warning message to the console.
e.g.

settingsclass
class Settings:
class program:
timeout = 500
lang: str = "ja"

will no longer cause an error, it will instead correctly infer timeout to be an int.
The order in ini file will be lang->timeout instead of the expected timeout->lang.

0.1.3

This release includes the updated read me file

0.1.2

- Fixed many typos in code and documentation
- Saving to file would trigger an encryption of all variables with Encrypted[type] hints. While this would cause no functionality issues, it is not intended, as only changed values should be encrypted and overwritten

0.1.1

1. The `set_language` and `available_languages` can now be imported directly from the package or through a static function

from settingsclass import settingsclass, set_language, availalbe_languages
availalbe_languages() -> ("en", "ja")
set_language("ja")

Alternatively:

[...]
conf = Settings(...)
conf.set_language("en")


2. Docstring has been added to most functions.

0.1.0

An easy-to-use, but feature-rich solution to storing settings.
Supports random value generation, encrypted values and fields hidden by default with an automatic IO operations to an ini file.

Features in this release:
- dataclass decorator
- Types for generating values at runtime
- RandomString[length]
- RandomFloat[min_value, max_value]
- RandomInt[min_value, max_value]
- Encrypted[type]
- Hidden[type]

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.