paramflow 0.2.6__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {paramflow-0.2.6/paramflow.egg-info → paramflow-0.2.7}/PKG-INFO +1 -1
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/params.cpython-312.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/params.py +9 -13
- {paramflow-0.2.6 → paramflow-0.2.7/paramflow.egg-info}/PKG-INFO +1 -1
- {paramflow-0.2.6 → paramflow-0.2.7}/setup.py +1 -1
- {paramflow-0.2.6 → paramflow-0.2.7}/LICENSE +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/MANIFEST.in +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/README.md +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__init__.py +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/__init__.cpython-312.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/convert.cpython-312.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/frozen.cpython-312.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/frozen_test.cpython-312-pytest-8.3.4.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/params_test.cpython-312-pytest-8.3.4.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/parser.cpython-312.pyc +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/convert.py +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/frozen.py +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow/parser.py +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow.egg-info/SOURCES.txt +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow.egg-info/dependency_links.txt +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow.egg-info/requires.txt +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/paramflow.egg-info/top_level.txt +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/pyproject.toml +0 -0
- {paramflow-0.2.6 → paramflow-0.2.7}/setup.cfg +0 -0
|
Binary file
|
|
@@ -8,22 +8,18 @@ from paramflow.convert import convert_type
|
|
|
8
8
|
from paramflow.frozen import freeze, FrozenAttrDict
|
|
9
9
|
from paramflow.parser import PARSER_MAP, EnvParser, ArgsParser, DotEnvParser, Parser
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
ENV_PREFIX: Final[str] = 'P_'
|
|
13
|
-
ARGS_PREFIX: Final[str] = ''
|
|
14
|
-
DEFAULT_PROFILE: Final[str] = 'default'
|
|
15
|
-
PROFILE_KEY: Final[str] = 'profile'
|
|
11
|
+
|
|
16
12
|
ENV_SOURCE: Final[str] = 'env'
|
|
17
13
|
ARGS_SOURCE: Final[str] = 'args'
|
|
18
14
|
|
|
19
15
|
|
|
20
16
|
def load(*sources: Tuple[str, ...],
|
|
21
|
-
meta_env_prefix: str =
|
|
22
|
-
meta_args_prefix: str =
|
|
23
|
-
env_prefix: str =
|
|
24
|
-
args_prefix: str =
|
|
25
|
-
profile_key: str =
|
|
26
|
-
default_profile: str =
|
|
17
|
+
meta_env_prefix: str = 'P_',
|
|
18
|
+
meta_args_prefix: str = '',
|
|
19
|
+
env_prefix: str = 'P_',
|
|
20
|
+
args_prefix: str = '',
|
|
21
|
+
profile_key: str = 'profile',
|
|
22
|
+
default_profile: str = 'default',
|
|
27
23
|
profile: Optional[str] = None) -> FrozenAttrDict[str, any]:
|
|
28
24
|
"""
|
|
29
25
|
Load parameters form multiple sources, layer them on top of each other and activate profile.
|
|
@@ -48,8 +44,8 @@ def load(*sources: Tuple[str, ...],
|
|
|
48
44
|
profile_key: profile,
|
|
49
45
|
'__source__': ['pf.load'],
|
|
50
46
|
}
|
|
51
|
-
meta_env_parser = EnvParser(meta_env_prefix,
|
|
52
|
-
meta_args_parser = ArgsParser(meta_args_prefix,
|
|
47
|
+
meta_env_parser = EnvParser(meta_env_prefix, 'default')
|
|
48
|
+
meta_args_parser = ArgsParser(meta_args_prefix, 'default', no_exit=True, descr='Meta-parameters')
|
|
53
49
|
meta = deep_merge(meta, meta_env_parser(meta))
|
|
54
50
|
meta = deep_merge(meta, meta_args_parser(meta))
|
|
55
51
|
meta = freeze(meta)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/frozen_test.cpython-312-pytest-8.3.4.pyc
RENAMED
|
File without changes
|
{paramflow-0.2.6 → paramflow-0.2.7}/paramflow/__pycache__/params_test.cpython-312-pytest-8.3.4.pyc
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|