djangospice-framework 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.
- djangospice_framework-0.1.0/.gitattributes +2 -0
- djangospice_framework-0.1.0/.github/workflows/publish.yml +35 -0
- djangospice_framework-0.1.0/.gitignore +55 -0
- djangospice_framework-0.1.0/LICENSE +21 -0
- djangospice_framework-0.1.0/PKG-INFO +261 -0
- djangospice_framework-0.1.0/README.md +208 -0
- djangospice_framework-0.1.0/pyproject.toml +96 -0
- djangospice_framework-0.1.0/src/djangospice_framework/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/__init__.py +9 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/bootstrap.py +53 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/config.py +86 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/discovery.py +153 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/installer.py +276 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/loader.py +85 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/registry.py +110 -0
- djangospice_framework-0.1.0/src/djangospice_framework/apps/utils.py +31 -0
- djangospice_framework-0.1.0/src/djangospice_framework/container/__init__.py +9 -0
- djangospice_framework-0.1.0/src/djangospice_framework/container/contracts.py +16 -0
- djangospice_framework-0.1.0/src/djangospice_framework/container/exceptions.py +5 -0
- djangospice_framework-0.1.0/src/djangospice_framework/container/lifelines.py +3 -0
- djangospice_framework-0.1.0/src/djangospice_framework/container/registry.py +234 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/collection.py +228 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/conversion.py +17 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/entity.py +31 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/exceptions.py +15 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/formatting.py +82 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/generation.py +51 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/logging.py +10 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/mail.py +180 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/object.py +11 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/payload.py +100 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/references.py +128 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/serializable.py +92 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/serializer.py +252 -0
- djangospice_framework-0.1.0/src/djangospice_framework/core/validation.py +19 -0
- djangospice_framework-0.1.0/src/djangospice_framework/db/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/db/managers.py +24 -0
- djangospice_framework-0.1.0/src/djangospice_framework/db/mixins.py +16 -0
- djangospice_framework-0.1.0/src/djangospice_framework/db/models.py +707 -0
- djangospice_framework-0.1.0/src/djangospice_framework/db/utils.py +9 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/__init__.py +12 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/base.py +27 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/celery.py +42 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/decorators.py +21 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/dispatcher.py +54 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/listener.py +21 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/registry.py +26 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/subscriber.py +11 -0
- djangospice_framework-0.1.0/src/djangospice_framework/events/tasks.py +76 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/engine.py +55 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/exporter.py +56 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/inspection.py +28 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/reference.py +73 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/style.py +30 -0
- djangospice_framework-0.1.0/src/djangospice_framework/excel/utils.py +27 -0
- djangospice_framework-0.1.0/src/djangospice_framework/files/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/files/helpers.py +92 -0
- djangospice_framework-0.1.0/src/djangospice_framework/files/mimetypes.py +4 -0
- djangospice_framework-0.1.0/src/djangospice_framework/files/path.py +20 -0
- djangospice_framework-0.1.0/src/djangospice_framework/files/storage.py +73 -0
- djangospice_framework-0.1.0/src/djangospice_framework/filters/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/filters/base.py +26 -0
- djangospice_framework-0.1.0/src/djangospice_framework/filters/helpers.py +74 -0
- djangospice_framework-0.1.0/src/djangospice_framework/forms/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/forms/fields.py +27 -0
- djangospice_framework-0.1.0/src/djangospice_framework/forms/import.py +11 -0
- djangospice_framework-0.1.0/src/djangospice_framework/forms/mixins.py +33 -0
- djangospice_framework-0.1.0/src/djangospice_framework/html/attributes.py +301 -0
- djangospice_framework-0.1.0/src/djangospice_framework/html/component.py +149 -0
- djangospice_framework-0.1.0/src/djangospice_framework/html/fragments.py +126 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/__init__.py +8 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/base.py +95 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/broadcast.py +30 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/celery.py +70 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/consumers.py +28 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/dispatcher.py +53 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/enums.py +10 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/events.py +30 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/handle.py +139 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/listeners.py +48 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/reporter.py +79 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/result.py +10 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/routing.py +6 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/tasks.py +15 -0
- djangospice_framework-0.1.0/src/djangospice_framework/jobs/worker.py +66 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/__init__.py +5 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/broadcast.py +130 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/channels.py +57 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/consumers.py +202 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/groups.py +67 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/scopes.py +8 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/serializers.py +18 -0
- djangospice_framework-0.1.0/src/djangospice_framework/realtime/shortcuts.py +30 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/__init__.py +18 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/base.py +112 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/config.py +18 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/exports/__init__.py +6 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/exports/exporter.py +58 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/exports/job.py +45 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/imports/__init__.py +3 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/imports/dataset.py +44 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/imports/job.py +55 -0
- djangospice_framework-0.1.0/src/djangospice_framework/resources/widgets.py +53 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/conf.py +26 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/defaults.py +16 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/document.py +15 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/event.py +81 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/exceptions.py +10 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/headers.py +238 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/location.py +22 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/middleware.py +12 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/registry.py +278 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/__init__.py +13 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/base.py +82 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/html.py +87 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/htmx.py +66 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/json.py +63 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/renderers/text.py +63 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/response.py +154 -0
- djangospice_framework-0.1.0/src/djangospice_framework/response/shortcuts.py +15 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/__init__.py +0 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/shortcuts.py +31 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/sites.py +36 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/templates.py +11 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/urls.py +141 -0
- djangospice_framework-0.1.0/src/djangospice_framework/web/utils.py +19 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
url: https://pypi.org/p/djangospice_framework
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.x"
|
|
27
|
+
|
|
28
|
+
- name: Install build
|
|
29
|
+
run: python -m pip install --upgrade build
|
|
30
|
+
|
|
31
|
+
- name: Build package
|
|
32
|
+
run: python -m build
|
|
33
|
+
|
|
34
|
+
- name: Publish to PyPI
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
|
|
6
|
+
# Virtual environments
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
ENV/
|
|
10
|
+
|
|
11
|
+
# Packaging
|
|
12
|
+
build/
|
|
13
|
+
dist/
|
|
14
|
+
*.egg-info/
|
|
15
|
+
*.egg
|
|
16
|
+
|
|
17
|
+
# Testing / coverage
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.coverage
|
|
20
|
+
.coverage.*
|
|
21
|
+
htmlcov/
|
|
22
|
+
.tox/
|
|
23
|
+
|
|
24
|
+
# Type checking / linters
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|
|
27
|
+
|
|
28
|
+
# Environment / secrets
|
|
29
|
+
.env
|
|
30
|
+
.env.*
|
|
31
|
+
*.pem
|
|
32
|
+
|
|
33
|
+
# IDEs / editors
|
|
34
|
+
.vscode/
|
|
35
|
+
*.code-workspace
|
|
36
|
+
.idea/
|
|
37
|
+
|
|
38
|
+
# OS files
|
|
39
|
+
.DS_Store
|
|
40
|
+
.AppleDouble
|
|
41
|
+
.Trashes
|
|
42
|
+
Thumbs.db
|
|
43
|
+
Desktop.ini
|
|
44
|
+
$RECYCLE.BIN/
|
|
45
|
+
|
|
46
|
+
# Jupyter
|
|
47
|
+
.ipynb_checkpoints/
|
|
48
|
+
|
|
49
|
+
# Documentation
|
|
50
|
+
docs/_build/
|
|
51
|
+
|
|
52
|
+
# Misc
|
|
53
|
+
*.log
|
|
54
|
+
*.tmp
|
|
55
|
+
*~
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 briansimpo
|
|
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,261 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: djangospice-framework
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Application Runtime Framework for building Django apps.
|
|
5
|
+
Project-URL: Homepage, https://github.com/briansimpo/djangospice_framework
|
|
6
|
+
Project-URL: Documentation, https://github.com/briansimpo/djangospice_framework#readme
|
|
7
|
+
Project-URL: Source, https://github.com/briansimpo/djangospice_framework
|
|
8
|
+
Project-URL: Issues, https://github.com/briansimpo/djangospice_framework/issues
|
|
9
|
+
Author-email: Brian Simpokolwe <briansimpokolwe@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: django,djangospice_framework,framework,modular,runtime
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Framework :: Django
|
|
15
|
+
Classifier: Framework :: Django :: 5
|
|
16
|
+
Classifier: Framework :: Django :: 6
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Education
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
26
|
+
Requires-Python: >=3.12
|
|
27
|
+
Requires-Dist: asgiref>=3.8
|
|
28
|
+
Requires-Dist: celery>=5.4
|
|
29
|
+
Requires-Dist: channels-redis>=4.2
|
|
30
|
+
Requires-Dist: channels>=4.1
|
|
31
|
+
Requires-Dist: django-celery-beat>=2.6
|
|
32
|
+
Requires-Dist: django-filter>=24.0
|
|
33
|
+
Requires-Dist: django-import-export>=4.2
|
|
34
|
+
Requires-Dist: django-model-utils>=4.5
|
|
35
|
+
Requires-Dist: django-tables2>=2.7
|
|
36
|
+
Requires-Dist: django>=5.0
|
|
37
|
+
Requires-Dist: djangorestframework>=3.15
|
|
38
|
+
Requires-Dist: openpyxl>=3.1
|
|
39
|
+
Requires-Dist: premailer>=3.10
|
|
40
|
+
Requires-Dist: psycopg[binary]>=3.1
|
|
41
|
+
Requires-Dist: python-slugify>=8.0
|
|
42
|
+
Requires-Dist: semver>=3.0
|
|
43
|
+
Requires-Dist: setuptools>=80.9
|
|
44
|
+
Requires-Dist: tablib[all]>=3.7
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: black; extra == 'dev'
|
|
47
|
+
Requires-Dist: coverage; extra == 'dev'
|
|
48
|
+
Requires-Dist: isort; extra == 'dev'
|
|
49
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
50
|
+
Requires-Dist: pytest-django; extra == 'dev'
|
|
51
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
52
|
+
Description-Content-Type: text/markdown
|
|
53
|
+
|
|
54
|
+
# djangospice_framework
|
|
55
|
+
|
|
56
|
+
**Application Runtime Framework for building Django apps**
|
|
57
|
+
|
|
58
|
+
`djangospice_framework` is the application runtime for building modular Django applications.
|
|
59
|
+
|
|
60
|
+
It is designed to provide a consistent foundation for building large Django application ecosystems without repeatedly implementing the same infrastructure in every application.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Why djangospice_framework?
|
|
65
|
+
|
|
66
|
+
Large Django projects often accumulate infrastructure that gets duplicated across applications.
|
|
67
|
+
|
|
68
|
+
For example, individual applications may independently implement:
|
|
69
|
+
|
|
70
|
+
* Base models
|
|
71
|
+
* Event dispatching
|
|
72
|
+
* Job handling
|
|
73
|
+
* File handling
|
|
74
|
+
* Import/export pipelines
|
|
75
|
+
* Realtime broadcasting
|
|
76
|
+
* Common service abstractions
|
|
77
|
+
|
|
78
|
+
djangospice_framework provides these capabilities as a shared runtime.
|
|
79
|
+
|
|
80
|
+
This gives applications a common architecture and allows modules to remain focused on their actual domain.
|
|
81
|
+
|
|
82
|
+
### Design goals
|
|
83
|
+
|
|
84
|
+
djangospice_framework is designed around several principles:
|
|
85
|
+
|
|
86
|
+
* **Reusable** — common functionality should be implemented once.
|
|
87
|
+
* **Modular** — functionality should be composed through independent components.
|
|
88
|
+
* **Extensible** — applications should be able to replace or extend framework behavior.
|
|
89
|
+
* **Django-native** — use Django's existing ecosystem rather than reinventing it.
|
|
90
|
+
* **Developer-friendly** — common application infrastructure should require minimal boilerplate.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
Install djangospice_framework from PyPI:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install djangospice_framework
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Basic Usage
|
|
105
|
+
|
|
106
|
+
Once installed, djangospice_framework components can be imported by Django applications and modules.
|
|
107
|
+
|
|
108
|
+
For example, using the common model infrastructure:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from djangospice_framework.db.models import BaseModel
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class Customer(BaseModel):
|
|
115
|
+
name = models.CharField(max_length=255)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The exact capabilities available depend on the components being used by the application.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
# Core Components
|
|
123
|
+
|
|
124
|
+
djangospice_framework is organized around reusable infrastructure rather than business-domain applications.
|
|
125
|
+
|
|
126
|
+
## Database and Models
|
|
127
|
+
|
|
128
|
+
Common Django model abstractions provide a consistent foundation for application models.
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from djangospice_framework.db.models import BaseModel
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The database layer is intended to eliminate repetitive model infrastructure while preserving normal Django ORM behavior.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Events
|
|
139
|
+
|
|
140
|
+
The event system provides a decoupled mechanism for applications to communicate.
|
|
141
|
+
|
|
142
|
+
Instead of tightly coupling one application component to another, a component can dispatch an event and allow listeners to react to it.
|
|
143
|
+
|
|
144
|
+
Conceptually:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
Application Action
|
|
148
|
+
│
|
|
149
|
+
▼
|
|
150
|
+
Event
|
|
151
|
+
│
|
|
152
|
+
├── Listener
|
|
153
|
+
├── Listener
|
|
154
|
+
└── Listener
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This allows functionality such as notifications, auditing, integrations, and background processing to be attached without modifying the original application logic.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Broadcasting and Realtime Communication
|
|
162
|
+
|
|
163
|
+
The runtime provides abstractions for broadcasting application events and data to users or groups.
|
|
164
|
+
|
|
165
|
+
For example:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
Broadcast.everyone(...)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
or:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
Broadcast.user(user, ...)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This infrastructure can be used by applications that need realtime updates through WebSockets or other supported transports.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Async Support
|
|
182
|
+
|
|
183
|
+
The runtime provides common abstractions for asynchronous application functionality.
|
|
184
|
+
|
|
185
|
+
This allows modules to use async operations where appropriate while keeping common infrastructure in one place.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Files
|
|
190
|
+
|
|
191
|
+
djangospice_framework provides common abstractions for file-related functionality, allowing applications to work with files without repeatedly implementing storage and file-handling patterns.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Imports and Exports
|
|
196
|
+
|
|
197
|
+
Reusable import/export infrastructure allows applications to implement data exchange consistently.
|
|
198
|
+
|
|
199
|
+
Typical use cases include:
|
|
200
|
+
|
|
201
|
+
* CSV imports
|
|
202
|
+
* Spreadsheet imports
|
|
203
|
+
* Data exports
|
|
204
|
+
* Bulk operations
|
|
205
|
+
* Integration pipelines
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
# Application Modules
|
|
210
|
+
|
|
211
|
+
djangospice_framework is **not intended to be a standalone business application**.
|
|
212
|
+
|
|
213
|
+
Instead, it provides the runtime used by applications and modules.
|
|
214
|
+
|
|
215
|
+
For example:
|
|
216
|
+
|
|
217
|
+
```text
|
|
218
|
+
djangospice_framework
|
|
219
|
+
│
|
|
220
|
+
├── billing
|
|
221
|
+
├── notification
|
|
222
|
+
├── workflow
|
|
223
|
+
├── documents
|
|
224
|
+
├── helpdesk
|
|
225
|
+
├── CRM
|
|
226
|
+
├── workforce
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Each application can depend on the common runtime while retaining responsibility for its own domain.
|
|
230
|
+
|
|
231
|
+
This keeps domain logic out of the framework.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
# Example
|
|
236
|
+
|
|
237
|
+
A module can build its domain logic on top of djangospice_framework:
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from djangospice_framework.db.models import BaseModel
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class Invoice(BaseModel):
|
|
244
|
+
number = models.CharField(max_length=50, unique=True)
|
|
245
|
+
amount = models.DecimalField(
|
|
246
|
+
max_digits=12,
|
|
247
|
+
decimal_places=2,
|
|
248
|
+
)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The module can then use other djangospice_framework infrastructure for events, notifications, UI, HTTP responses, tables, files, and other common functionality.
|
|
252
|
+
|
|
253
|
+
The result is a module that contains primarily **business/domain logic**, rather than infrastructure boilerplate.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
# License
|
|
258
|
+
|
|
259
|
+
This package is licensed under the **MIT License**.
|
|
260
|
+
|
|
261
|
+
See [LICENSE](LICENSE) for the full license text.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# djangospice_framework
|
|
2
|
+
|
|
3
|
+
**Application Runtime Framework for building Django apps**
|
|
4
|
+
|
|
5
|
+
`djangospice_framework` is the application runtime for building modular Django applications.
|
|
6
|
+
|
|
7
|
+
It is designed to provide a consistent foundation for building large Django application ecosystems without repeatedly implementing the same infrastructure in every application.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why djangospice_framework?
|
|
12
|
+
|
|
13
|
+
Large Django projects often accumulate infrastructure that gets duplicated across applications.
|
|
14
|
+
|
|
15
|
+
For example, individual applications may independently implement:
|
|
16
|
+
|
|
17
|
+
* Base models
|
|
18
|
+
* Event dispatching
|
|
19
|
+
* Job handling
|
|
20
|
+
* File handling
|
|
21
|
+
* Import/export pipelines
|
|
22
|
+
* Realtime broadcasting
|
|
23
|
+
* Common service abstractions
|
|
24
|
+
|
|
25
|
+
djangospice_framework provides these capabilities as a shared runtime.
|
|
26
|
+
|
|
27
|
+
This gives applications a common architecture and allows modules to remain focused on their actual domain.
|
|
28
|
+
|
|
29
|
+
### Design goals
|
|
30
|
+
|
|
31
|
+
djangospice_framework is designed around several principles:
|
|
32
|
+
|
|
33
|
+
* **Reusable** — common functionality should be implemented once.
|
|
34
|
+
* **Modular** — functionality should be composed through independent components.
|
|
35
|
+
* **Extensible** — applications should be able to replace or extend framework behavior.
|
|
36
|
+
* **Django-native** — use Django's existing ecosystem rather than reinventing it.
|
|
37
|
+
* **Developer-friendly** — common application infrastructure should require minimal boilerplate.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
Install djangospice_framework from PyPI:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install djangospice_framework
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Basic Usage
|
|
52
|
+
|
|
53
|
+
Once installed, djangospice_framework components can be imported by Django applications and modules.
|
|
54
|
+
|
|
55
|
+
For example, using the common model infrastructure:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from djangospice_framework.db.models import BaseModel
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class Customer(BaseModel):
|
|
62
|
+
name = models.CharField(max_length=255)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The exact capabilities available depend on the components being used by the application.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# Core Components
|
|
70
|
+
|
|
71
|
+
djangospice_framework is organized around reusable infrastructure rather than business-domain applications.
|
|
72
|
+
|
|
73
|
+
## Database and Models
|
|
74
|
+
|
|
75
|
+
Common Django model abstractions provide a consistent foundation for application models.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from djangospice_framework.db.models import BaseModel
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The database layer is intended to eliminate repetitive model infrastructure while preserving normal Django ORM behavior.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Events
|
|
86
|
+
|
|
87
|
+
The event system provides a decoupled mechanism for applications to communicate.
|
|
88
|
+
|
|
89
|
+
Instead of tightly coupling one application component to another, a component can dispatch an event and allow listeners to react to it.
|
|
90
|
+
|
|
91
|
+
Conceptually:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Application Action
|
|
95
|
+
│
|
|
96
|
+
▼
|
|
97
|
+
Event
|
|
98
|
+
│
|
|
99
|
+
├── Listener
|
|
100
|
+
├── Listener
|
|
101
|
+
└── Listener
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This allows functionality such as notifications, auditing, integrations, and background processing to be attached without modifying the original application logic.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Broadcasting and Realtime Communication
|
|
109
|
+
|
|
110
|
+
The runtime provides abstractions for broadcasting application events and data to users or groups.
|
|
111
|
+
|
|
112
|
+
For example:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
Broadcast.everyone(...)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
or:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
Broadcast.user(user, ...)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This infrastructure can be used by applications that need realtime updates through WebSockets or other supported transports.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Async Support
|
|
129
|
+
|
|
130
|
+
The runtime provides common abstractions for asynchronous application functionality.
|
|
131
|
+
|
|
132
|
+
This allows modules to use async operations where appropriate while keeping common infrastructure in one place.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Files
|
|
137
|
+
|
|
138
|
+
djangospice_framework provides common abstractions for file-related functionality, allowing applications to work with files without repeatedly implementing storage and file-handling patterns.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Imports and Exports
|
|
143
|
+
|
|
144
|
+
Reusable import/export infrastructure allows applications to implement data exchange consistently.
|
|
145
|
+
|
|
146
|
+
Typical use cases include:
|
|
147
|
+
|
|
148
|
+
* CSV imports
|
|
149
|
+
* Spreadsheet imports
|
|
150
|
+
* Data exports
|
|
151
|
+
* Bulk operations
|
|
152
|
+
* Integration pipelines
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
# Application Modules
|
|
157
|
+
|
|
158
|
+
djangospice_framework is **not intended to be a standalone business application**.
|
|
159
|
+
|
|
160
|
+
Instead, it provides the runtime used by applications and modules.
|
|
161
|
+
|
|
162
|
+
For example:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
djangospice_framework
|
|
166
|
+
│
|
|
167
|
+
├── billing
|
|
168
|
+
├── notification
|
|
169
|
+
├── workflow
|
|
170
|
+
├── documents
|
|
171
|
+
├── helpdesk
|
|
172
|
+
├── CRM
|
|
173
|
+
├── workforce
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Each application can depend on the common runtime while retaining responsibility for its own domain.
|
|
177
|
+
|
|
178
|
+
This keeps domain logic out of the framework.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
# Example
|
|
183
|
+
|
|
184
|
+
A module can build its domain logic on top of djangospice_framework:
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
from djangospice_framework.db.models import BaseModel
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class Invoice(BaseModel):
|
|
191
|
+
number = models.CharField(max_length=50, unique=True)
|
|
192
|
+
amount = models.DecimalField(
|
|
193
|
+
max_digits=12,
|
|
194
|
+
decimal_places=2,
|
|
195
|
+
)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The module can then use other djangospice_framework infrastructure for events, notifications, UI, HTTP responses, tables, files, and other common functionality.
|
|
199
|
+
|
|
200
|
+
The result is a module that contains primarily **business/domain logic**, rather than infrastructure boilerplate.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
# License
|
|
205
|
+
|
|
206
|
+
This package is licensed under the **MIT License**.
|
|
207
|
+
|
|
208
|
+
See [LICENSE](LICENSE) for the full license text.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24.0"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "djangospice-framework"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Application Runtime Framework for building Django apps."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Brian Simpokolwe", email = "briansimpokolwe@gmail.com" }
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
keywords = [
|
|
18
|
+
"django",
|
|
19
|
+
"djangospice_framework",
|
|
20
|
+
"modular",
|
|
21
|
+
"framework",
|
|
22
|
+
"runtime"
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Development Status :: 5 - Production/Stable",
|
|
27
|
+
"Framework :: Django",
|
|
28
|
+
"Framework :: Django :: 5",
|
|
29
|
+
"Framework :: Django :: 6",
|
|
30
|
+
"Intended Audience :: Developers",
|
|
31
|
+
"License :: OSI Approved :: MIT License",
|
|
32
|
+
"Operating System :: OS Independent",
|
|
33
|
+
"Programming Language :: Python :: 3",
|
|
34
|
+
"Programming Language :: Python :: 3.10",
|
|
35
|
+
"Programming Language :: Python :: 3.11",
|
|
36
|
+
"Programming Language :: Python :: 3.12",
|
|
37
|
+
"Topic :: Education",
|
|
38
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
# --- Core Dependencies (Batteries Included) ---
|
|
42
|
+
dependencies = [
|
|
43
|
+
# Core Framework & API
|
|
44
|
+
"django>=5.0",
|
|
45
|
+
"djangorestframework>=3.15",
|
|
46
|
+
"django-filter>=24.0",
|
|
47
|
+
"django-tables2>=2.7",
|
|
48
|
+
"django-model-utils>=4.5",
|
|
49
|
+
"python-slugify>=8.0",
|
|
50
|
+
"asgiref>=3.8",
|
|
51
|
+
"semver>=3.0",
|
|
52
|
+
"setuptools>=80.9",
|
|
53
|
+
|
|
54
|
+
# Database
|
|
55
|
+
"psycopg[binary]>=3.1",
|
|
56
|
+
|
|
57
|
+
# Async & WebSockets
|
|
58
|
+
"channels>=4.1",
|
|
59
|
+
"channels-redis>=4.2",
|
|
60
|
+
|
|
61
|
+
# Background Task Processing
|
|
62
|
+
"celery>=5.4",
|
|
63
|
+
"django-celery-beat>=2.6",
|
|
64
|
+
|
|
65
|
+
# Data Import/Export & Excel Support
|
|
66
|
+
"django-import-export>=4.2",
|
|
67
|
+
"tablib[all]>=3.7",
|
|
68
|
+
"openpyxl>=3.1",
|
|
69
|
+
|
|
70
|
+
# Email Rendering
|
|
71
|
+
"premailer>=3.10",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
# --- Development Tools ---
|
|
75
|
+
[project.optional-dependencies]
|
|
76
|
+
dev = [
|
|
77
|
+
"pytest",
|
|
78
|
+
"pytest-django",
|
|
79
|
+
"coverage",
|
|
80
|
+
"black",
|
|
81
|
+
"isort",
|
|
82
|
+
"ruff",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
[project.urls]
|
|
86
|
+
Homepage = "https://github.com/briansimpo/djangospice_framework"
|
|
87
|
+
Documentation = "https://github.com/briansimpo/djangospice_framework#readme"
|
|
88
|
+
Source = "https://github.com/briansimpo/djangospice_framework"
|
|
89
|
+
Issues = "https://github.com/briansimpo/djangospice_framework/issues"
|
|
90
|
+
|
|
91
|
+
# --- Hatch Build Configuration ---
|
|
92
|
+
[tool.hatch.build.targets.wheel]
|
|
93
|
+
packages = ["src/djangospice_framework"]
|
|
94
|
+
|
|
95
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
96
|
+
"src" = ""
|
|
File without changes
|