This is a simple program for developer to create a param-config reader. It only needs config_dict and config_file_name to analyse all param and config
for example,your py file main.py is
from movoid_config import Config
config = Config({
"param": {
"type": "string", # we will change it to a string.you can input: int,float,number,bool,true,false,list,dict,enum,kv,byte.others are all string.
"default": "ppp", # when you do not input,we will give a default value.it will make 'must' invalidate
"single": "p", # use like -p *
"full": "param", # use like --param *
"key": "param", # use like param=?
"ini": ["main", "param"], # use in config.ini
"config": True, # whether try to find and write in .ini file
"must": True, # whether you must input it ,or it will raise exception
"ask": True, # when you do not input,you can change to ask user to input it
"help": "This is param which is an example.", # show it in help text.(not done yet)
},
"check": {
"type": "true",
"false": {
"single": "f",
"full": "false"
} # when type is true,you can input -f or --false to input a false value to "check"
},
"int_list": {
"full": "list",
"type": "list",
"sub": "int" # to define type of list value
},
"int_bool_dict": {
"key": "dict",
"type": "dict",
"sub": ["int", "str"] # to define type of dict key and value
}
}, "config.ini")
print(config.param)
print(config["int_list"])
print(config["int_bool_dict"])
when you input
python main.py -p p234 --list 1,2,3 dict=1:a,2:b
you can see
p234
[1, 2, 3]
{1: 'a', 2: 'b'}
you can also use
from movoid_config import Config
config = Config({})
for i, v in config.items():
print(i, v)
for i in config.keys():
print(i)
for v in config.values():
print(v)
to traversal loop
If you use when you do not input. An error will be raised like use an unknown key in a dict.
Metadata
Release files for movoid-config 1.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| movoid_config-1.2.7.tar.gz | 8.2 kB | Without provenance | Details for movoid_config-1.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| movoid_config-1.2.7-py3-none-any.whl | Python 3 | none | any | Details for movoid_config-1.2.7-py3-none-any.whl |
Total release size: 16.2 kB
Release files / movoid_config-1.2.7.tar.gz
| Download URL | movoid_config-1.2.7.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6017b9241b77f91bc0227bf74752822223de3acb1b3824c804992b453b596e80
|
|
BLAKE2b-256 checksum How to use checksums |
69847f49a7d86f794735f293ce6a847b7950e81b6596b86c3573fe5c2b444f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / movoid_config-1.2.7-py3-none-any.whl
| Download URL | movoid_config-1.2.7-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49e3ca7ba055aaff22dec79041cdb89b5c9d09e3c5e5a18ef4b770d8aba59f37
|
|
BLAKE2b-256 checksum How to use checksums |
34b4c8bebac44a3ff5bedaf75cc1201f8cb791351ad5c43e8605fe4e60b187f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for movoid-config 1.2.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.