sqlobjects 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 XtraVisions
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqlobjects
3
+ Version: 0.1.0
4
+ Summary: Django-style async ORM library based on SQLAlchemy with chainable queries, Q objects, and relationship loading
5
+ Author-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
6
+ Maintainer-email: XtraVisions <gitadmin@xtravisions.com>, Chen Hao <chenhao@xtravisions.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/XtraVisionsAI/sqlobjects
9
+ Project-URL: Repository, https://github.com/XtraVisionsAI/sqlobjects.git
10
+ Project-URL: Documentation, https://github.com/XtraVisionsAI/sqlobjects#readme
11
+ Project-URL: Bug Tracker, https://github.com/XtraVisionsAI/sqlobjects/issues
12
+ Project-URL: Changelog, https://github.com/XtraVisionsAI/sqlobjects/blob/main/CHANGELOG.md
13
+ Keywords: python,orm,async,django-style,database,query
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Topic :: Database
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Framework :: AsyncIO
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.12
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: sqlalchemy[asyncio]>=2.0.43
29
+ Dynamic: license-file
@@ -0,0 +1,119 @@
1
+ [project]
2
+ name = "sqlobjects"
3
+ version = "0.1.0"
4
+ description = "Django-style async ORM library based on SQLAlchemy with chainable queries, Q objects, and relationship loading"
5
+ readme = "README.md"
6
+ license = { text = "MIT" }
7
+ authors = [
8
+ { name = "XtraVisions", email = "gitadmin@xtravisions.com" },
9
+ { name = "Chen Hao", email = "chenhao@xtravisions.com" }
10
+ ]
11
+ maintainers = [
12
+ { name = "XtraVisions", email = "gitadmin@xtravisions.com" },
13
+ { name = "Chen Hao", email = "chenhao@xtravisions.com" }
14
+ ]
15
+ keywords = [
16
+ "python",
17
+ "orm",
18
+ "async",
19
+ "django-style",
20
+ "database",
21
+ "query"
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 4 - Beta",
25
+ "Intended Audience :: Developers",
26
+ "License :: OSI Approved :: MIT License",
27
+ "Operating System :: OS Independent",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3 :: Only",
31
+ "Topic :: Database",
32
+ "Topic :: Software Development :: Libraries :: Python Modules",
33
+ "Framework :: AsyncIO",
34
+ "Typing :: Typed"
35
+ ]
36
+ requires-python = ">=3.12"
37
+ dependencies = [
38
+ "sqlalchemy[asyncio]>=2.0.43",
39
+ ]
40
+
41
+ [project.urls]
42
+ Homepage = "https://github.com/XtraVisionsAI/sqlobjects"
43
+ Repository = "https://github.com/XtraVisionsAI/sqlobjects.git"
44
+ Documentation = "https://github.com/XtraVisionsAI/sqlobjects#readme"
45
+ "Bug Tracker" = "https://github.com/XtraVisionsAI/sqlobjects/issues"
46
+ Changelog = "https://github.com/XtraVisionsAI/sqlobjects/blob/main/CHANGELOG.md"
47
+
48
+ [dependency-groups]
49
+ dev = [
50
+ "pre-commit>=4.3.0",
51
+ "pyright>=1.1.404",
52
+ "ruff>=0.12.9",
53
+ "setuptools>=80.9.0",
54
+ ]
55
+ test = [
56
+ "aiomysql>=0.2.0",
57
+ "aiosqlite>=0.20.0",
58
+ "asyncpg>=0.30.0",
59
+ "pytest>=8.4.1",
60
+ "pytest-asyncio>=0.24.0",
61
+ ]
62
+
63
+ [[tool.uv.index]]
64
+ name = "tsinghua"
65
+ url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
66
+ default = true
67
+
68
+ [tool.pyright]
69
+ include = ["sqlobjects", "tests"]
70
+ exclude = ["**/__pycache__"]
71
+ pythonVersion = "3.12"
72
+ reportMissingImports = "error"
73
+ reportUnnecessaryTypeIgnoreComment = "warning"
74
+ reportMissingTypeStubs = false
75
+ lang = "en"
76
+
77
+ [tool.ruff]
78
+ line-length = 120
79
+ fix = true
80
+ target-version = "py312"
81
+
82
+ [tool.ruff.lint]
83
+ select = [
84
+ "E", # pycodestyle errors
85
+ "W", # pycodestyle warnings
86
+ "F", # pyflakes
87
+ "I", # isort
88
+ "B", # flake8-bugbear
89
+ "C4", # flake8-comprehensions
90
+ "UP", # pyupgrade
91
+ ]
92
+ ignore = [
93
+ "UP046", # disable none pep695 generic class
94
+ "UP035", # disable using `type` instead `types.Type`
95
+ ]
96
+
97
+ [tool.ruff.lint.per-file-ignores]
98
+ "tests/*.py" = [
99
+ "E712",
100
+ ]
101
+
102
+ [tool.ruff.lint.pyupgrade]
103
+ # Preserve types, even if a file imports `from __future__ import annotations`.
104
+ keep-runtime-typing = true
105
+
106
+ [tool.ruff.lint.isort]
107
+ #force-single-line = true
108
+ lines-after-imports = 2
109
+
110
+ [tool.ruff.format]
111
+ docstring-code-format = true
112
+ docstring-code-line-length = 100
113
+
114
+ [tool.pytest.ini_options]
115
+ asyncio_mode = "auto"
116
+ testpaths = ["tests"]
117
+ python_files = ["test_*.py", "*_test.py"]
118
+ python_classes = ["Test*"]
119
+ python_functions = ["test_*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,38 @@
1
+ """SQLObjects - Django-style async ORM library built on SQLAlchemy Core
2
+
3
+ A modern, async-first ORM library that provides Django-style APIs while leveraging
4
+ the power and performance of SQLAlchemy Core.
5
+
6
+ Core Features:
7
+ - Django-style chainable queries with Q objects
8
+ - Async-first design with SQLAlchemy Core
9
+ - Multi-database support with connection management
10
+ - Comprehensive validation system
11
+ - Signal system for model lifecycle events
12
+ - Type-safe field definitions with shortcuts
13
+
14
+ Examples:
15
+ >>> from sqlobjects import ObjectModel
16
+ >>> from sqlobjects.database import init_db, create_tables
17
+ >>> from sqlobjects.fields import str_column, int_column
18
+ >>> # Initialize database
19
+ >>> db = await init_db("sqlite+aiosqlite:///test.db")
20
+ >>> # Define model
21
+ >>> class User(ObjectModel):
22
+ ... name: str = str_column(length=50)
23
+ ... age: int = int_column()
24
+ >>> # Create tables
25
+ >>> await db.create_tables(ObjectModel)
26
+ >>> # Use the model
27
+ >>> user = await User.objects.create(name="John", age=25)
28
+ """
29
+
30
+ from .model import ObjectModel
31
+ from .queries import Q
32
+
33
+
34
+ __version__ = "2.0.0"
35
+ __all__ = [
36
+ "ObjectModel",
37
+ "Q",
38
+ ]