winidjango 2.0.31__py3-none-any.whl → 2.0.55__py3-none-any.whl

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.
winidjango/__init__.py CHANGED
@@ -7,6 +7,8 @@ import django
7
7
  import django_stubs_ext
8
8
  from django.conf import settings
9
9
 
10
+ import winidjango
11
+
10
12
  logger = logging.getLogger(__name__)
11
13
 
12
14
  django_stubs_ext.monkeypatch()
@@ -18,17 +20,19 @@ logger = logging.getLogger(__name__)
18
20
 
19
21
  # Configure Django settings for tests if not already configured
20
22
  if not settings.configured:
21
- logger.info("Configuring minimal django settings for tests")
22
- installed_apps = ["tests"] if Path("tests").exists() else []
23
- settings.configure(
24
- DATABASES={
25
- "default": {
26
- "ENGINE": "django.db.backends.sqlite3",
27
- "NAME": ":memory:",
28
- }
29
- },
30
- INSTALLED_APPS=installed_apps,
31
- USE_TZ=True,
32
- )
33
- django.setup()
34
- logger.info("Django setup complete")
23
+ in_this_repo = Path(winidjango.__name__).exists()
24
+ if in_this_repo:
25
+ logger.info("Configuring minimal django settings for tests")
26
+ installed_apps = ["tests"] if Path("tests").exists() else []
27
+ settings.configure(
28
+ DATABASES={
29
+ "default": {
30
+ "ENGINE": "django.db.backends.sqlite3",
31
+ "NAME": ":memory:",
32
+ }
33
+ },
34
+ INSTALLED_APPS=installed_apps,
35
+ USE_TZ=True,
36
+ )
37
+ django.setup()
38
+ logger.info("Django setup complete")
@@ -0,0 +1,8 @@
1
+ """Shared commands for the CLI.
2
+
3
+ This module provides shared CLI commands that can be used by multiple
4
+ packages in a multi-package architecture. These commands are automatically
5
+ discovered and added to the CLI by pyrig.
6
+ Example is version command that is available in all packages.
7
+ uv run my-awesome-project version will return my-awesome-project version 0.1.0
8
+ """
@@ -0,0 +1,5 @@
1
+ """Tool wrappers for CLI tools used in development workflows.
2
+
3
+ Tools are subclasses of `Tool` providing methods that return `Args` objects
4
+ for type-safe command construction and execution.
5
+ """
@@ -1,17 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: winidjango
3
- Version: 2.0.31
3
+ Version: 2.0.55
4
4
  Summary: A utils package for django
5
+ Keywords:
5
6
  Author: Winipedia
6
7
  License-Expression: MIT
7
8
  License-File: LICENSE
8
9
  Classifier: Programming Language :: Python :: 3.12
9
10
  Classifier: Programming Language :: Python :: 3.13
10
11
  Classifier: Programming Language :: Python :: 3.14
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Typing :: Typed
11
14
  Requires-Dist: django
12
15
  Requires-Dist: django-stubs-ext
13
16
  Requires-Dist: winiutils
17
+ Maintainer: Winipedia
14
18
  Requires-Python: >=3.12
19
+ Project-URL: Changelog, https://github.com/Winipedia/winidjango/releases
20
+ Project-URL: Documentation, https://Winipedia.github.io/winidjango
21
+ Project-URL: Homepage, https://github.com/Winipedia/winidjango
22
+ Project-URL: Issues, https://github.com/Winipedia/winidjango/issues
23
+ Project-URL: Source, https://github.com/Winipedia/winidjango
15
24
  Description-Content-Type: text/markdown
16
25
 
17
26
  # winidjango
@@ -19,21 +28,25 @@ Description-Content-Type: text/markdown
19
28
  <!-- tooling -->
