-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
44 lines (39 loc) · 1.37 KB
/
Copy path__init__.py
File metadata and controls
44 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Purpose
───────
A stdlib-first toolkit for single-file Python scripts. Provides the common
infrastructure that used to be inlined at the top of every script.
Public API
──────────
ScriptSettings : frozen-dataclass config base with a path cascade
build_parser_from_settings : build an ArgumentParser from a settings class
parse_settings : parse args into a populated settings instance
(precedence: CLI > env var > default)
get_logger / set_log_level : RichLogger when available, stdlib shim otherwise
timestamp : compact UTC timestamps at a chosen granularity
ENV_PREFIX : env-var prefix used by the settings wiring
Notes
─────
Scripts pin a specific version of this package in their PEP 723 header, so a
script written today keeps running against the scriptkit it was born with
even after the library moves on.
"""
from .logging import get_logger, set_log_level
from .settings import (
ENV_PREFIX,
ScriptSettings,
build_parser_from_settings,
parse_settings,
)
from .times import timestamp
__version__ = "1.0.0"
__all__ = [
"ENV_PREFIX",
"ScriptSettings",
"build_parser_from_settings",
"parse_settings",
"get_logger",
"set_log_level",
"timestamp",
"__version__",
]