This package provides a basic way to create configuration files, especially for tkinter GUI applictions.
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
basic_options-0.2.0.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basic_options-0.2.0.tar.gz.
File metadata
- Download URL: basic_options-0.2.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94fcb74dd881e8a604ff176dc869d054b6b59457a600e0234ab88b73730a4ced
|
|
| MD5 |
7ef8ad6c0887c32edcfb4220cd9db28f
|
|
| BLAKE2b-256 |
d86cd631bc8e94bae484b727a7561e574d4dc61c80a3f57d458b30770d509e2e
|
File details
Details for the file basic_options-0.2.0-py3-none-any.whl.
File metadata
- Download URL: basic_options-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df00049264f185ab68180db1ba23fcabff64a3cb6b4e797ee30cbd30931bd85f
|
|
| MD5 |
ff9334644fec23bd5c718c94dbb209f5
|
|
| BLAKE2b-256 |
e3d482ddb2833c387a650e40a4ecf5e7dbe7a387f35f15ce2a17a0e9abe00ccb
|