20
29
  [![pyrig](https://img.shields.io/badge/built%20with-pyrig-3776AB?logo=buildkite&logoColor=black)](https://github.com/Winipedia/pyrig)
21
30
  [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
31
+ [![Container](https://img.shields.io/badge/Container-Podman-A23CD6?logo=podman&logoColor=grey&colorA=0D1F3F&colorB=A23CD6)](https://podman.io/)
22
32
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://pre-commit.com/)
33
+ [![MkDocs](https://img.shields.io/badge/MkDocs-Documentation-326CE5?logo=mkdocs&logoColor=white)](https://www.mkdocs.org/)
23
34
  <!-- code-quality -->
24
35
  [![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
25
- [![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)[![mypy](https://img.shields.io/badge/type%20checked-mypy-039dfc.svg)](https://mypy-lang.org/)
36
+ [![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)
26
37
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
27
38
  [![pytest](https://img.shields.io/badge/tested%20with-pytest-46a2f1.svg?logo=pytest)](https://pytest.org/)
28
39
  [![codecov](https://codecov.io/gh/Winipedia/winidjango/branch/main/graph/badge.svg)](https://codecov.io/gh/Winipedia/winidjango)
40
+ [![rumdl](https://img.shields.io/badge/markdown-rumdl-darkgreen)](https://github.com/rvben/rumdl)
29
41
  <!-- package-info -->
30
- [![PyPI](https://img.shields.io/pypi/v/winidjango?logo=pypi&logoColor=white)](https://pypi.org/project/winidjango/)
42
+ [![PyPI](https://img.shields.io/pypi/v/winidjango?logo=pypi&logoColor=white)](https://pypi.org/project/winidjango)
31
43
  [![Python](https://img.shields.io/badge/python-3.12|3.13|3.14-blue.svg?logo=python&logoColor=white)](https://www.python.org/)
32
44
  [![License](https://img.shields.io/github/license/Winipedia/winidjango)](https://github.com/Winipedia/winidjango/blob/main/LICENSE)
33
45
  <!-- ci/cd -->
34
46
  [![CI](https://img.shields.io/github/actions/workflow/status/Winipedia/winidjango/health_check.yaml?label=CI&logo=github)](https://github.com/Winipedia/winidjango/actions/workflows/health_check.yaml)
35
47
  [![CD](https://img.shields.io/github/actions/workflow/status/Winipedia/winidjango/release.yaml?label=CD&logo=github)](https://github.com/Winipedia/winidjango/actions/workflows/release.yaml)
36
-
48
+ <!-- documentation -->
49
+ [![Documentation](https://img.shields.io/badge/Docs-GitHub%20Pages-black?style=for-the-badge&logo=github&logoColor=white)](https://Winipedia.github.io/winidjango)
37
50
 
38
51
  ---
39
52
 
@@ -41,7 +54,6 @@ Description-Content-Type: text/markdown
41
54
 
42
55
  ---
43
56
 
44
-
45
57
  ## Table of Contents
46
58
 
47
59
  - [Features](#features)
@@ -57,26 +69,38 @@ Description-Content-Type: text/markdown
57
69
  ## Features
58
70
 
59
71
  ### 🚀 High-Performance Bulk Operations
60
- - **Multithreaded Processing**: Parallel execution of database operations for maximum speed
61
- - **Automatic Chunking**: Configurable batch sizes (default: 1000) for memory-efficient processing
62
- - **Transaction Safety**: Atomic operations with intelligent transaction management
63
- - **Dependency Resolution**: Automatic topological sorting for foreign key relationships
72
+
73
+ - **Multithreaded Processing**:
74
+ Parallel execution of database operations for maximum speed
75
+ - **Automatic Chunking**:
76
+ Configurable batch sizes (default: 1000) for memory-efficient processing
77
+ - **Transaction Safety**:
78
+ Atomic operations with intelligent transaction management
79
+ - **Dependency Resolution**:
80
+ Automatic topological sorting for foreign key relationships
64
81
 
65
82
  ### 🛠️ Database Utilities
83
+
66
84
  - **Bulk Create/Update/Delete**: Process thousands of records efficiently
67
- - **Deletion Simulation**: Preview cascade effects before executing destructive operations
68
- - **Bulk Comparison**: Detect differences between datasets with field-level hashing
85
+ - **Deletion Simulation**:
86
+ Preview cascade effects before executing destructive operations
87
+ - **Bulk Comparison**:
88
+ Detect differences between datasets with field-level hashing
69
89
  - **Raw SQL Execution**: Safe parameter binding with automatic cursor management
70
90
 
71
91
  ### 📦 Model Utilities
72
- - **BaseModel**: Abstract base with `created_at`, `updated_at`, and type-safe `meta` property
92
+
93
+ - **BaseModel**:
94
+ Abstract base with `created_at`, `updated_at`, and type-safe `meta` property
73
95
  - **Topological Sorting**: Automatic dependency ordering for model operations
74
96
  - **Field Introspection**: Type-safe utilities for working with model fields
75
97
 
76
98
  ### 🎯 Management Command Framework
99
+
77
100
  - **ABCBaseCommand**: Template method pattern with automatic logging
78
101
  - **ImportDataBaseCommand**: Structured data import with Polars integration
79
- - **Built-in Arguments**: Standard options for dry-run, batch size, threading, and more
102
+ - **Built-in Arguments**:
103
+ Standard options for dry-run, batch size, threading, and more
80
104
  - **Type Safety**: Full type hints with abstract method enforcement
81
105
 
82
106
  ## Installation
@@ -160,7 +184,9 @@ class ImportUsersCommand(ImportDataBaseCommand):
160
184
  def get_cleaning_df_cls(self) -> type[CleaningDF]:
161
185
  return MyCleaningDF
162
186
 
163
- def get_bulks_by_model(self, df: pl.DataFrame) -> dict[type[Model], Iterable[Model]]:
187
+ def get_bulks_by_model(
188
+ self, df: pl.DataFrame
189
+ ) -> dict[type[Model], Iterable[Model]]:
164
190
  users = [User(name=row["name"]) for row in df.iter_rows(named=True)]
165
191
  return {User: users}
166
192
  ```
@@ -169,7 +195,8 @@ class ImportUsersCommand(ImportDataBaseCommand):
169
195
 
170
196
  Comprehensive documentation is available in the [`docs/`](docs/) directory:
171
197
 
172
- - **[Database Utilities](docs/db.md)** - Bulk operations, model utilities, and SQL helpers
198
+ - **[Database Utilities](docs/db.md)**
199
+ - Bulk operations, model utilities, and SQL helpers
173
200
  - **[Management Commands](docs/commands.md)** - Command framework and data import patterns
174
201
  - **[API Reference](docs/index.md)** - Complete API documentation
175
202
 
@@ -201,6 +228,7 @@ pre-commit install
201
228
  ### Code Quality
202
229
 
203
230
  This project uses:
231
+
204
232
  - **mypy**: Strict type checking
205
233
  - **ruff**: Linting and formatting
206
234
  - **bandit**: Security analysis
@@ -235,7 +263,9 @@ pytest tests/test_winidjango/test_src/test_db/test_bulk.py
235
263
 
236
264
  ## Contributing
237
265
 
238
- Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
266
+ Contributions are welcome! Please feel free to submit a Pull Request.
267
+ For major changes, please open an issue first
268
+ to discuss what you would like to change.
239
269
 
240
270
  1. Fork the repository
241
271
  2. Create your feature branch (`git checkout -b feature/amazing-feature`)
@@ -245,7 +275,8 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
245
275
 
246
276
  ## License
247
277
 
248
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
278
+ This project is licensed under the MIT License,
279
+ see the [LICENSE](LICENSE) file for details.
249
280
 
250
281
  ## Acknowledgments
251
282
 
@@ -1,10 +1,12 @@
1
- winidjango/__init__.py,sha256=pxCy4ywQWxN3MKjm9U2vcIDz-nsvDLgNzsE9IOq15DQ,823
1
+ winidjango/__init__.py,sha256=cbh5Y743eDQHW25CF2WyW6EM_CGEK5jU9bBBwtoqbVA,973
2
2
  winidjango/dev/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
3
3
  winidjango/dev/builders/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
4
4
  winidjango/dev/cli/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
5
+ winidjango/dev/cli/shared_subcommands.py,sha256=3sJl1DD-DVRok2BXFWjncF_NLnMZL_NLqMWozmQm390,365
5
6
  winidjango/dev/cli/subcommands.py,sha256=iurWZwJwEKAfGpfjkn1YOhnRbIruCB4ouE-8R_Lh3JY,228
6
7
  winidjango/dev/configs/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
7
8
  winidjango/dev/configs/configs.py,sha256=N85kVaRHCHXc-ny0jbuYQwTcrxQJx_X_BcG30IcyrGw,586
9
+ winidjango/dev/management/__init__.py,sha256=dZm5jWpCTZl7I44Ykr6S1_yU4ATNG5evtUL3DmGjCLs,193
8
10
  winidjango/dev/tests/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
9
11
  winidjango/dev/tests/fixtures/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
10
12
  winidjango/main.py,sha256=TdxQpUtNZIiYCsEdysMlQW-1UNy0__WTax-Ot5E2eYQ,144
@@ -20,8 +22,8 @@ winidjango/src/db/bulk.py,sha256=5mJyGyt3vtu8cf-xji3dd2zxAU5eH0tuV85RjXIMriw,201
20
22
  winidjango/src/db/fields.py,sha256=sa_qe36rQoh7zzsgbadsREKYOqzgx0WDar5tPdZ4rpE,2098
21
23
  winidjango/src/db/models.py,sha256=LBdN1pbG4jp_yy_pEKdXxNd05ZXAVCkj7srvO-UE1vw,5750
22
24
  winidjango/src/db/sql.py,sha256=MMiJyc8uhJ_4VcN2s6i8koNfvDKxsSv3Gpb_kD-01IE,1638
23
- winidjango-2.0.31.dist-info/licenses/LICENSE,sha256=o316mE2gGzd__JT69p7S_zlOmKiHh8YjpImCCcWyTvM,1066
24
- winidjango-2.0.31.dist-info/WHEEL,sha256=xDCZ-UyfvkGuEHPeI7BcJzYKIZzdqN8A8o1M5Om8IyA,79
25
- winidjango-2.0.31.dist-info/entry_points.txt,sha256=qM1ENsRWSLulhF8Cy92TeHW-4v8SAgzkRW7hNHXHG-4,55
26
- winidjango-2.0.31.dist-info/METADATA,sha256=s5VV6RvdhZvKXCiOTvHlsuoNPVzGKBWo-LmqGMoUNfU,8263
27
- winidjango-2.0.31.dist-info/RECORD,,
25
+ winidjango-2.0.55.dist-info/licenses/LICENSE,sha256=o316mE2gGzd__JT69p7S_zlOmKiHh8YjpImCCcWyTvM,1066
26
+ winidjango-2.0.55.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
27
+ winidjango-2.0.55.dist-info/entry_points.txt,sha256=qM1ENsRWSLulhF8Cy92TeHW-4v8SAgzkRW7hNHXHG-4,55
28
+ winidjango-2.0.55.dist-info/METADATA,sha256=yGPABM2d9y90rVLunk5I0rgS2HRRlgI1N688CODA9Ak,9209
29
+ winidjango-2.0.55.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.17
2
+ Generator: uv 0.9.21
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any