djresttoolkit 0.16.0__tar.gz → 0.16.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.
Files changed (51) hide show
  1. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/PKG-INFO +49 -9
  2. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/README.md +48 -8
  3. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/pyproject.toml +1 -1
  4. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/.gitignore +0 -0
  5. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/LICENSE +0 -0
  6. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/demo/staticfiles/admin/img/LICENSE +0 -0
  7. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/__init__.py +0 -0
  8. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/admin.py +0 -0
  9. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/apps.py +0 -0
  10. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/dbseed/__init__.py +0 -0
  11. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/dbseed/models/__init__.py +0 -0
  12. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/dbseed/models/_choice_field.py +0 -0
  13. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/dbseed/models/_gen.py +0 -0
  14. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/dbseed/models/_seed_model.py +0 -0
  15. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/envconfig/__init__.py +0 -0
  16. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/envconfig/_env_settings.py +0 -0
  17. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/mail/__init__.py +0 -0
  18. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/mail/_email_sender.py +0 -0
  19. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/mail/_models.py +0 -0
  20. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/mail/_types.py +0 -0
  21. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/management/__init__.py +0 -0
  22. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/management/commands/__init__.py +0 -0
  23. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/management/commands/dbflush.py +0 -0
  24. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/management/commands/dbseed.py +0 -0
  25. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/middlewares/__init__.py +0 -0
  26. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/middlewares/_response_time_middleware.py +0 -0
  27. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/migrations/__init__.py +0 -0
  28. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/models/__init__.py +0 -0
  29. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/models/mixins/__init__.py +0 -0
  30. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/models/mixins/_model_choice_fields_mixin.py +0 -0
  31. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/pagination/__init__.py +0 -0
  32. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/pagination/_page_number_pagination.py +0 -0
  33. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/pagination/_paginated_data_builder.py +0 -0
  34. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/py.typed +0 -0
  35. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/renderers/__init__.py +0 -0
  36. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/renderers/_throttle_info_json_renderer.py +0 -0
  37. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/serializers/__init__.py +0 -0
  38. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/serializers/mixins/__init__.py +0 -0
  39. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/serializers/mixins/_absolute_url_file_mixin.py +0 -0
  40. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/serializers/mixins/_bulk_create_mixin.py +0 -0
  41. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/throttling/__init__.py +0 -0
  42. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/throttling/_throttle_inspector.py +0 -0
  43. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/urls/__init__.py +0 -0
  44. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/urls/_build_absolute_uri.py +0 -0
  45. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/__init__.py +0 -0
  46. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/_api_views/__init__.py +0 -0
  47. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/_api_views/_choice_fields_apiview.py +0 -0
  48. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/_exceptions/__init__.py +0 -0
  49. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/_exceptions/_exception_handler.py +0 -0
  50. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/mixins/__init__.py +0 -0
  51. {djresttoolkit-0.16.0 → djresttoolkit-0.16.1}/src/djresttoolkit/views/mixins/_retrieve_object_mixin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djresttoolkit
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: A collection of Django and DRF utilities to simplify API development.
5
5
  Project-URL: Homepage, https://github.com/shaileshpandit141/djresttoolkit
6
6
  Project-URL: Documentation, https://shaileshpandit141.github.io/djresttoolkit
@@ -64,13 +64,53 @@ Description-Content-Type: text/markdown
64
64
 
65
65
  djresttoolkit is a collection of utilities and helpers for Django and Django REST Framework (DRF) that simplify common development tasks such as API handling, authentication, and email sending and much more.
66
66
 
67
- ## Features
67
+ ## 📖 Feature Index (djresttoolkit)
68
68
 
69
- - Django REST Framework helpers (serializers, views, pagination, etc.)
70
- - Django utilities (e.g., email sending, model mixins)
71
- - Ready-to-use shortcuts to speed up API development
72
- - Lightweight, no unnecessary dependencies
73
- - Type Safe - written with modern Python type hints.
69
+ - **DB Seed Command (`dbseed`)**
70
+ Seed your database with fake data using Pydantic models powered by **Faker**. Supports relationships, transactions, and a `manage.py dbseed` command.
71
+
72
+ - **DB Flush Command (`dbflush`)**
73
+ Management command to flush all models or a specific model, resetting auto-increment IDs safely with transaction support.
74
+
75
+ - **EnvBaseSettings**
76
+ Typed settings loader using **YAML + .env**, supports nested keys and overrides. Great for structured configuration management.
77
+
78
+ - **EmailSender**
79
+ Custom class to send templated emails (`text` and `html`) with context. Supports error handling and logging.
80
+
81
+ - **Custom DRF Exception Handler**
82
+ Centralized error handler for DRF that extends default behavior and adds throttle support (`429 Too Many Requests` with retry info).
83
+
84
+ - **Response Time Middleware**
85
+ Middleware to measure, log, and inject `X-Response-Time` headers into every response.
86
+
87
+ - **Throttle**
88
+ - `ThrottleInfoJSONRenderer`: Automatically adds throttle headers to responses.
89
+ - `ThrottleInspector`: Inspect view/request throttling and attach structured headers.
90
+
91
+ - **AbsoluteUrlFileMixin**
92
+ DRF serializer mixin that converts `FileField` / `ImageField` URLs to **absolute URLs** automatically.
93
+
94
+ - **BulkCreateMixin**
95
+ Serializer mixin that enables **bulk creation** of objects and syncs field error messages with model fields.
96
+
97
+ - **ModelChoiceFieldMixin**
98
+ Retrieve choice fields (`TextChoices`, etc.) from Django models as structured dictionaries for API responses.
99
+
100
+ - **ChoiceFieldsAPIView**
101
+ Generic API view that exposes model `choices` in a REST-friendly JSON format.
102
+
103
+ - **RetrieveObjectMixin**
104
+ Lightweight mixin to fetch a single object from a queryset with filters, raising a custom error if `queryset` is not defined.
105
+
106
+ - **build\_absolute\_uri**
107
+ Helper to build full absolute URLs for named routes with optional query params. Works with Django + DRF requests.
108
+
109
+ - **PageNumberPagination**
110
+ Custom paginator with a structured `"page"` metadata block and support for dynamic `page-size` query param.
111
+
112
+ - **PaginatedDataBuilder**
113
+ Builder that combines `PageNumberPagination` + serializers to return standardized paginated responses with `"page"` + `"results"`.
74
114
 
