toprompt 0.2.2__tar.gz → 0.3.0__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.
Files changed (30) hide show
  1. {toprompt-0.2.2 → toprompt-0.3.0}/PKG-INFO +33 -36
  2. {toprompt-0.2.2 → toprompt-0.3.0}/README.md +0 -6
  3. toprompt-0.3.0/pyproject.toml +267 -0
  4. toprompt-0.3.0/src/toprompt/__init__.py +36 -0
  5. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/cli_types.py +165 -165
  6. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/dataclass_types.py +27 -30
  7. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/fastapi_types.py +75 -75
  8. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/llmling_types.py +29 -29
  9. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/sqlite_types.py +246 -241
  10. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/sqlmodel_types.py +56 -59
  11. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/to_prompt.py +230 -233
  12. toprompt-0.2.2/.copier-answers.yml +0 -21
  13. toprompt-0.2.2/.github/FUNDING.yml +0 -3
  14. toprompt-0.2.2/.github/copilot-instructions.md +0 -19
  15. toprompt-0.2.2/.github/dependabot.yml +0 -9
  16. toprompt-0.2.2/.github/workflows/build.yml +0 -88
  17. toprompt-0.2.2/.github/workflows/documentation.yml +0 -57
  18. toprompt-0.2.2/.gitignore +0 -32
  19. toprompt-0.2.2/.pre-commit-config.yaml +0 -48
  20. toprompt-0.2.2/docs/.empty +0 -0
  21. toprompt-0.2.2/duties.py +0 -60
  22. toprompt-0.2.2/mkdocs.yml +0 -92
  23. toprompt-0.2.2/overrides/_dummy.txt +0 -1
  24. toprompt-0.2.2/pyproject.toml +0 -251
  25. toprompt-0.2.2/src/toprompt/__init__.py +0 -19
  26. toprompt-0.2.2/tests/__init__.py +0 -3
  27. toprompt-0.2.2/tests/conftest.py +0 -1
  28. toprompt-0.2.2/tests/test_toprompt.py +0 -102
  29. {toprompt-0.2.2 → toprompt-0.3.0}/LICENSE +0 -0
  30. {toprompt-0.2.2 → toprompt-0.3.0}/src/toprompt/py.typed +0 -0
@@ -1,37 +1,35 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: toprompt
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Convert python objects to LLM-friendly descriptions
5
- Project-URL: Documentation, https://phil65.github.io/toprompt/
6
- Project-URL: Source, https://github.com/phil65/toprompt
7
- Project-URL: Issues, https://github.com/phil65/toprompt/issues
8
- Project-URL: Discussions, https://github.com/phil65/toprompt/discussions
9
- Project-URL: Code coverage, https://app.codecov.io/gh/phil65/toprompt
5
+ Keywords:
6
+ Author: Philipp Temminghoff
10
7
  Author-email: Philipp Temminghoff <philipptemminghoff@googlemail.com>
11
8
  License: MIT License
12
-
13
- Copyright (c) 2024, Philipp Temminghoff
14
-
15
- Permission is hereby granted, free of charge, to any person obtaining a copy
16
- of this software and associated documentation files (the "Software"), to deal
17
- in the Software without restriction, including without limitation the rights
18
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
- copies of the Software, and to permit persons to whom the Software is
20
- furnished to do so, subject to the following conditions:
21
-
22
- The above copyright notice and this permission notice shall be included in all
23
- copies or substantial portions of the Software.
24
-
25
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- SOFTWARE.
32
-
33
- License-File: LICENSE
9
+
10
+ Copyright (c) 2024, Philipp Temminghoff
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
34
30
  Classifier: Development Status :: 4 - Beta
31
+ Classifier: Framework :: Pydantic
32
+ Classifier: Framework :: Pydantic :: 2
35
33
  Classifier: Intended Audience :: Developers
36
34
  Classifier: Operating System :: OS Independent
37
35
  Classifier: Programming Language :: Python :: 3
@@ -43,20 +41,23 @@ Classifier: Topic :: Documentation
43
41
  Classifier: Topic :: Software Development
44
42
  Classifier: Topic :: Utilities
45
43
  Classifier: Typing :: Typed
46
- Requires-Python: >=3.12
47
44
  Requires-Dist: clinspector>=0.2.0
