toprompt 0.2.2__tar.gz → 0.2.3__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 (28) hide show
  1. {toprompt-0.2.2 → toprompt-0.2.3}/PKG-INFO +1 -1
  2. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/__init__.py +1 -1
  3. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/dataclass_types.py +2 -2
  4. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/sqlite_types.py +7 -1
  5. {toprompt-0.2.2 → toprompt-0.2.3}/.copier-answers.yml +0 -0
  6. {toprompt-0.2.2 → toprompt-0.2.3}/.github/FUNDING.yml +0 -0
  7. {toprompt-0.2.2 → toprompt-0.2.3}/.github/copilot-instructions.md +0 -0
  8. {toprompt-0.2.2 → toprompt-0.2.3}/.github/dependabot.yml +0 -0
  9. {toprompt-0.2.2 → toprompt-0.2.3}/.github/workflows/build.yml +0 -0
  10. {toprompt-0.2.2 → toprompt-0.2.3}/.github/workflows/documentation.yml +0 -0
  11. {toprompt-0.2.2 → toprompt-0.2.3}/.gitignore +0 -0
  12. {toprompt-0.2.2 → toprompt-0.2.3}/.pre-commit-config.yaml +0 -0
  13. {toprompt-0.2.2 → toprompt-0.2.3}/LICENSE +0 -0
  14. {toprompt-0.2.2 → toprompt-0.2.3}/README.md +0 -0
  15. {toprompt-0.2.2 → toprompt-0.2.3}/docs/.empty +0 -0
  16. {toprompt-0.2.2 → toprompt-0.2.3}/duties.py +0 -0
  17. {toprompt-0.2.2 → toprompt-0.2.3}/mkdocs.yml +0 -0
  18. {toprompt-0.2.2 → toprompt-0.2.3}/overrides/_dummy.txt +0 -0
  19. {toprompt-0.2.2 → toprompt-0.2.3}/pyproject.toml +0 -0
  20. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/cli_types.py +0 -0
  21. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/fastapi_types.py +0 -0
  22. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/llmling_types.py +0 -0
  23. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/py.typed +0 -0
  24. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/sqlmodel_types.py +0 -0
  25. {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/to_prompt.py +0 -0
  26. {toprompt-0.2.2 → toprompt-0.2.3}/tests/__init__.py +0 -0
  27. {toprompt-0.2.2 → toprompt-0.2.3}/tests/conftest.py +0 -0
  28. {toprompt-0.2.2 → toprompt-0.2.3}/tests/test_toprompt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toprompt
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Convert python objects to LLM-friendly descriptions
5
5
  Project-URL: Documentation, https://phil65.github.io/toprompt/
6
6
  Project-URL: Source, https://github.com/phil65/toprompt
@@ -7,7 +7,7 @@ from toprompt.to_prompt import (
7
7
  PromptTypeConvertible,
8
8
  )
9
9
 
10
- __version__ = "0.2.2"
10
+ __version__ = "0.2.3"
11
11
 
12
12
  __all__ = [
13
13
  "AnyPromptType",
@@ -2,14 +2,14 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any, TypeVar
4
4
 
5
- from fieldz import fields
6
-
7
5
 
8
6
  T = TypeVar("T")
9
7
 
10
8
 
11
9
  def format_dataclass_like(obj: Any) -> str:
12
10
  """Format object instance showing structure and current values."""
11
+ from fieldz import fields
12
+
13
13
  try:
14
14
  obj_fields = fields(obj)
15
15
  except TypeError:
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import sqlite3
4
3
  from typing import TYPE_CHECKING, Any, Protocol, TypedDict, runtime_checkable
5
4
 
6
5
  import upath
@@ -8,6 +7,7 @@ import upath
8
7
 
9
8
  if TYPE_CHECKING:
10
9
  import os
10
+ import sqlite3
11
11
 
12
12
 
13
13
  @runtime_checkable
@@ -56,11 +56,15 @@ class IndexInfo(TypedDict):
56
56
 
57
57
  def is_sqlite_db(obj: Any) -> bool:
58
58
  """Check if object is a SQLite database."""
59
+ import sqlite3
60
+
59
61
  return isinstance(obj, sqlite3.Connection)
60
62
 
61
63
 
62
64
  def get_db_path(conn: sqlite3.Connection) -> str:
63
65
  """Get the path for a SQLite database connection."""
66
+ import sqlite3
67
+
64
68
  try:
65
69
  cursor = conn.cursor()
66
70
  cursor.execute("PRAGMA database_list")
@@ -79,6 +83,8 @@ def get_sqlite_schema(db: str | os.PathLike[str] | sqlite3.Connection) -> str:
79
83
  Args:
80
84
  db: Path to SQLite database file or Connection object
81
85
  """
86
+ import sqlite3
87
+
82
88
  if isinstance(db, sqlite3.Connection):
83
89
  conn = db
84
90
  should_close = False
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