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.
- {toprompt-0.2.2 → toprompt-0.2.3}/PKG-INFO +1 -1
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/__init__.py +1 -1
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/dataclass_types.py +2 -2
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/sqlite_types.py +7 -1
- {toprompt-0.2.2 → toprompt-0.2.3}/.copier-answers.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.github/FUNDING.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.github/copilot-instructions.md +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.github/dependabot.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.github/workflows/build.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.github/workflows/documentation.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.gitignore +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/.pre-commit-config.yaml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/LICENSE +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/README.md +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/docs/.empty +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/duties.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/mkdocs.yml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/overrides/_dummy.txt +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/pyproject.toml +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/cli_types.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/fastapi_types.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/llmling_types.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/py.typed +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/sqlmodel_types.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/src/toprompt/to_prompt.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/tests/__init__.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/tests/conftest.py +0 -0
- {toprompt-0.2.2 → toprompt-0.2.3}/tests/test_toprompt.py +0 -0
|
@@ -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
|
|
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
|