fmtr.tools 1.0.27__py3-none-any.whl → 1.0.28__py3-none-any.whl
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/logging_tools.py +9 -5
- fmtr/tools/version +1 -1
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/METADATA +5 -3
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/RECORD +8 -8
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/LICENSE +0 -0
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/WHEEL +0 -0
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/entry_points.txt +0 -0
- {fmtr.tools-1.0.27.dist-info → fmtr.tools-1.0.28.dist-info}/top_level.txt +0 -0
fmtr/tools/logging_tools.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
-
from logfire import ConsoleOptions
|
|
4
3
|
|
|
5
4
|
from fmtr.tools import environment_tools
|
|
6
5
|
from fmtr.tools.config import ToolsConfig
|
|
@@ -13,7 +12,8 @@ ENVIRONMENT_DEFAULT = DEVELOPMENT
|
|
|
13
12
|
LEVEL_DEFAULT = logging.DEBUG if environment_tools.IS_DEBUG else logging.INFO
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, org=ToolsConfig.ORG_NAME,
|
|
15
|
+
def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, key=None, org=ToolsConfig.ORG_NAME,
|
|
16
|
+
stream=STREAM_DEFAULT,
|
|
17
17
|
environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
|
|
18
18
|
"""
|
|
19
19
|
|
|
@@ -30,7 +30,8 @@ def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, org=ToolsConf
|
|
|
30
30
|
|
|
31
31
|
return logger
|
|
32
32
|
|
|
33
|
-
key
|
|
33
|
+
if key is None:
|
|
34
|
+
key = environment_tools.get(ToolsConfig.FMTR_OBS_API_KEY_KEY)
|
|
34
35
|
url = f"https://{host}/api/{org}/v1/traces"
|
|
35
36
|
headers = f"Authorization=Basic {key},stream-name={stream}"
|
|
36
37
|
|
|
@@ -47,7 +48,7 @@ def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, org=ToolsConf
|
|
|
47
48
|
service_version=version,
|
|
48
49
|
environment=environment,
|
|
49
50
|
send_to_logfire=False,
|
|
50
|
-
console=ConsoleOptions(colors='always' if environment_tools.IS_DEBUG else 'auto')
|
|
51
|
+
console=logfire.ConsoleOptions(colors='always' if environment_tools.IS_DEBUG else 'auto')
|
|
51
52
|
)
|
|
52
53
|
|
|
53
54
|
logging.getLogger(name).setLevel(level)
|
|
@@ -58,4 +59,7 @@ def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, org=ToolsConf
|
|
|
58
59
|
|
|
59
60
|
logger = get_logger(name=ToolsConfig.LIBRARY_NAME)
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
if __name__ == '__main__':
|
|
63
|
+
logger.info('Hello World')
|
|
64
|
+
logger.warning('test warning')
|
|
65
|
+
logger.debug('Hello World')
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.28
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.28
|
|
4
4
|
Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
|
|
5
5
|
Home-page: https://github.com/fmtr/fmtr.tools
|
|
6
6
|
Author: Frontmatter
|
|
@@ -15,10 +15,12 @@ Requires-Dist: torchaudio ; extra == 'ai'
|
|
|
15
15
|
Requires-Dist: torchvision ; extra == 'ai'
|
|
16
16
|
Requires-Dist: transformers[sentencepiece] ; extra == 'ai'
|
|
17
17
|
Provides-Extra: ai.client
|
|
18
|
+
Requires-Dist: logfire ; extra == 'ai.client'
|
|
18
19
|
Requires-Dist: ollama ; extra == 'ai.client'
|
|
19
20
|
Requires-Dist: openai ; extra == 'ai.client'
|
|
20
21
|
Requires-Dist: pydantic ; extra == 'ai.client'
|
|
21
|
-
Requires-Dist: pydantic-ai[openai] ; extra == 'ai.client'
|
|
22
|
+
Requires-Dist: pydantic-ai[logfire,openai] ; extra == 'ai.client'
|
|
23
|
+
Requires-Dist: semver ; extra == 'ai.client'
|
|
22
24
|
Provides-Extra: api
|
|
23
25
|
Requires-Dist: fastapi ; extra == 'api'
|
|
24
26
|
Requires-Dist: logfire ; extra == 'api'
|
|
@@ -97,7 +99,7 @@ Requires-Dist: openai ; extra == 'test'
|
|
|
97
99
|
Requires-Dist: pandas ; extra == 'test'
|
|
98
100
|
Requires-Dist: peft ; extra == 'test'
|
|
99
101
|
Requires-Dist: pydantic ; extra == 'test'
|
|
100
|
-
Requires-Dist: pydantic-ai[openai] ; extra == 'test'
|
|
102
|
+
Requires-Dist: pydantic-ai[logfire,openai] ; extra == 'test'
|
|
101
103
|
Requires-Dist: pytest-cov ; extra == 'test'
|
|
102
104
|
Requires-Dist: pyyaml ; extra == 'test'
|
|
103
105
|
Requires-Dist: semver ; extra == 'test'
|
|
@@ -23,7 +23,7 @@ fmtr/tools/interface_tools.py,sha256=fi0KW0veB2NQCmVmCA9iJUL_03gz0MD-gJ4OK-QUBVA
|
|
|
23
23
|
fmtr/tools/iterator_tools.py,sha256=xj5f0c7LgLK53dddRRRJxBoLaBzlZoQS3_GfmpDPMoo,1311
|
|
24
24
|
fmtr/tools/json_fix_tools.py,sha256=vNSlswVQnujPmKEqDjFJcO901mjMyv59q3awsT7mlhs,477
|
|
25
25
|
fmtr/tools/json_tools.py,sha256=IKmrANhcftIz2msCZeItidJ1PcpY_tnbfxbRDnta-c0,349
|
|
26
|
-
fmtr/tools/logging_tools.py,sha256
|
|
26
|
+
fmtr/tools/logging_tools.py,sha256=dqD0F6D0gx1zVR7t8TeHfitB6U4asPhfUMjwhKcuXc4,1882
|
|
27
27
|
fmtr/tools/merging_tools.py,sha256=KDxCEFJEQJEwGw1qGKAgR55uUE2X2S5NWLKcfHRmX_k,227
|
|
28
28
|
fmtr/tools/metric_tools.py,sha256=Lvia5CGFRIfrDFA8s37btIfTU5zHbo04cPJdAMtbndQ,272
|
|
29
29
|
fmtr/tools/name_tools.py,sha256=5CB_phqhHjl66iI8oLxOGPF2odC1apdul-M8Fv2xBhs,5514
|
|
@@ -41,7 +41,7 @@ fmtr/tools/string_tools.py,sha256=w0lw70bgzJ8tAHj_4lMrjtMyefE5kELgpCBgGzGcalo,31
|
|
|
41
41
|
fmtr/tools/tokenization_tools.py,sha256=9FP5vgPufWv0XA961eVKObFll0d_2mM0W3ut3rtZyeo,4329
|
|
42
42
|
fmtr/tools/tools.py,sha256=xnfUrOnrT4OxFYez6vV5tAhydzCICJFiGVnviiZDEQo,796
|
|
43
43
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
44
|
-
fmtr/tools/version,sha256=
|
|
44
|
+
fmtr/tools/version,sha256=Iu_wasRiREN9L8dG_z5ysyPXts7Bf3dsjcHw4OlWOd4,6
|
|
45
45
|
fmtr/tools/version_tools.py,sha256=pHxD425tc5JhGfMjE3-lRLnJOVPpf63Y5FGha5ntiVY,1112
|
|
46
46
|
fmtr/tools/yaml_tools.py,sha256=Ol43ZwbnSXGnn1K98Uxx61KPGSqfC4axE-X2q1LKMwk,349
|
|
47
47
|
fmtr/tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -52,9 +52,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
|
|
|
52
52
|
fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
|
|
53
53
|
fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
|
|
54
54
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
55
|
-
fmtr.tools-1.0.
|
|
56
|
-
fmtr.tools-1.0.
|
|
57
|
-
fmtr.tools-1.0.
|
|
58
|
-
fmtr.tools-1.0.
|
|
59
|
-
fmtr.tools-1.0.
|
|
60
|
-
fmtr.tools-1.0.
|
|
55
|
+
fmtr.tools-1.0.28.dist-info/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
56
|
+
fmtr.tools-1.0.28.dist-info/METADATA,sha256=RKYOO4c1DwGFGHpHh031uBrScwLzhj6hZ02LYyT6slI,13049
|
|
57
|
+
fmtr.tools-1.0.28.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
58
|
+
fmtr.tools-1.0.28.dist-info/entry_points.txt,sha256=CEStVkwJ1mTFvhN1WV5RdW83SkNW1d5Syj-KZ6A19ng,72
|
|
59
|
+
fmtr.tools-1.0.28.dist-info/top_level.txt,sha256=t5341a8ii3n4RFizwTeXGmcq_pf4GqL1h9ylE5LIWRk,12
|
|
60
|
+
fmtr.tools-1.0.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|