Basic Options
This package provides a basic way to create configuration files, especially for tkinter GUI applictions.
# EXAMPLE USAGE
# Create an options class inheriting BasicOptions, and override the set_defaults function
class ExampleOptions(BasicOptions):
def set_defaults(self) -> None:
self.value_a = 1
self.valueB = "2"
self.c = [3, 4, 5]
self.delta = 6.0
self.Eee = {"value": 7}
# Create an instance of the options
example = ExampleOptions()
# Change a value in the options using .set_option() or item notation
example["delta"] += 0.6666
# You can do `example.delta += 0.6666`, however that would not activate the wrappers from .set_option_wrappers()
# Retreiving options can be done with .get_option(), or item notation
print(example.get_option("delta"))
print(example["c"])
# Loading and saving options can be done easily with .save_file(), .try_load_file() and .load_file()
# example2 = ExampleOptions().load_file("old_save.json").
# example2.save_file("new_save.json")
# Retreiving dictionaries and json strings with .to_json() and .to_dict()
Metadata
Release files for basic-options 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| basic_options-0.2.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| basic_options-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / basic_options-0.2.0.tar.gz
| Download URL | basic_options-0.2.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94fcb74dd881e8a604ff176dc869d054b6b59457a600e0234ab88b73730a4ced
|
|
BLAKE2b-256 checksum How to use checksums |
d86cd631bc8e94bae484b727a7561e574d4dc61c80a3f57d458b30770d509e2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / basic_options-0.2.0-py3-none-any.whl
| Download URL | basic_options-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df00049264f185ab68180db1ba23fcabff64a3cb6b4e797ee30cbd30931bd85f
|
|
BLAKE2b-256 checksum How to use checksums |
e3d482ddb2833c387a650e40a4ecf5e7dbe7a387f35f15ce2a17a0e9abe00ccb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|