75
115
  ## 📦 Installation
76
116
 
@@ -88,7 +128,7 @@ djresttoolkit is a collection of utilities and helpers for Django and Django RES
88
128
 
89
129
  ## 📚 All API Reference
90
130
 
91
- ### 1. DB Seed Utilities — API Reference
131
+ ### 1. DB Seed Command — API Reference
92
132
 
93
133
  #### `Generator`
94
134
 
@@ -411,7 +451,7 @@ X-Response-Time: 0.01234 seconds
411
451
  INFO: Request processed in 0.01234 seconds
412
452
  ```
413
453
 
414
- ### 7. Throttle Utilities — API Reference
454
+ ### 7. Throttle — API Reference
415
455
 
416
456
  #### `ThrottleInfoJSONRenderer`
417
457
 
@@ -6,13 +6,53 @@
6
6
 
7
7
  djresttoolkit is a collection of utilities and helpers for Django and Django REST Framework (DRF) that simplify common development tasks such as API handling, authentication, and email sending and much more.
8
8
 
9
- ## Features
9
+ ## 📖 Feature Index (djresttoolkit)
10
10
 
11
- - Django REST Framework helpers (serializers, views, pagination, etc.)
12
- - Django utilities (e.g., email sending, model mixins)
13
- - Ready-to-use shortcuts to speed up API development
14
- - Lightweight, no unnecessary dependencies
15
- - Type Safe - written with modern Python type hints.
11
+ - **DB Seed Command (`dbseed`)**
12
+ Seed your database with fake data using Pydantic models powered by **Faker**. Supports relationships, transactions, and a `manage.py dbseed` command.
13
+
14
+ - **DB Flush Command (`dbflush`)**
15
+ Management command to flush all models or a specific model, resetting auto-increment IDs safely with transaction support.
16
+
17
+ - **EnvBaseSettings**
18
+ Typed settings loader using **YAML + .env**, supports nested keys and overrides. Great for structured configuration management.
19
+
20
+ - **EmailSender**
21
+ Custom class to send templated emails (`text` and `html`) with context. Supports error handling and logging.
22
+
23
+ - **Custom DRF Exception Handler**
24
+ Centralized error handler for DRF that extends default behavior and adds throttle support (`429 Too Many Requests` with retry info).
25
+
26
+ - **Response Time Middleware**
27
+ Middleware to measure, log, and inject `X-Response-Time` headers into every response.
28
+
29
+ - **Throttle**
30
+ - `ThrottleInfoJSONRenderer`: Automatically adds throttle headers to responses.
31
+ - `ThrottleInspector`: Inspect view/request throttling and attach structured headers.
32
+
33
+ - **AbsoluteUrlFileMixin**
34
+ DRF serializer mixin that converts `FileField` / `ImageField` URLs to **absolute URLs** automatically.
35
+
36
+ - **BulkCreateMixin**
37
+ Serializer mixin that enables **bulk creation** of objects and syncs field error messages with model fields.
38
+
39
+ - **ModelChoiceFieldMixin**
40
+ Retrieve choice fields (`TextChoices`, etc.) from Django models as structured dictionaries for API responses.
41
+
42
+ - **ChoiceFieldsAPIView**
43
+ Generic API view that exposes model `choices` in a REST-friendly JSON format.
44
+
45
+ - **RetrieveObjectMixin**
46
+ Lightweight mixin to fetch a single object from a queryset with filters, raising a custom error if `queryset` is not defined.
47
+
48
+ - **build\_absolute\_uri**
49
+ Helper to build full absolute URLs for named routes with optional query params. Works with Django + DRF requests.
50
+
51
+ - **PageNumberPagination**
52
+ Custom paginator with a structured `"page"` metadata block and support for dynamic `page-size` query param.
53
+
54
+ - **PaginatedDataBuilder**
55
+ Builder that combines `PageNumberPagination` + serializers to return standardized paginated responses with `"page"` + `"results"`.
16
56
 
17
57
  ## 📦 Installation
18
58
 
@@ -30,7 +70,7 @@ djresttoolkit is a collection of utilities and helpers for Django and Django RES
30
70
 
31
71
  ## 📚 All API Reference
32
72
 
33
- ### 1. DB Seed Utilities — API Reference
73
+ ### 1. DB Seed Command — API Reference
34
74
 
35
75
  #### `Generator`
36
76
 
@@ -353,7 +393,7 @@ X-Response-Time: 0.01234 seconds
353
393
  INFO: Request processed in 0.01234 seconds
354
394
  ```
355
395
 
356
- ### 7. Throttle Utilities — API Reference
396
+ ### 7. Throttle — API Reference
357
397
 
358
398
  #### `ThrottleInfoJSONRenderer`
359
399
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  [project]
6
6
  name = "djresttoolkit"
7
- version = "0.16.0"
7
+ version = "0.16.1"
8
8
  description = "A collection of Django and DRF utilities to simplify API development."
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  license = { file = "LICENSE" }
File without changes