fmtr.tools 1.0.26__tar.gz → 1.0.28__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.

Files changed (66) hide show
  1. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/PKG-INFO +1 -1
  2. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/config.py +4 -1
  3. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/logging_tools.py +17 -11
  4. fmtr.tools-1.0.28/fmtr/tools/version +1 -0
  5. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/PKG-INFO +1 -1
  6. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/requires.txt +7 -2
  7. fmtr.tools-1.0.26/fmtr/tools/version +0 -1
  8. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/LICENSE +0 -0
  9. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/README.md +0 -0
  10. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/__init__.py +0 -0
  11. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/ai_tools.py +0 -0
  12. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/api_tools.py +0 -0
  13. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/async_tools.py +0 -0
  14. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/augmentation_tools.py +0 -0
  15. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/caching_tools.py +0 -0
  16. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/config_tools.py +0 -0
  17. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/console_script_tools.py +0 -0
  18. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/data_modelling_tools.py +0 -0
  19. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/dataclass_tools.py +0 -0
  20. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/datatype_tools.py +0 -0
  21. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/docker_tools.py +0 -0
  22. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/environment_tools.py +0 -0
  23. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/function_tools.py +0 -0
  24. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/google_api_tools.py +0 -0
  25. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/hash_tools.py +0 -0
  26. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/hfh_tools.py +0 -0
  27. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/html_tools.py +0 -0
  28. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/import_tools.py +0 -0
  29. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/inspection_tools.py +0 -0
  30. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/interface_tools.py +0 -0
  31. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/iterator_tools.py +0 -0
  32. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/json_fix_tools.py +0 -0
  33. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/json_tools.py +0 -0
  34. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/merging_tools.py +0 -0
  35. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/metric_tools.py +0 -0
  36. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/name_tools.py +0 -0
  37. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/netrc_tools.py +0 -0
  38. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/openai_tools.py +0 -0
  39. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/parallel_tools.py +0 -0
  40. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/path_tools.py +0 -0
  41. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/platform_tools.py +0 -0
  42. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/process_tools.py +0 -0
  43. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/profiling_tools.py +0 -0
  44. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/random_tools.py +0 -0
  45. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/semantic_tools.py +0 -0
  46. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/spaces_tools.py +0 -0
  47. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/string_tools.py +0 -0
  48. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/__init__.py +0 -0
  49. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/conftest.py +0 -0
  50. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/helpers.py +0 -0
  51. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/test_datatype.py +0 -0
  52. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/test_environment.py +0 -0
  53. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/test_json.py +0 -0
  54. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/test_path.py +0 -0
  55. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tests/test_yaml.py +0 -0
  56. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tokenization_tools.py +0 -0
  57. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/tools.py +0 -0
  58. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/unicode_tools.py +0 -0
  59. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/version_tools.py +0 -0
  60. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr/tools/yaml_tools.py +0 -0
  61. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/SOURCES.txt +0 -0
  62. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/dependency_links.txt +0 -0
  63. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/entry_points.txt +0 -0
  64. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/fmtr.tools.egg-info/top_level.txt +0 -0
  65. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/setup.cfg +0 -0
  66. {fmtr.tools-1.0.26 → fmtr.tools-1.0.28}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fmtr.tools
3
- Version: 1.0.26
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
@@ -5,7 +5,8 @@ from fmtr.tools.config_tools import ConfigClass
5
5
 
6
6
  class ToolsConfig(ConfigClass):
7
7
  ENCODING = 'UTF-8'
8
- LIBRARY_NAME = 'fmtr.tools'
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'
@@ -1,20 +1,19 @@
1
1
  import logging
2
2
  import os
3
- from logfire import ConsoleOptions
4
3
 
5
4
  from fmtr.tools import environment_tools
5
+ from fmtr.tools.config import ToolsConfig
6
6
 
7
7
  DEVELOPMENT = "development"
8
8
  PRODUCTION = "production"
9
- HOST_DEFAULT = "log.sv.fmtr.dev"
10
- ORG_DEFAULT = "fmtr"
11
9
  STREAM_DEFAULT = DEVELOPMENT