48
45
  Requires-Dist: fieldz>=0.1.0
49
46
  Requires-Dist: jinjarope>=0.16.0
50
47
  Requires-Dist: pydantic
51
48
  Requires-Dist: sqlmodel>=0.0.22
49
+ Requires-Python: >=3.12
50
+ Project-URL: Code coverage, https://app.codecov.io/gh/phil65/toprompt
51
+ Project-URL: Discussions, https://github.com/phil65/toprompt/discussions
52
+ Project-URL: Documentation, https://phil65.github.io/toprompt/
53
+ Project-URL: Issues, https://github.com/phil65/toprompt/issues
54
+ Project-URL: Source, https://github.com/phil65/toprompt
52
55
  Description-Content-Type: text/markdown
53
56
 
54
57
  # ToPrompt
55
58
 
56
59
  [![PyPI License](https://img.shields.io/pypi/l/toprompt.svg)](https://pypi.org/project/toprompt/)
57
60
  [![Package status](https://img.shields.io/pypi/status/toprompt.svg)](https://pypi.org/project/toprompt/)
58
- [![Daily downloads](https://img.shields.io/pypi/dd/toprompt.svg)](https://pypi.org/project/toprompt/)
59
- [![Weekly downloads](https://img.shields.io/pypi/dw/toprompt.svg)](https://pypi.org/project/toprompt/)
60
61
  [![Monthly downloads](https://img.shields.io/pypi/dm/toprompt.svg)](https://pypi.org/project/toprompt/)
61
62
  [![Distribution format](https://img.shields.io/pypi/format/toprompt.svg)](https://pypi.org/project/toprompt/)
62
63
  [![Wheel availability](https://img.shields.io/pypi/wheel/toprompt.svg)](https://pypi.org/project/toprompt/)
@@ -74,12 +75,8 @@ Description-Content-Type: text/markdown
74
75
  [![Github last commit](https://img.shields.io/github/last-commit/phil65/toprompt)](https://github.com/phil65/toprompt/commits)
75
76
  [![Github release date](https://img.shields.io/github/release-date/phil65/toprompt)](https://github.com/phil65/toprompt/releases)
76
77
  [![Github language count](https://img.shields.io/github/languages/count/phil65/toprompt)](https://github.com/phil65/toprompt)
77
- [![Github commits this week](https://img.shields.io/github/commit-activity/w/phil65/toprompt)](https://github.com/phil65/toprompt)
78
78
  [![Github commits this month](https://img.shields.io/github/commit-activity/m/phil65/toprompt)](https://github.com/phil65/toprompt)
79
- [![Github commits this year](https://img.shields.io/github/commit-activity/y/phil65/toprompt)](https://github.com/phil65/toprompt)
80
79
  [![Package status](https://codecov.io/gh/phil65/toprompt/branch/main/graph/badge.svg)](https://codecov.io/gh/phil65/toprompt/)
81
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
82
80
  [![PyUp](https://pyup.io/repos/github/phil65/toprompt/shield.svg)](https://pyup.io/repos/github/phil65/toprompt/)
83
81
 
84
82
  [Read the documentation!](https://phil65.github.io/toprompt/)
85
-
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![PyPI License](https://img.shields.io/pypi/l/toprompt.svg)](https://pypi.org/project/toprompt/)
4
4
  [![Package status](https://img.shields.io/pypi/status/toprompt.svg)](https://pypi.org/project/toprompt/)
5
- [![Daily downloads](https://img.shields.io/pypi/dd/toprompt.svg)](https://pypi.org/project/toprompt/)
6
- [![Weekly downloads](https://img.shields.io/pypi/dw/toprompt.svg)](https://pypi.org/project/toprompt/)
7
5
  [![Monthly downloads](https://img.shields.io/pypi/dm/toprompt.svg)](https://pypi.org/project/toprompt/)
8
6
  [![Distribution format](https://img.shields.io/pypi/format/toprompt.svg)](https://pypi.org/project/toprompt/)
9
7
  [![Wheel availability](https://img.shields.io/pypi/wheel/toprompt.svg)](https://pypi.org/project/toprompt/)
@@ -21,12 +19,8 @@
21
19
  [![Github last commit](https://img.shields.io/github/last-commit/phil65/toprompt)](https://github.com/phil65/toprompt/commits)
22
20
  [![Github release date](https://img.shields.io/github/release-date/phil65/toprompt)](https://github.com/phil65/toprompt/releases)
23
21
  [![Github language count](https://img.shields.io/github/languages/count/phil65/toprompt)](https://github.com/phil65/toprompt)
24
- [![Github commits this week](https://img.shields.io/github/commit-activity/w/phil65/toprompt)](https://github.com/phil65/toprompt)
25
22
  [![Github commits this month](https://img.shields.io/github/commit-activity/m/phil65/toprompt)](https://github.com/phil65/toprompt)
26
- [![Github commits this year](https://img.shields.io/github/commit-activity/y/phil65/toprompt)](https://github.com/phil65/toprompt)
27
23
  [![Package status](https://codecov.io/gh/phil65/toprompt/branch/main/graph/badge.svg)](https://codecov.io/gh/phil65/toprompt/)
28
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
29
24
  [![PyUp](https://pyup.io/repos/github/phil65/toprompt/shield.svg)](https://pyup.io/repos/github/phil65/toprompt/)
30
25
 
31
26
  [Read the documentation!](https://phil65.github.io/toprompt/)
32
-
@@ -0,0 +1,267 @@
1
+ [project]
2
+ name = "toprompt"
3
+ version = "0.3.0"
4
+ description = "Convert python objects to LLM-friendly descriptions"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = { file = "LICENSE" }
8
+ authors = [
9
+ { name = "Philipp Temminghoff", email = "philipptemminghoff@googlemail.com" },
10
+ ]
11
+ keywords = []
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Framework :: Pydantic",
15
+ "Framework :: Pydantic :: 2",
16
+ "Intended Audience :: Developers",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Documentation",
24
+ "Topic :: Software Development",
25
+ "Topic :: Utilities",
26
+ "Typing :: Typed",
27
+ ]
28
+ dependencies = [
29
+ "clinspector>=0.2.0",
30
+ "fieldz>=0.1.0",
31
+ "jinjarope>=0.16.0",
32
+ "pydantic",
33
+ # Only add below (Copier)
34
+ "sqlmodel>=0.0.22",
35
+ ]
36
+
37
+ [project.urls]
38
+ "Code coverage" = "https://app.codecov.io/gh/phil65/toprompt"
39
+ Discussions = "https://github.com/phil65/toprompt/discussions"
40
+ Documentation = "https://phil65.github.io/toprompt/"
41
+ Issues = "https://github.com/phil65/toprompt/issues"
42
+ Source = "https://github.com/phil65/toprompt"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "devtools",
47
+ "pyreadline3",
48
+ "pytest",
49
+ # Only add below (Copier)
50
+ "pytest-asyncio>=0.25.2",
51
+ "pytest-cov",
52
+ ]
53
+ benchmark = ["pyinstrument"]
54
+ docs = [
55
+ "mkdocs-material",
56
+ "mkdocs-mknodes",
57
+ # Only add below (Copier)
58
+ ]
59
+ lint = [
60
+ "mypy; python_version >= '3.14'",
61
+ "mypy[faster-cache]; python_version < '3.14'",
62
+ "ruff",
63
+ # Only add below (Copier)
64
+ ]
65
+
66
+ [build-system]
67
+ requires = ["uv_build>=0.8.22"]
68
+ build-backend = "uv_build"
69
+
70
+ [tool.coverage.report]
71
+ exclude_lines = [
72
+ "pragma: no cover",
73
+ "if TYPE_CHECKING:",
74
+ "@overload",
75
+ "except ImportError",
76
+ 'if __name__ == "__main__":',
77
+ ]
78
+
79
+ [tool.mknodes]
80
+ allowed-commit-types = [
81
+ "fix",
82
+ "feat",
83
+ "refactor",
84
+ "docs",
85
+ "test",
86
+ "build",
87
+ "chore",
88
+ ]
89
+ docstring-style = "google"
90
+
91
+ [tool.mypy]
92
+ python_version = "3.12"
93
+ disable_error_code = ["misc", "import"]
94
+ pretty = true
95
+ check_untyped_defs = true
96
+ exclude = ["venv/", ".venv/", "tests/"]
97
+ plugins = ["pydantic.mypy"]
98
+
99
+ [tool.pyright]
100
+ venvPath = "."
101
+ venv = ".venv"
102
+ pythonVersion = "3.12"
103
+ pythonPlatform = "All"
104
+ typeCheckingMode = "basic"
105
+ deprecateTypingAliases = true
106
+ reportMissingTypeStubs = false
107
+ reportUnusedCallResult = false
108
+ reportUnknownVariableType = false
109
+ reportAny = false
110
+ reportImplicitOverride = false
111
+ reportUnusedFunction = false
112
+ reportImplicitStringConcatenation = false
113
+ reportIgnoreCommentWithoutRule = false
114
+ reportUnannotatedClassAttribute = false
115
+ reportSelfClsParameterName = false
116
+ reportPrivateImportUsage = false
117
+
118
+ [tool.pytest.ini_options]
119
+ log_cli = true
120
+ log_date_format = "%Y-%m-%d %H:%M:%S"
121
+ log_format = "%(asctime)s %(levelname)s %(message)s"
122
+ markers = ["asyncio: mark a test as an async test"]
123
+ testpaths = "tests/"
124
+ asyncio_mode = "auto"
125
+
126
+ [tool.ruff]
127
+ line-length = 90
128
+ extend-exclude = ["docs"]
129
+ target-version = "py312"
130
+
131
+ [tool.ruff.lint]
132
+ future-annotations = true
133
+ select = [
134
+ "A", # Flake8-builtins
135
+ # "ANN", # Flake8-Annotations
136
+ # "ASYNC", # Flake8-Async
137
+ # "ARG", # # Flake8-Unused-Arguments
138
+ "B", # flake8-bugbear
139
+ "BLE", # Flake8-blind-except
140
+ "C",
141
+ "C4", # flake8-comprehensions
142
+ # "C90", # MCCabe
143
+ "COM", # Flake8-commas
144
+ # "CPY", # Copyright-related rules
145
+ "D", # PyDocStyle
146
+ # "DTZ", # Flake8- Datetimez
147
+ "E", # PyCodeStyle Error
148
+ "EM", # flake8-errmsg
149
+ # "ERA", # Eradicate
150
+ "EXE", # flake8-executable
151
+ "F", # PyFlakes
152
+ "FA", # flake8-future-annotations
153
+ # "FBT", # flake8-boolean-trap
154
+ # "FIX", # flake8-fixme
155
+ "FLY", # flynt
156
+ "G", # flake8-logging-format
157
+ "I", # ISort
158
+ "ICN", # Flake8-import-conventions
159
+ "INP", # flake8-no-pep420
160
+ "INT", # flake8-gettext
161
+ "ISC", # flake8-implicit-str-concat
162
+ "N", # pep8-naming
163
+ # "NPY", # numpy-specific rules
164
+ # "PD", # pandas-vet
165
+ "PERF", # perflint
166
+ # "PGH", # pygrep-hooks
167
+ "PIE", # flake8-pie
168
+ "PLE", # PyLint Error
169
+ "PLC", # PyLint convention
170
+ # "PLW", # PyLint Warning
171
+ "PLR", # PyLint refactor
172
+ "PT", # flake8-pytest-style
173
+ "PTH", # flake8-use-pathlib
174
+ "PYI", # flake8-pyi
175
+ "Q", # flake8-quotes
176
+ "RET", # flake8-return
177
+ "RSE", # flake8-raise
178
+ "RUF", # ruff-specific rules
179
+ # "S", # flake8-bandit
180
+ "SIM", # flake8-simplify
181
+ "SLF", # flake8-self
182
+ "SLOT", # flake8-slots
183
+ # "T",
184
+ # "TD", # flake8-todos
185
+ "T10", # flake8-debugger
186
+ # "T20", # flake8-print
187
+ "TC", # flake8-type-checking
188
+ "TID", # flake8-tidy-imports
189
+ "TRY", # tryceratops
190
+ "UP", # PyUpgrade
191
+ "W", # PyCodeStyle warning
192
+ "YTT", # flake8-2020
193
+ ]
194
+ ignore = [
195
+ "C408", # Unnecessary {obj_type} call (rewrite as a literal)
196
+ "B905", # zip() without an explicit strict= parameter
197
+ "C901", # {name} is too complex ({complexity} > {max_complexity})
198
+ "COM812",
199
+ # "CPY001", # Missing copyright notice at top of file
200
+ "D100", # Missing docstring in public module
201
+ "D101", # Missing docstring in public class
202
+ "D102", # Missing docstring in public method
203
+ "D103", # Missing docstring in public function
204
+ "D104", # Missing docstring in public package
205
+ "D105", # Missing docstring in magic method
206
+ "D106", # Missing docstring in public nested class
207
+ "D107", # Missing docstring in __init__
208
+ "D203", # 1 blank line required before class docstring
209
+ "D204", # 1 blank line required after class docstring
210
+ "D213", # Multi-line docstring summary should start at the second line
211
+ "D215", # Section underline is over-indented ("{name}")
212
+ "D400", # First line should end with a period
213
+ "D401", # First line of docstring should be in imperative mood: "{first_line}"
214
+ "D404", # First word of the docstring should not be "This"
215
+ "D406", # Section name should end with a newline ("{name}")
216
+ "D407", # Missing dashed underline after section ("{name}")
217
+ "D408", # Section underline should be in the line following the section's name ("{name}")
218
+ "D409", # Section underline should match the length of its name ("{name}")
219
+ "D413", # Missing blank line after last section ("{name}")
220
+ "ISC001",
221
+ "PLC0415",
222
+ "PLR0912", # Too many branches
223
+ "PLR0913", # Too many arguments to function call
224
+ "PLR0915", # Too many statements
225
+ # "PLR2004", # Magic values instead of named consts
226
+ "SLF001", # Private member accessed
227
+ "TRY003", # Avoid specifying long messages outside the exception class
228
+ "TC006", # runtime-cast-value
229
+ ]
230
+
231
+ [tool.ruff.lint.flake8-quotes]
232
+ docstring-quotes = "double"
233
+
234
+ [tool.ruff.lint.flake8-type-checking]
235
+ runtime-evaluated-base-classes = [
236
+ "pydantic.BaseModel",
237
+ "sqlalchemy.orm.DeclarativeBase",
238
+ "schemez.Schema",
239
+ ]
240
+ runtime-evaluated-decorators = [
241
+ "pydantic.validate_call",
242
+ "attrs.define",
243
+ "fastapi.FastAPI.get",
244
+ "fastapi.FastAPI.post",
245
+ "fastmcp.FastMCP.tool",
246
+ ]
247
+
248
+ [tool.ruff.lint.isort]
249
+ lines-after-imports = 2
250
+ # lines-between-types = 1
251
+ # atomic = true
252
+ force-sort-within-sections = true
253
+ combine-as-imports = true
254
+
255
+ [tool.ruff.lint.per-file-ignores]
256
+ "__init__.py" = ["E402", "I001"]
257
+ "scripts/*" = ["INP001"]
258
+
259
+ [tool.ruff.format]
260
+ # Enable preview style formatting.
261
+ preview = true
262
+
263
+ [tool.ty.environment]
264
+ python-version = "3.12"
265
+
266
+ [tool.uv]
267
+ default-groups = ["dev", "lint", "docs"]
@@ -0,0 +1,36 @@
1
+ """ToPrompt: main package.
2
+
3
+ Convert python objects to LLM-friendly descriptions.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ from importlib.metadata import version
9
+
10
+ __version__ = version("toprompt")
11
+ __title__ = "ToPrompt"
12
+
13
+ __author__ = "Philipp Temminghoff"
14
+ __author_email__ = "philipptemminghoff@googlemail.com"
15
+ __copyright__ = "Copyright (c) 2025 Philipp Temminghoff"
16
+ __license__ = "MIT"
17
+ __url__ = "https://github.com/phil65/toprompt"
18
+
19
+ from toprompt.to_prompt import (
20
+ Template,
21
+ to_prompt,
22
+ AnyPromptType,
23
+ render_prompt,
24
+ PromptConvertible,
25
+ PromptTypeConvertible,
26
+ )
27
+
28
+ __all__ = [
29
+ "AnyPromptType",
30
+ "PromptConvertible",
31
+ "PromptTypeConvertible",
32
+ "Template",
33
+ "__version__",
34
+ "render_prompt",
35
+ "to_prompt",
36
+ ]