singularitysql 0.1.0__tar.gz → 0.1.1__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.
- {singularitysql-0.1.0 → singularitysql-0.1.1}/PKG-INFO +23 -20
- {singularitysql-0.1.0 → singularitysql-0.1.1}/README.md +13 -10
- {singularitysql-0.1.0 → singularitysql-0.1.1}/pyproject.toml +11 -11
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularitysql.egg-info/PKG-INFO +23 -20
- singularitysql-0.1.1/singularitysql.egg-info/requires.txt +12 -0
- singularitysql-0.1.0/singularitysql.egg-info/requires.txt +0 -12
- {singularitysql-0.1.0 → singularitysql-0.1.1}/LICENSE +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/setup.cfg +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/__init__.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/cli/__init__.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/cli/_app.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/cli/config.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/cli/docs_generate.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/cli/generate.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/exceptions.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/executor.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/introspector.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/model_generator.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/types.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/version/__init__.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/version/_azure.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/version/_base.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/version/_legacy.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularity/version/_modern.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularitysql.egg-info/SOURCES.txt +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularitysql.egg-info/dependency_links.txt +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularitysql.egg-info/entry_points.txt +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/singularitysql.egg-info/top_level.txt +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_cli_generate.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_config_loading.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_field_sanitization.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_introspector.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_model_generation.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_type_mapping.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_version_detection.py +0 -0
- {singularitysql-0.1.0 → singularitysql-0.1.1}/tests/test_version_strategies.py +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: singularitysql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: SQL Server stored procedure introspection and Pydantic model generator
|
|
5
5
|
Author: Samuel Urrego
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: pyodbc>=5.0
|
|
11
|
-
Requires-Dist: pydantic>=2.
|
|
12
|
-
Requires-Dist: typer>=0.
|
|
13
|
-
Requires-Dist: tomli>=2.
|
|
10
|
+
Requires-Dist: pyodbc>=5.3.0
|
|
11
|
+
Requires-Dist: pydantic>=2.13.4
|
|
12
|
+
Requires-Dist: typer>=0.26.0
|
|
13
|
+
Requires-Dist: tomli>=2.4.1
|
|
14
14
|
Requires-Dist: rich>=15.0.0
|
|
15
15
|
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: pytest>=
|
|
17
|
-
Requires-Dist: pytest-cov>=
|
|
18
|
-
Requires-Dist: pytest-mock>=3.
|
|
19
|
-
Requires-Dist: ruff>=0.
|
|
20
|
-
Requires-Dist: mypy>=1.
|
|
16
|
+
Requires-Dist: pytest>=9.0.3; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest-mock>=3.15.1; extra == "dev"
|
|
19
|
+
Requires-Dist: ruff>=0.15.14; extra == "dev"
|
|
20
|
+
Requires-Dist: mypy>=2.1.0; extra == "dev"
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -27,13 +27,13 @@ Dynamic: license-file
|
|
|
27
27
|
> SQL Server → Pydantic v2. Automatically.
|
|
28
28
|
|
|
29
29
|
[](https://github.com/Samuel-Urrego/Singularity/actions/workflows/ci.yml)
|
|
30
|
-
[](https://pypi.org/project/singularitysql/)
|
|
31
31
|
[](https://github.com/astral-sh/ruff)
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
SingularitySQL bridges the gap between SQL Server and Python. Connect to your database, point at a stored procedure, and get a **Pydantic v2 model** — as a runtime class or a `.py` file you can commit.
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
singularity --config config.toml
|
|
36
|
+
singularity generate --config config.toml
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
```python
|
|
@@ -45,17 +45,17 @@ model = generate_model(meta, mode="dynamic")
|
|
|
45
45
|
# <class 'pydantic.main.UspGetOrders'>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Why
|
|
48
|
+
## Why SingularitySQL?
|
|
49
49
|
|
|
50
50
|
**The problem**: You have dozens of complex stored procedures in SQL Server. Calling them from Python means manually writing Pydantic models for every parameter and result set. One typo, and you get a runtime error.
|
|
51
51
|
|
|
52
|
-
**The solution**:
|
|
52
|
+
**The solution**: SingularitySQL reads SQL Server's system catalog (`sys.parameters`, `sp_describe_first_result_set`) and generates the models for you. Zero manual mapping.
|
|
53
53
|
|
|
54
54
|
| Approach | Lines of code | Maintainable | Type-safe |
|
|
55
55
|
|---|---|---|---|
|
|
56
56
|
| Manual Pydantic models | 100s–1000s | ❌ | ⚠️ (manual) |
|
|
57
57
|
| Raw dicts / tuples | Fewer | ❌ | ❌ |
|
|
58
|
-
| **
|
|
58
|
+
| **SingularitySQL** | **Zero** | ✅ | ✅ |
|
|
59
59
|
|
|
60
60
|
## Features
|
|
61
61
|
|
|
@@ -73,11 +73,14 @@ model = generate_model(meta, mode="dynamic")
|
|
|
73
73
|
## Installation
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
uv add
|
|
76
|
+
uv add singularitysql
|
|
77
77
|
# or
|
|
78
|
-
pip install
|
|
78
|
+
pip install singularitysql
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
> **Windows users**: scripts go into `.venv/Scripts/`, not the global PATH.
|
|
82
|
+
> Activate the virtual environment first, or use `uv run singularity ...` to avoid `command not found` errors.
|
|
83
|
+
|
|
81
84
|
**Prerequisite**: [ODBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) (17 or 18).
|
|
82
85
|
|
|
83
86
|
## Quick Start
|
|
@@ -105,7 +108,7 @@ naming_convention = "snake_case"
|
|
|
105
108
|
### 2. Generate models
|
|
106
109
|
|
|
107
110
|
```bash
|
|
108
|
-
singularity --config config.toml
|
|
111
|
+
singularity generate --config config.toml
|
|
109
112
|
```
|
|
110
113
|
|
|
111
114
|
```
|
|
@@ -124,7 +127,7 @@ from generated_models.dbo_usp_GetOrders import UspGetOrders
|
|
|
124
127
|
order = UspGetOrders(id=1, customer_name="Acme Corp", total=99.99)
|
|
125
128
|
```
|
|
126
129
|
|
|
127
|
-
##
|
|
130
|
+
## Python API
|
|
128
131
|
|
|
129
132
|
```python
|
|
130
133
|
from singularity import SQLServerIntrospector, generate_model
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
> SQL Server → Pydantic v2. Automatically.
|
|
6
6
|
|
|
7
7
|
[](https://github.com/Samuel-Urrego/Singularity/actions/workflows/ci.yml)
|
|
8
|
-
[](https://pypi.org/project/singularitysql/)
|
|
9
9
|
[](https://github.com/astral-sh/ruff)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
SingularitySQL bridges the gap between SQL Server and Python. Connect to your database, point at a stored procedure, and get a **Pydantic v2 model** — as a runtime class or a `.py` file you can commit.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
singularity --config config.toml
|
|
14
|
+
singularity generate --config config.toml
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
```python
|
|
@@ -23,17 +23,17 @@ model = generate_model(meta, mode="dynamic")
|
|
|
23
23
|
# <class 'pydantic.main.UspGetOrders'>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
## Why
|
|
26
|
+
## Why SingularitySQL?
|
|
27
27
|
|
|
28
28
|
**The problem**: You have dozens of complex stored procedures in SQL Server. Calling them from Python means manually writing Pydantic models for every parameter and result set. One typo, and you get a runtime error.
|
|
29
29
|
|
|
30
|
-
**The solution**:
|
|
30
|
+
**The solution**: SingularitySQL reads SQL Server's system catalog (`sys.parameters`, `sp_describe_first_result_set`) and generates the models for you. Zero manual mapping.
|
|
31
31
|
|
|
32
32
|
| Approach | Lines of code | Maintainable | Type-safe |
|
|
33
33
|
|---|---|---|---|
|
|
34
34
|
| Manual Pydantic models | 100s–1000s | ❌ | ⚠️ (manual) |
|
|
35
35
|
| Raw dicts / tuples | Fewer | ❌ | ❌ |
|
|
36
|
-
| **
|
|
36
|
+
| **SingularitySQL** | **Zero** | ✅ | ✅ |
|
|
37
37
|
|
|
38
38
|
## Features
|
|
39
39
|
|
|
@@ -51,11 +51,14 @@ model = generate_model(meta, mode="dynamic")
|
|
|
51
51
|
## Installation
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
uv add
|
|
54
|
+
uv add singularitysql
|
|
55
55
|
# or
|
|
56
|
-
pip install
|
|
56
|
+
pip install singularitysql
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
> **Windows users**: scripts go into `.venv/Scripts/`, not the global PATH.
|
|
60
|
+
> Activate the virtual environment first, or use `uv run singularity ...` to avoid `command not found` errors.
|
|
61
|
+
|
|
59
62
|
**Prerequisite**: [ODBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) (17 or 18).
|
|
60
63
|
|
|
61
64
|
## Quick Start
|
|
@@ -83,7 +86,7 @@ naming_convention = "snake_case"
|
|
|
83
86
|
### 2. Generate models
|
|
84
87
|
|
|
85
88
|
```bash
|
|
86
|
-
singularity --config config.toml
|
|
89
|
+
singularity generate --config config.toml
|
|
87
90
|
```
|
|
88
91
|
|
|
89
92
|
```
|
|
@@ -102,7 +105,7 @@ from generated_models.dbo_usp_GetOrders import UspGetOrders
|
|
|
102
105
|
order = UspGetOrders(id=1, customer_name="Acme Corp", total=99.99)
|
|
103
106
|
```
|
|
104
107
|
|
|
105
|
-
##
|
|
108
|
+
## Python API
|
|
106
109
|
|
|
107
110
|
```python
|
|
108
111
|
from singularity import SQLServerIntrospector, generate_model
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "singularitysql"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.1"
|
|
4
4
|
description = "SQL Server stored procedure introspection and Pydantic model generator"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -10,10 +10,10 @@ authors = [
|
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
dependencies = [
|
|
13
|
-
"pyodbc>=5.0",
|
|
14
|
-
"pydantic>=2.
|
|
15
|
-
"typer>=0.
|
|
16
|
-
"tomli>=2.
|
|
13
|
+
"pyodbc>=5.3.0",
|
|
14
|
+
"pydantic>=2.13.4",
|
|
15
|
+
"typer>=0.26.0",
|
|
16
|
+
"tomli>=2.4.1",
|
|
17
17
|
"rich>=15.0.0",
|
|
18
18
|
]
|
|
19
19
|
|
|
@@ -22,11 +22,11 @@ singularity = "singularity.cli._app:_main"
|
|
|
22
22
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
24
|
dev = [
|
|
25
|
-
"pytest>=
|
|
26
|
-
"pytest-cov>=
|
|
27
|
-
"pytest-mock>=3.
|
|
28
|
-
"ruff>=0.
|
|
29
|
-
"mypy>=1.
|
|
25
|
+
"pytest>=9.0.3",
|
|
26
|
+
"pytest-cov>=7.1.0",
|
|
27
|
+
"pytest-mock>=3.15.1",
|
|
28
|
+
"ruff>=0.15.14",
|
|
29
|
+
"mypy>=2.1.0",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
[tool.pytest.ini_options]
|
|
@@ -49,7 +49,7 @@ warn_unused_ignores = true
|
|
|
49
49
|
ignore_missing_imports = true
|
|
50
50
|
|
|
51
51
|
[build-system]
|
|
52
|
-
requires = ["setuptools>=
|
|
52
|
+
requires = ["setuptools>=82.0.1"]
|
|
53
53
|
build-backend = "setuptools.build_meta"
|
|
54
54
|
|
|
55
55
|
[tool.setuptools.packages.find]
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: singularitysql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: SQL Server stored procedure introspection and Pydantic model generator
|
|
5
5
|
Author: Samuel Urrego
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: pyodbc>=5.0
|
|
11
|
-
Requires-Dist: pydantic>=2.
|
|
12
|
-
Requires-Dist: typer>=0.
|
|
13
|
-
Requires-Dist: tomli>=2.
|
|
10
|
+
Requires-Dist: pyodbc>=5.3.0
|
|
11
|
+
Requires-Dist: pydantic>=2.13.4
|
|
12
|
+
Requires-Dist: typer>=0.26.0
|
|
13
|
+
Requires-Dist: tomli>=2.4.1
|
|
14
14
|
Requires-Dist: rich>=15.0.0
|
|
15
15
|
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: pytest>=
|
|
17
|
-
Requires-Dist: pytest-cov>=
|
|
18
|
-
Requires-Dist: pytest-mock>=3.
|
|
19
|
-
Requires-Dist: ruff>=0.
|
|
20
|
-
Requires-Dist: mypy>=1.
|
|
16
|
+
Requires-Dist: pytest>=9.0.3; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest-mock>=3.15.1; extra == "dev"
|
|
19
|
+
Requires-Dist: ruff>=0.15.14; extra == "dev"
|
|
20
|
+
Requires-Dist: mypy>=2.1.0; extra == "dev"
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -27,13 +27,13 @@ Dynamic: license-file
|
|
|
27
27
|
> SQL Server → Pydantic v2. Automatically.
|
|
28
28
|
|
|
29
29
|
[](https://github.com/Samuel-Urrego/Singularity/actions/workflows/ci.yml)
|
|
30
|
-
[](https://pypi.org/project/singularitysql/)
|
|
31
31
|
[](https://github.com/astral-sh/ruff)
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
SingularitySQL bridges the gap between SQL Server and Python. Connect to your database, point at a stored procedure, and get a **Pydantic v2 model** — as a runtime class or a `.py` file you can commit.
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
singularity --config config.toml
|
|
36
|
+
singularity generate --config config.toml
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
```python
|
|
@@ -45,17 +45,17 @@ model = generate_model(meta, mode="dynamic")
|
|
|
45
45
|
# <class 'pydantic.main.UspGetOrders'>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Why
|
|
48
|
+
## Why SingularitySQL?
|
|
49
49
|
|
|
50
50
|
**The problem**: You have dozens of complex stored procedures in SQL Server. Calling them from Python means manually writing Pydantic models for every parameter and result set. One typo, and you get a runtime error.
|
|
51
51
|
|
|
52
|
-
**The solution**:
|
|
52
|
+
**The solution**: SingularitySQL reads SQL Server's system catalog (`sys.parameters`, `sp_describe_first_result_set`) and generates the models for you. Zero manual mapping.
|
|
53
53
|
|
|
54
54
|
| Approach | Lines of code | Maintainable | Type-safe |
|
|
55
55
|
|---|---|---|---|
|
|
56
56
|
| Manual Pydantic models | 100s–1000s | ❌ | ⚠️ (manual) |
|
|
57
57
|
| Raw dicts / tuples | Fewer | ❌ | ❌ |
|
|
58
|
-
| **
|
|
58
|
+
| **SingularitySQL** | **Zero** | ✅ | ✅ |
|
|
59
59
|
|
|
60
60
|
## Features
|
|
61
61
|
|
|
@@ -73,11 +73,14 @@ model = generate_model(meta, mode="dynamic")
|
|
|
73
73
|
## Installation
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
uv add
|
|
76
|
+
uv add singularitysql
|
|
77
77
|
# or
|
|
78
|
-
pip install
|
|
78
|
+
pip install singularitysql
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
> **Windows users**: scripts go into `.venv/Scripts/`, not the global PATH.
|
|
82
|
+
> Activate the virtual environment first, or use `uv run singularity ...` to avoid `command not found` errors.
|
|
83
|
+
|
|
81
84
|
**Prerequisite**: [ODBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) (17 or 18).
|
|
82
85
|
|
|
83
86
|
## Quick Start
|
|
@@ -105,7 +108,7 @@ naming_convention = "snake_case"
|
|
|
105
108
|
### 2. Generate models
|
|
106
109
|
|
|
107
110
|
```bash
|
|
108
|
-
singularity --config config.toml
|
|
111
|
+
singularity generate --config config.toml
|
|
109
112
|
```
|
|
110
113
|
|
|
111
114
|
```
|
|
@@ -124,7 +127,7 @@ from generated_models.dbo_usp_GetOrders import UspGetOrders
|
|
|
124
127
|
order = UspGetOrders(id=1, customer_name="Acme Corp", total=99.99)
|
|
125
128
|
```
|
|
126
129
|
|
|
127
|
-
##
|
|
130
|
+
## Python API
|
|
128
131
|
|
|
129
132
|
```python
|
|
130
133
|
from singularity import SQLServerIntrospector, generate_model
|
|
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
|