12
10
  ENVIRONMENT_DEFAULT = DEVELOPMENT
13
11
 
14
12
  LEVEL_DEFAULT = logging.DEBUG if environment_tools.IS_DEBUG else logging.INFO
15
13
 
16
14
 
17
- def get_logger(name, version, host=HOST_DEFAULT, org=ORG_DEFAULT, stream=STREAM_DEFAULT,
15
+ def get_logger(name, version=None, host=ToolsConfig.FMTR_OBS_HOST, key=None, org=ToolsConfig.ORG_NAME,
16
+ stream=STREAM_DEFAULT,
18
17
  environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
19
18
  """
20
19
 
@@ -31,21 +30,25 @@ 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("FMTR_OBS_API_KEY")
35
- traces_endpoint = f"https://{host}/api/{org}/v1/traces"
33
+ if key is None:
34
+ key = environment_tools.get(ToolsConfig.FMTR_OBS_API_KEY_KEY)
35
+ url = f"https://{host}/api/{org}/v1/traces"
36
36
  headers = f"Authorization=Basic {key},stream-name={stream}"
37
37
 
38
- os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = traces_endpoint
38
+ os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = url
39
39
  os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = headers
40
40
  os.environ["OTEL_EXPORTER_OTLP_INSECURE"] = str(False).lower()
41
41
 
42
+ if not version:
43
+ from fmtr.tools import version_tools
44
+ version = version_tools.read()
45
+
42
46
  logfire.configure(
43
47
  service_name=name,
44
48
  service_version=version,
45
49
  environment=environment,
46
50
  send_to_logfire=False,
47
- console=ConsoleOptions(colors='always' if environment_tools.IS_DEBUG else 'auto')
48
-
51
+ console=logfire.ConsoleOptions(colors='always' if environment_tools.IS_DEBUG else 'auto')
49
52
  )
50
53
 
51
54
  logging.getLogger(name).setLevel(level)
@@ -54,6 +57,9 @@ def get_logger(name, version, host=HOST_DEFAULT, org=ORG_DEFAULT, stream=STREAM_
54
57
  return logger
55
58
 
56
59
 
57
- logger = get_logger(name='fmtr.tools', version='0.0.0')
60
+ logger = get_logger(name=ToolsConfig.LIBRARY_NAME)
58
61
 
59
- logger = get_logger()
62
+ if __name__ == '__main__':
63
+ logger.info('Hello World')
64
+ logger.warning('test warning')
65
+ logger.debug('Hello World')
@@ -0,0 +1 @@
1
+ 1.0.28
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fmtr.tools
3
- Version: 1.0.26
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
@@ -7,15 +7,18 @@ torchvision
7
7
  transformers[sentencepiece]
8
8
 
9
9
  [ai.client]
10
+ logfire
10
11
  ollama
11
12
  openai
12
13
  pydantic
13
- pydantic-ai[openai]
14
+ pydantic-ai[logfire,openai]
15
+ semver
14
16
 
15
17
  [api]
16
18
  fastapi
17
19
  logfire
18
20
  pydantic
21
+ semver
19
22
  uvicorn
20
23
 
21
24
  [augmentation]
@@ -52,6 +55,7 @@ json_repair
52
55
 
53
56
  [logging]
54
57
  logfire
58
+ semver
55
59
 
56
60
  [merging]
57
61
  deepmerge
@@ -72,6 +76,7 @@ distributed
72
76
 
73
77
  [process]
74
78
  logfire
79
+ semver
75
80
 
76
81
  [profiling]
77
82
  contexttimer
@@ -107,7 +112,7 @@ openai
107
112
  pandas
108
113
  peft
109
114
  pydantic
110
- pydantic-ai[openai]
115
+ pydantic-ai[logfire,openai]
111
116
  pytest-cov
112
117
  pyyaml
113
118
  semver
@@ -1 +0,0 @@
1
- 1.0.26
File without changes
File without changes
File without changes
File without changes