fmtr.tools 1.3.37__tar.gz → 1.3.38__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.3.37 → fmtr_tools-1.3.38}/PKG-INFO +46 -46
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/ai_tools/agentic_tools.py +2 -3
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/iterator_tools.py +12 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/string_tools.py +60 -6
- fmtr_tools-1.3.38/fmtr/tools/version +1 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/PKG-INFO +46 -46
- fmtr_tools-1.3.37/fmtr/tools/version +0 -1
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/LICENSE +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/README.md +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/ai_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/ai_tools/inference_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/api_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/async_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/augmentation_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/caching_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/constants.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/context_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/data_modelling_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dataclass_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/datatype_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/debugging_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dns_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dns_tools/client.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dns_tools/dm.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dns_tools/proxy.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/dns_tools/server.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/docker_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/cache_hfh.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/ep_test.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/install_yamlscript.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/remote_debug_test.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/entrypoints/shell_debug.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/environment_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/function_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/google_api_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/hash_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/hfh_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/html_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/http_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/import_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/inherit_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/inspection_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/interface_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/interface_tools/controls.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/interface_tools/interface_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/json_fix_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/json_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/logging_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/merging_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/metric_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/name_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/netrc_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/openai_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/packaging_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/parallel_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/path_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/path_tools/app_path_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/path_tools/path_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/path_tools/type_path_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/pattern_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/pdf_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/platform_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/process_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/profiling_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/random_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/semantic_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/settings_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/setup_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/setup_tools/setup_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/spaces_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tabular_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/conftest.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/helpers.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/test_datatype.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/test_environment.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/test_json.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/test_path.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tests/test_yaml.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tokenization_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/unicode_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/version_tools/__init__.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/version_tools/version_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/webhook_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr/tools/yaml_tools.py +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/SOURCES.txt +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/dependency_links.txt +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/entry_points.txt +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/requires.txt +45 -45
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/fmtr.tools.egg-info/top_level.txt +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/pyproject.toml +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/setup.cfg +0 -0
- {fmtr_tools-1.3.37 → fmtr_tools-1.3.38}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.38
|
|
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
|
|
@@ -133,62 +133,62 @@ Requires-Dist: logfire[httpx]; extra == "webhook"
|
|
|
133
133
|
Provides-Extra: browsers
|
|
134
134
|
Requires-Dist: playwright; extra == "browsers"
|
|
135
135
|
Provides-Extra: all
|
|
136
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
137
|
-
Requires-Dist: docker; extra == "all"
|
|
138
|
-
Requires-Dist: filetype; extra == "all"
|
|
139
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
140
|
-
Requires-Dist: logfire[httpx]; extra == "all"
|
|
141
|
-
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
142
136
|
Requires-Dist: json_repair; extra == "all"
|
|
143
|
-
Requires-Dist:
|
|
144
|
-
Requires-Dist:
|
|
137
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
138
|
+
Requires-Dist: pydantic; extra == "all"
|
|
139
|
+
Requires-Dist: appdirs; extra == "all"
|
|
140
|
+
Requires-Dist: httpx; extra == "all"
|
|
141
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
145
142
|
Requires-Dist: peft; extra == "all"
|
|
146
|
-
Requires-Dist:
|
|
143
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
144
|
+
Requires-Dist: diskcache; extra == "all"
|
|
147
145
|
Requires-Dist: google-auth; extra == "all"
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
150
|
-
Requires-Dist:
|
|
151
|
-
Requires-Dist:
|
|
146
|
+
Requires-Dist: cachetools; extra == "all"
|
|
147
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
148
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
149
|
+
Requires-Dist: pandas; extra == "all"
|
|
150
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
151
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
152
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
153
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
154
|
+
Requires-Dist: semver; extra == "all"
|
|
155
|
+
Requires-Dist: faker; extra == "all"
|
|
152
156
|
Requires-Dist: torchvision; extra == "all"
|
|
153
|
-
Requires-Dist:
|
|
154
|
-
Requires-Dist: diskcache; extra == "all"
|
|
157
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
155
158
|
Requires-Dist: openpyxl; extra == "all"
|
|
156
|
-
Requires-Dist:
|
|
157
|
-
Requires-Dist: pymupdf4llm; extra == "all"
|
|
158
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
159
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
160
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
161
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
162
|
-
Requires-Dist: ollama; extra == "all"
|
|
163
|
-
Requires-Dist: httpx; extra == "all"
|
|
164
|
-
Requires-Dist: setuptools; extra == "all"
|
|
165
|
-
Requires-Dist: google-api-python-client; extra == "all"
|
|
166
|
-
Requires-Dist: distributed; extra == "all"
|
|
159
|
+
Requires-Dist: playwright; extra == "all"
|
|
167
160
|
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
168
|
-
Requires-Dist:
|
|
161
|
+
Requires-Dist: setuptools; extra == "all"
|
|
169
162
|
Requires-Dist: yamlscript; extra == "all"
|
|
163
|
+
Requires-Dist: regex; extra == "all"
|
|
164
|
+
Requires-Dist: html2text; extra == "all"
|
|
165
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
166
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
170
167
|
Requires-Dist: pyyaml; extra == "all"
|
|
171
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
172
168
|
Requires-Dist: huggingface_hub; extra == "all"
|
|
173
|
-
Requires-Dist:
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
177
|
-
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
178
|
-
Requires-Dist: flet[all]; extra == "all"
|
|
179
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
180
|
-
Requires-Dist: pandas; extra == "all"
|
|
169
|
+
Requires-Dist: filetype; extra == "all"
|
|
170
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
171
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
172
|
+
Requires-Dist: bokeh; extra == "all"
|
|
181
173
|
Requires-Dist: Unidecode; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
184
|
-
Requires-Dist:
|
|
185
|
-
Requires-Dist:
|
|
186
|
-
Requires-Dist:
|
|
187
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
188
|
-
Requires-Dist: faker; extra == "all"
|
|
174
|
+
Requires-Dist: fastapi; extra == "all"
|
|
175
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
176
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
177
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
178
|
+
Requires-Dist: distributed; extra == "all"
|
|
189
179
|
Requires-Dist: openai; extra == "all"
|
|
190
|
-
Requires-Dist:
|
|
191
|
-
Requires-Dist:
|
|
180
|
+
Requires-Dist: tabulate; extra == "all"
|
|
181
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
182
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
183
|
+
Requires-Dist: flet-video; extra == "all"
|
|
184
|
+
Requires-Dist: ollama; extra == "all"
|
|
185
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
186
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
187
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
188
|
+
Requires-Dist: docker; extra == "all"
|
|
189
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
190
|
+
Requires-Dist: logfire; extra == "all"
|
|
191
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
192
192
|
Dynamic: author
|
|
193
193
|
Dynamic: author-email
|
|
194
194
|
Dynamic: description
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
from typing import List, Optional, Any, Annotated
|
|
2
|
-
|
|
3
1
|
import pydantic_ai
|
|
4
2
|
from pydantic import PlainValidator
|
|
5
3
|
from pydantic_ai import RunContext, ModelRetry
|
|
6
4
|
from pydantic_ai.agent import AgentRunResult, Agent
|
|
7
5
|
from pydantic_ai.models.openai import OpenAIModel
|
|
8
6
|
from pydantic_ai.providers.openai import OpenAIProvider
|
|
7
|
+
from typing import List, Optional, Any, Annotated
|
|
9
8
|
|
|
10
9
|
from fmtr.tools import environment_tools as env
|
|
11
10
|
from fmtr.tools.constants import Constants
|
|
@@ -153,7 +152,7 @@ def default_prompt_none_specified(text):
|
|
|
153
152
|
return text
|
|
154
153
|
|
|
155
154
|
|
|
156
|
-
StringDefaultNoneSpecified = Annotated[str, PlainValidator(default_prompt_none_specified)]
|
|
155
|
+
StringDefaultNoneSpecified = Annotated[Optional[str], PlainValidator(default_prompt_none_specified)]
|
|
157
156
|
|
|
158
157
|
|
|
159
158
|
if __name__ == '__main__':
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from itertools import chain, batched
|
|
2
|
+
|
|
2
3
|
from typing import List, Dict, Any
|
|
3
4
|
|
|
5
|
+
from fmtr.tools.datatype_tools import is_none
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
def enlist(value) -> List[Any]:
|
|
6
9
|
"""
|
|
@@ -52,3 +55,12 @@ def rebatch(batches, size: int):
|
|
|
52
55
|
|
|
53
56
|
"""
|
|
54
57
|
return batched(chain.from_iterable(batches), size)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def strip_none(*items):
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
Remove nones from a list of arguments
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
return [item for item in items if not is_none(item)]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from collections import namedtuple
|
|
2
|
+
from string import Formatter
|
|
2
3
|
|
|
3
4
|
import re
|
|
4
|
-
from
|
|
5
|
+
from dataclasses import dataclass
|
|
5
6
|
from textwrap import dedent
|
|
6
7
|
from typing import List
|
|
7
8
|
|
|
@@ -84,17 +85,70 @@ def sanitize(*strings, sep: str = '-') -> str:
|
|
|
84
85
|
return string
|
|
85
86
|
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
@dataclass
|
|
89
|
+
class Truncation:
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
Result type for truncation functions
|
|
93
|
+
|
|
94
|
+
"""
|
|
95
|
+
text: str
|
|
96
|
+
text_without_sep: str | None
|
|
97
|
+
original: str
|
|
98
|
+
remainder: str | None
|
|
99
|
+
sep: str
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def truncate(text, length=None, sep=ELLIPSIS, return_type=str):
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
Truncate a string to length characters
|
|
106
|
+
|
|
88
107
|
"""
|
|
108
|
+
text = flatten(text)
|
|
109
|
+
if len(text) <= length or not length:
|
|
110
|
+
return text if return_type is str else Truncation(text, text, text, None, sep)
|
|
111
|
+
|
|
112
|
+
cutoff = length - len(sep)
|
|
113
|
+
truncated = text[:cutoff] + sep
|
|
114
|
+
|
|
115
|
+
if return_type is str:
|
|
116
|
+
return truncated
|
|
117
|
+
else:
|
|
118
|
+
return Truncation(
|
|
119
|
+
text=truncated,
|
|
120
|
+
text_without_sep=text[:cutoff],
|
|
121
|
+
original=text,
|
|
122
|
+
remainder=text[cutoff:] or None,
|
|
123
|
+
sep=sep
|
|
124
|
+
)
|
|
89
125
|
|
|
90
|
-
|
|
126
|
+
|
|
127
|
+
def truncate_mid(text, length=None, sep=ELLIPSIS, return_type=str):
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
Truncate a string to `length` characters in the middle.
|
|
91
131
|
|
|
92
132
|
"""
|
|
93
133
|
text = flatten(text)
|
|
94
134
|
if len(text) <= length or not length:
|
|
95
|
-
return text
|
|
96
|
-
|
|
97
|
-
|
|
135
|
+
return text if return_type is str else Truncation(text, text, text, '', sep)
|
|
136
|
+
|
|
137
|
+
half = (length - len(sep)) // 2
|
|
138
|
+
left = text[:half]
|
|
139
|
+
right = text[-half:]
|
|
140
|
+
truncated = left + sep + right
|
|
141
|
+
|
|
142
|
+
if return_type is str:
|
|
143
|
+
return truncated
|
|
144
|
+
else:
|
|
145
|
+
return Truncation(
|
|
146
|
+
text=truncated,
|
|
147
|
+
text_without_sep=None,
|
|
148
|
+
original=text,
|
|
149
|
+
remainder=None,
|
|
150
|
+
sep=sep
|
|
151
|
+
)
|
|
98
152
|
|
|
99
153
|
|
|
100
154
|
def flatten(raw):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.3.38
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.38
|
|
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
|
|
@@ -133,62 +133,62 @@ Requires-Dist: logfire[httpx]; extra == "webhook"
|
|
|
133
133
|
Provides-Extra: browsers
|
|
134
134
|
Requires-Dist: playwright; extra == "browsers"
|
|
135
135
|
Provides-Extra: all
|
|
136
|
-
Requires-Dist: tokenizers; extra == "all"
|
|
137
|
-
Requires-Dist: docker; extra == "all"
|
|
138
|
-
Requires-Dist: filetype; extra == "all"
|
|
139
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
140
|
-
Requires-Dist: logfire[httpx]; extra == "all"
|
|
141
|
-
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
142
136
|
Requires-Dist: json_repair; extra == "all"
|
|
143
|
-
Requires-Dist:
|
|
144
|
-
Requires-Dist:
|
|
137
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
138
|
+
Requires-Dist: pydantic; extra == "all"
|
|
139
|
+
Requires-Dist: appdirs; extra == "all"
|
|
140
|
+
Requires-Dist: httpx; extra == "all"
|
|
141
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
145
142
|
Requires-Dist: peft; extra == "all"
|
|
146
|
-
Requires-Dist:
|
|
143
|
+
Requires-Dist: flet-webview; extra == "all"
|
|
144
|
+
Requires-Dist: diskcache; extra == "all"
|
|
147
145
|
Requires-Dist: google-auth; extra == "all"
|
|
148
|
-
Requires-Dist:
|
|
149
|
-
Requires-Dist:
|
|
150
|
-
Requires-Dist:
|
|
151
|
-
Requires-Dist:
|
|
146
|
+
Requires-Dist: cachetools; extra == "all"
|
|
147
|
+
Requires-Dist: google-api-python-client; extra == "all"
|
|
148
|
+
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
149
|
+
Requires-Dist: pandas; extra == "all"
|
|
150
|
+
Requires-Dist: pydantic-settings; extra == "all"
|
|
151
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
152
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
153
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
154
|
+
Requires-Dist: semver; extra == "all"
|
|
155
|
+
Requires-Dist: faker; extra == "all"
|
|
152
156
|
Requires-Dist: torchvision; extra == "all"
|
|
153
|
-
Requires-Dist:
|
|
154
|
-
Requires-Dist: diskcache; extra == "all"
|
|
157
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
155
158
|
Requires-Dist: openpyxl; extra == "all"
|
|
156
|
-
Requires-Dist:
|
|
157
|
-
Requires-Dist: pymupdf4llm; extra == "all"
|
|
158
|
-
Requires-Dist: dnspython[doh]; extra == "all"
|
|
159
|
-
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
160
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
161
|
-
Requires-Dist: pydantic-settings; extra == "all"
|
|
162
|
-
Requires-Dist: ollama; extra == "all"
|
|
163
|
-
Requires-Dist: httpx; extra == "all"
|
|
164
|
-
Requires-Dist: setuptools; extra == "all"
|
|
165
|
-
Requires-Dist: google-api-python-client; extra == "all"
|
|
166
|
-
Requires-Dist: distributed; extra == "all"
|
|
159
|
+
Requires-Dist: playwright; extra == "all"
|
|
167
160
|
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
168
|
-
Requires-Dist:
|
|
161
|
+
Requires-Dist: setuptools; extra == "all"
|
|
169
162
|
Requires-Dist: yamlscript; extra == "all"
|
|
163
|
+
Requires-Dist: regex; extra == "all"
|
|
164
|
+
Requires-Dist: html2text; extra == "all"
|
|
165
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
166
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
170
167
|
Requires-Dist: pyyaml; extra == "all"
|
|
171
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
172
168
|
Requires-Dist: huggingface_hub; extra == "all"
|
|
173
|
-
Requires-Dist:
|
|
174
|
-
Requires-Dist:
|
|
175
|
-
Requires-Dist:
|
|
176
|
-
Requires-Dist:
|
|
177
|
-
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
178
|
-
Requires-Dist: flet[all]; extra == "all"
|
|
179
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
180
|
-
Requires-Dist: pandas; extra == "all"
|
|
169
|
+
Requires-Dist: filetype; extra == "all"
|
|
170
|
+
Requires-Dist: deepmerge; extra == "all"
|
|
171
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
172
|
+
Requires-Dist: bokeh; extra == "all"
|
|
181
173
|
Requires-Dist: Unidecode; extra == "all"
|
|
182
|
-
Requires-Dist:
|
|
183
|
-
Requires-Dist:
|
|
184
|
-
Requires-Dist:
|
|
185
|
-
Requires-Dist:
|
|
186
|
-
Requires-Dist:
|
|
187
|
-
Requires-Dist: contexttimer; extra == "all"
|
|
188
|
-
Requires-Dist: faker; extra == "all"
|
|
174
|
+
Requires-Dist: fastapi; extra == "all"
|
|
175
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
176
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
177
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
178
|
+
Requires-Dist: distributed; extra == "all"
|
|
189
179
|
Requires-Dist: openai; extra == "all"
|
|
190
|
-
Requires-Dist:
|
|
191
|
-
Requires-Dist:
|
|
180
|
+
Requires-Dist: tabulate; extra == "all"
|
|
181
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
182
|
+
Requires-Dist: torchaudio; extra == "all"
|
|
183
|
+
Requires-Dist: flet-video; extra == "all"
|
|
184
|
+
Requires-Dist: ollama; extra == "all"
|
|
185
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
186
|
+
Requires-Dist: logfire[httpx]; extra == "all"
|
|
187
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
188
|
+
Requires-Dist: docker; extra == "all"
|
|
189
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
190
|
+
Requires-Dist: logfire; extra == "all"
|
|
191
|
+
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
192
192
|
Dynamic: author
|
|
193
193
|
Dynamic: author-email
|
|
194
194
|
Dynamic: description
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.3.37
|
|
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
|
|
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
|
|
@@ -14,62 +14,62 @@ pydantic-ai[logfire,openai]
|
|
|
14
14
|
ollama
|
|
15
15
|
|
|
16
16
|
[all]
|
|
17
|
-
tokenizers
|
|
18
|
-
docker
|
|
19
|
-
filetype
|
|
20
|
-
pymupdf
|
|
21
|
-
logfire[httpx]
|
|
22
|
-
logfire[fastapi]
|
|
23
17
|
json_repair
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
pytest-cov
|
|
19
|
+
pydantic
|
|
20
|
+
appdirs
|
|
21
|
+
httpx
|
|
22
|
+
contexttimer
|
|
26
23
|
peft
|
|
27
|
-
|
|
24
|
+
flet-webview
|
|
25
|
+
diskcache
|
|
28
26
|
google-auth
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
cachetools
|
|
28
|
+
google-api-python-client
|
|
29
|
+
uvicorn[standard]
|
|
30
|
+
pandas
|
|
31
|
+
pydantic-settings
|
|
32
|
+
sre_yield
|
|
33
|
+
tokenizers
|
|
34
|
+
dask[bag]
|
|
35
|
+
semver
|
|
36
|
+
faker
|
|
33
37
|
torchvision
|
|
34
|
-
|
|
35
|
-
diskcache
|
|
38
|
+
google-auth-oauthlib
|
|
36
39
|
openpyxl
|
|
37
|
-
|
|
38
|
-
pymupdf4llm
|
|
39
|
-
dnspython[doh]
|
|
40
|
-
pydantic-ai[logfire,openai]
|
|
41
|
-
sentence_transformers
|
|
42
|
-
pydantic-settings
|
|
43
|
-
ollama
|
|
44
|
-
httpx
|
|
45
|
-
setuptools
|
|
46
|
-
google-api-python-client
|
|
47
|
-
distributed
|
|
40
|
+
playwright
|
|
48
41
|
google-auth-httplib2
|
|
49
|
-
|
|
42
|
+
setuptools
|
|
50
43
|
yamlscript
|
|
44
|
+
regex
|
|
45
|
+
html2text
|
|
46
|
+
pydevd-pycharm~=251.25410.159
|
|
47
|
+
logfire[fastapi]
|
|
51
48
|
pyyaml
|
|
52
|
-
httpx_retries
|
|
53
49
|
huggingface_hub
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
uvicorn[standard]
|
|
59
|
-
flet[all]
|
|
60
|
-
pytest-cov
|
|
61
|
-
pandas
|
|
50
|
+
filetype
|
|
51
|
+
deepmerge
|
|
52
|
+
transformers[sentencepiece]
|
|
53
|
+
bokeh
|
|
62
54
|
Unidecode
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
contexttimer
|
|
69
|
-
faker
|
|
55
|
+
fastapi
|
|
56
|
+
tinynetrc
|
|
57
|
+
flet[all]
|
|
58
|
+
pymupdf4llm
|
|
59
|
+
distributed
|
|
70
60
|
openai
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
tabulate
|
|
62
|
+
dnspython[doh]
|
|
63
|
+
torchaudio
|
|
64
|
+
flet-video
|
|
65
|
+
ollama
|
|
66
|
+
httpx_retries
|
|
67
|
+
logfire[httpx]
|
|
68
|
+
pymupdf
|
|
69
|
+
docker
|
|
70
|
+
sentence_transformers
|
|
71
|
+
logfire
|
|
72
|
+
pydantic-ai[logfire,openai]
|
|
73
73
|
|
|
74
74
|
[api]
|
|
75
75
|
fastapi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|