fmtr.tools 1.0.26__tar.gz → 1.0.27__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.
Potentially problematic release.
This version of fmtr.tools might be problematic. Click here for more details.
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/PKG-INFO +1 -1
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/config.py +4 -1
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/logging_tools.py +10 -8
- fmtr.tools-1.0.27/fmtr/tools/version +1 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/PKG-INFO +1 -1
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/requires.txt +3 -0
- fmtr.tools-1.0.26/fmtr/tools/version +0 -1
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/LICENSE +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/README.md +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/__init__.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/ai_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/api_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/async_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/caching_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/config_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/console_script_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/data_modelling_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/datatype_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/docker_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/environment_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/function_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/hash_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/html_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/import_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/interface_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/iterator_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/json_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/merging_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/metric_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/name_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/openai_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/path_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/platform_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/process_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/random_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/string_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/version_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/setup.cfg +0 -0
- {fmtr.tools-1.0.26 → fmtr.tools-1.0.27}/setup.py +0 -0
|
@@ -5,7 +5,8 @@ from fmtr.tools.config_tools import ConfigClass
|
|
|
5
5
|
|
|
6
6
|
class ToolsConfig(ConfigClass):
|
|
7
7
|
ENCODING = 'UTF-8'
|
|
8
|
-
|
|
8
|
+
ORG_NAME = 'fmtr'
|
|
9
|
+
LIBRARY_NAME = f'{ORG_NAME}.tools'
|
|
9
10
|
DATE_FILENAME_FORMAT = '%Y-%m-%d'
|
|
10
11
|
TIME_FILENAME_FORMAT = '%H-%M-%S'
|
|
11
12
|
|
|
@@ -16,3 +17,5 @@ class ToolsConfig(ConfigClass):
|
|
|
16
17
|
SERIALIZATION_INDENT = 4
|
|
17
18
|
|
|
18
19
|
FMTR_LOG_LEVEL_KEY = 'FMTR_LOG_LEVEL'
|
|
20
|
+
FMTR_OBS_API_KEY_KEY = 'FMTR_OBS_API_KEY'
|
|
21
|
+
FMTR_OBS_HOST = 'log.sv.fmtr.dev'
|
|
@@ -3,18 +3,17 @@ import os
|
|
|
3
3
|
from logfire import ConsoleOptions
|
|
4
4
|
|
|
5
5
|
from fmtr.tools import environment_tools
|
|
6
|
+
from fmtr.tools.config import ToolsConfig
|
|
6
7
|
|
|
7
8
|
DEVELOPMENT = "development"
|
|
8
9
|
PRODUCTION = "production"
|
|
9
|
-
HOST_DEFAULT = "log.sv.fmtr.dev"
|
|
10
|
-
ORG_DEFAULT = "fmtr"
|
|
11
10
|
STREAM_DEFAULT = DEVELOPMENT
|
|
12
11
|
ENVIRONMENT_DEFAULT = DEVELOPMENT
|
|
13
12
|
|
|
14
13
|
LEVEL_DEFAULT = logging.DEBUG if environment_tools.IS_DEBUG else logging.INFO
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
def get_logger(name, version, host=
|
|
16
|
+
def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, org=ToolsConfig.ORG_NAME, stream=STREAM_DEFAULT,
|
|
18
17
|
environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
|
|
19
18
|
"""
|
|
20
19
|
|
|
@@ -31,21 +30,24 @@ def get_logger(name, version, host=HOST_DEFAULT, org=ORG_DEFAULT, stream=STREAM_
|
|
|
31
30
|
|
|
32
31
|
return logger
|
|
33
32
|
|
|
34
|
-
key = environment_tools.get(
|
|
35
|
-
|
|
33
|
+
key = environment_tools.get(ToolsConfig.FMTR_OBS_API_KEY_KEY)
|
|
34
|
+
url = f"https://{host}/api/{org}/v1/traces"
|
|
36
35
|
headers = f"Authorization=Basic {key},stream-name={stream}"
|
|
37
36
|
|
|
38
|
-
os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] =
|
|
37
|
+
os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = url
|
|
39
38
|
os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = headers
|
|
40
39
|
os.environ["OTEL_EXPORTER_OTLP_INSECURE"] = str(False).lower()
|
|
41
40
|
|
|
41
|
+
if not version:
|
|
42
|
+
from fmtr.tools import version_tools
|
|
43
|
+
version = version_tools.read()
|
|
44
|
+
|
|
42
45
|
logfire.configure(
|
|
43
46
|
service_name=name,
|
|
44
47
|
service_version=version,
|
|
45
48
|
environment=environment,
|
|
46
49
|
send_to_logfire=False,
|
|
47
50
|
console=ConsoleOptions(colors='always' if environment_tools.IS_DEBUG else 'auto')
|
|
48
|
-
|
|
49
51
|
)
|
|
50
52
|
|
|
51
53
|
logging.getLogger(name).setLevel(level)
|
|
@@ -54,6 +56,6 @@ def get_logger(name, version, host=HOST_DEFAULT, org=ORG_DEFAULT, stream=STREAM_
|
|
|
54
56
|
return logger
|
|
55
57
|
|
|
56
58
|
|
|
57
|
-
logger = get_logger(name=
|
|
59
|
+
logger = get_logger(name=ToolsConfig.LIBRARY_NAME)
|
|
58
60
|
|
|
59
61
|
logger = get_logger()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.27
|
|
@@ -16,6 +16,7 @@ pydantic-ai[openai]
|
|
|
16
16
|
fastapi
|
|
17
17
|
logfire
|
|
18
18
|
pydantic
|
|
19
|
+
semver
|
|
19
20
|
uvicorn
|
|
20
21
|
|
|
21
22
|
[augmentation]
|
|
@@ -52,6 +53,7 @@ json_repair
|
|
|
52
53
|
|
|
53
54
|
[logging]
|
|
54
55
|
logfire
|
|
56
|
+
semver
|
|
55
57
|
|
|
56
58
|
[merging]
|
|
57
59
|
deepmerge
|
|
@@ -72,6 +74,7 @@ distributed
|
|
|
72
74
|
|
|
73
75
|
[process]
|
|
74
76
|
logfire
|
|
77
|
+
semver
|
|
75
78
|
|
|
76
79
|
[profiling]
|
|
77
80
|
contexttimer
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.26
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|