muscles 1.0.0__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.
Files changed (61) hide show
  1. muscles/__init__.py +6 -0
  2. muscles/core/Makefile +26 -0
  3. muscles/core/__about__.py +6 -0
  4. muscles/core/__init__.py +304 -0
  5. muscles/core/core/__init__.py +136 -0
  6. muscles/core/core/actions.py +452 -0
  7. muscles/core/core/application_context.py +19 -0
  8. muscles/core/core/application_proxy.py +23 -0
  9. muscles/core/core/backend_pipeline.py +246 -0
  10. muscles/core/core/configure.py +513 -0
  11. muscles/core/core/container.py +82 -0
  12. muscles/core/core/context.py +241 -0
  13. muscles/core/core/dependency.py +298 -0
  14. muscles/core/core/generator.py +43 -0
  15. muscles/core/core/heandler.py +19 -0
  16. muscles/core/core/inspection.py +187 -0
  17. muscles/core/core/instance.py +558 -0
  18. muscles/core/core/module_loader.py +22 -0
  19. muscles/core/core/package_context.py +19 -0
  20. muscles/core/core/package_lifecycle.py +451 -0
  21. muscles/core/core/registry.py +122 -0
  22. muscles/core/core/runtime_mode.py +63 -0
  23. muscles/core/core/self.py +28 -0
  24. muscles/core/core/storage.py +284 -0
  25. muscles/core/cors.py +62 -0
  26. muscles/core/errors.py +83 -0
  27. muscles/core/exceptions.py +79 -0
  28. muscles/core/lifecycle.py +2 -0
  29. muscles/core/response/__init__.py +17 -0
  30. muscles/core/response/base.py +28 -0
  31. muscles/core/response/bytes.py +19 -0
  32. muscles/core/response/file.py +31 -0
  33. muscles/core/response/html.py +13 -0
  34. muscles/core/response/json.py +17 -0
  35. muscles/core/response/no_content.py +13 -0
  36. muscles/core/response/normalize.py +40 -0
  37. muscles/core/route_contract.py +79 -0
  38. muscles/core/schema/__init__.py +99 -0
  39. muscles/core/schema/collection.py +15 -0
  40. muscles/core/schema/column.py +192 -0
  41. muscles/core/schema/exception.py +8 -0
  42. muscles/core/schema/field.py +681 -0
  43. muscles/core/schema/group.py +43 -0
  44. muscles/core/schema/itinerary.py +980 -0
  45. muscles/core/schema/model.py +251 -0
  46. muscles/core/schema/openapi.py +126 -0
  47. muscles/core/schema/parameters.py +105 -0
  48. muscles/core/schema/pydantic_bridge.py +60 -0
  49. muscles/core/schema/request.py +167 -0
  50. muscles/core/schema/response.py +133 -0
  51. muscles/core/schema/schema.py +62 -0
  52. muscles/core/schema/security.py +152 -0
  53. muscles/core/schema/swagger.py +96 -0
  54. muscles/core/schema/user.py +58 -0
  55. muscles/core/schema/value_object.py +245 -0
  56. muscles/core/utils/__init__.py +8 -0
  57. muscles/core/utils/watchdog.py +69 -0
  58. muscles/lifecycle.py +1 -0
  59. muscles-1.0.0.dist-info/METADATA +420 -0
  60. muscles-1.0.0.dist-info/RECORD +61 -0
  61. muscles-1.0.0.dist-info/WHEEL +4 -0
muscles/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ from pkgutil import extend_path
2
+
3
+ from .core import *
4
+
5
+
6
+ __path__ = extend_path(__path__, __name__)
muscles/core/Makefile ADDED
@@ -0,0 +1,26 @@
1
+ # Makefile
2
+
3
+ start:
4
+ docker-compose up -d
5
+ docker exec -it butkoinfo_core_1 bash
6
+
7
+
8
+ stop:
9
+ docker-compose up -d
10
+ docker exec -it butkoinfo-core-1 bash
11
+
12
+
13
+ console:
14
+ docker exec -it butkoinfo_core_1 bash
15
+
16
+
17
+ logs:
18
+ docker-compose logs
19
+
20
+
21
+ develop:
22
+ #docker exec -it butkoinfo_core_1 pipenv install
23
+ pipenv run python setup.py develop
24
+ pipenv install
25
+
26
+
@@ -0,0 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+ __name__ = "Muscles Framework"
3
+ __version__ = "1.0.0"
4
+ __description__ = (
5
+ "Muscles Framework"
6
+ )
@@ -0,0 +1,304 @@
1
+ from .core import Configurator
2
+ from .core import BaseStrategy, Context
3
+ from .core import DependencyStorage, Dependency, inject
4
+ from .core import DependencyContainer, DependencyScope, BackendPipeline, RoutePermissionChecker
5
+ from .core import ResponseHandler, BaseResponseHandler
6
+ from .core import Self
7
+ from .core import storageMapper, Storage, StorageStrategy, StorageMapper
8
+ from .core import Application, ApplicationMeta, PackageMeta
9
+ from .core import RuntimeMode, resolve_runtime_mode, app_runtime_mode, is_development, is_test, is_production
10
+ from .core import inspect_application
11
+ from .core import GenerationRequest, GeneratorProvider, GeneratorRegistry
12
+ from .core import ApplicationRegistry, get_application_registry
13
+ from .core import MusclesPackage, NoopTelemetry, PackageService, TelemetryProvider
14
+ from .core import collect_package_capabilities, collect_packages, doctor_application, ensure_container
15
+ from .core import install_package, resolve_package_config, resolve_telemetry, sanitize_payload
16
+ from .core import ActionContext, ActionContract, ActionDispatcher, ActionResult, ApplicationContract
17
+ from .core import ActionError, ActionExecutionError, ActionNotFound, ActionPermissionDenied, ActionValidationError
18
+ from .core import StreamEvent, StreamResult, coerce_stream_event, stream_events
19
+ from .core import action, dispatch_action, register_action
20
+ from .core import get_package, set_package, reset_package
21
+ from .core import get_application, set_application, reset_application
22
+ from .core import application
23
+ from .response import BaseResponse, BytesResponse, FileResponse, JsonResponse, HtmlResponse, NoContentResponse, normalize_response
24
+ from .errors import normalize_problem_payload
25
+ from .cors import CorsMiddleware, cors
26
+ from .route_contract import (
27
+ CANONICAL_ALIASES,
28
+ CANONICAL_ROUTES,
29
+ canonical_alias_pairs,
30
+ build_route_aliases,
31
+ normalize_path,
32
+ )
33
+ from .schema import Schema
34
+ from .schema import to_openapi_schema
35
+ from .schema import ResponseBody
36
+ from .schema import JsonResponseBody
37
+ from .schema import XmlResponseBody
38
+ from .schema import HtmlResponseBody
39
+ from .schema import TextResponseBody
40
+ from .schema import ResponseBody
41
+ from .schema import BaseSecurity
42
+ from .schema import BasicAuthSecurity
43
+ from .schema import BearerAuthSecurity
44
+ from .schema import BearerJwtAuth
45
+ from .schema import ApiKeyAuthSecurity
46
+ from .schema import RequestBody
47
+ from .schema import JsonRequestBody
48
+ from .schema import XmlRequestBody
49
+ from .schema import FormRequestBody
50
+ from .schema import FileRequestBody
51
+ from .schema import MultipartRequestBody
52
+ from .schema import TextRequestBody
53
+ from .schema import PayloadRequestBody
54
+ from .schema import PathParameter
55
+ from .schema import BaseParameter
56
+ from .schema import FormParameter
57
+ from .schema import QueryParameter
58
+ from .schema import CookieParameter
59
+ from .schema import Itinerary
60
+ from .schema import BaseColumn
61
+ from .schema import Column
62
+ from .schema import BaseCollection
63
+ from .schema import Collection
64
+ from .schema import Swagger
65
+ from .schema import BaseModel
66
+ from .schema import Model
67
+ from .schema import BaseUser
68
+ from .schema import RobotUser
69
+ from .schema import SystemUser
70
+ from .schema import GuestUser
71
+ from .schema import User
72
+ from .schema import Numeric
73
+ from .schema import Boolean
74
+ from .schema import List
75
+ from .schema import Email
76
+ from .schema import Phone
77
+ from .schema import ValueObject
78
+ from .schema import EmailValue
79
+ from .schema import PhoneValue
80
+ from .schema import DateRangeValue
81
+ from .schema import NonEmptyStringValue
82
+ from .schema import SlugValue
83
+ from .schema import UrlValue
84
+ from .schema import CountryCodeValue
85
+ from .schema import PercentageValue
86
+ from .schema import MoneyValue
87
+ from .schema import UtcDateTimeValue
88
+ from .schema import DateTimeRangeValue
89
+ from .schema import ValueObjectField
90
+ from .schema import Time
91
+ from .schema import Enum
92
+ from .schema import Float
93
+ from .schema import Double
94
+ from .schema import Binary
95
+ from .schema import Json
96
+ from .schema import String
97
+ from .schema import SmallInteger
98
+ from .schema import Integer
99
+ from .schema import Date
100
+ from .schema import File
101
+ from .schema import Text
102
+ from .schema import DateTime
103
+ from .schema import Timestamp
104
+ from .schema import BigInteger
105
+ from .schema import UUID4
106
+ from .schema import Key
107
+ from .schema import HeaderParameter
108
+ from .utils import Watchdog
109
+ from .utils import WatchdogHandlerInterface
110
+ from .core import StorageInterface
111
+ from .core import EventsStorageInterface
112
+ from .core import EventsStorage
113
+ from .core import ModuleLoader
114
+ from .exceptions import ApplicationException
115
+ from .exceptions import AccessDeniedException
116
+ from .exceptions import RequestErrorException
117
+ from .exceptions import ErrorException
118
+ from .exceptions import NotFoundException
119
+ from .exceptions import IsExistsException
120
+ from .exceptions import UpdateErrorException
121
+ from .exceptions import InsertErrorException
122
+ from .exceptions import NotAuthenticationException
123
+ from .exceptions import AttributeErrorException
124
+ from .exceptions import ModelException
125
+
126
+
127
+ __all__ = (
128
+ "ApplicationException",
129
+ "AccessDeniedException",
130
+ "RequestErrorException",
131
+ "ErrorException",
132
+ "NotFoundException",
133
+ "IsExistsException",
134
+ "UpdateErrorException",
135
+ "InsertErrorException",
136
+ "NotAuthenticationException",
137
+ "AttributeErrorException",
138
+ "ModelException",
139
+ "StorageInterface",
140
+ "EventsStorageInterface",
141
+ "EventsStorage",
142
+ "WatchdogHandlerInterface",
143
+ "Watchdog",
144
+ "Boolean",
145
+ "List",
146
+ "Email",
147
+ "Phone",
148
+ "ValueObject",
149
+ "EmailValue",
150
+ "PhoneValue",
151
+ "DateRangeValue",
152
+ "NonEmptyStringValue",
153
+ "SlugValue",
154
+ "UrlValue",
155
+ "CountryCodeValue",
156
+ "PercentageValue",
157
+ "MoneyValue",
158
+ "UtcDateTimeValue",
159
+ "DateTimeRangeValue",
160
+ "ValueObjectField",
161
+ "Time",
162
+ "Enum",
163
+ "Float",
164
+ "Double",
165
+ "Binary",
166
+ "Json",
167
+ "String",
168
+ "Numeric",
169
+ "SmallInteger",
170
+ "Integer",
171
+ "Date",
172
+ "Column",
173
+ "Collection",
174
+ "File",
175
+ "Text",
176
+ "DateTime",
177
+ "Timestamp",
178
+ "BigInteger",
179
+ "UUID4",
180
+ "Key",
181
+ "Configurator",
182
+ "BaseStrategy",
183
+ "Context",
184
+ "DependencyStorage",
185
+ "Dependency",
186
+ "inject",
187
+ "DependencyContainer",
188
+ "DependencyScope",
189
+ "BackendPipeline",
190
+ "RoutePermissionChecker",
191
+ "BaseResponseHandler",
192
+ "ResponseHandler",
193
+ "Self",
194
+ "Storage",
195
+ "StorageStrategy",
196
+ "StorageMapper",
197
+ "storageMapper",
198
+ "Application",
199
+ "ApplicationMeta",
200
+ "PackageMeta",
201
+ "RuntimeMode",
202
+ "resolve_runtime_mode",
203
+ "app_runtime_mode",
204
+ "is_development",
205
+ "is_test",
206
+ "is_production",
207
+ "inspect_application",
208
+ "ApplicationRegistry",
209
+ "get_application_registry",
210
+ "ActionContext",
211
+ "ActionContract",
212
+ "ActionDispatcher",
213
+ "ActionResult",
214
+ "ActionError",
215
+ "ActionExecutionError",
216
+ "ActionNotFound",
217
+ "ActionPermissionDenied",
218
+ "ActionValidationError",
219
+ "ApplicationContract",
220
+ "StreamEvent",
221
+ "StreamResult",
222
+ "coerce_stream_event",
223
+ "stream_events",
224
+ "action",
225
+ "dispatch_action",
226
+ "register_action",
227
+ "GenerationRequest",
228
+ "GeneratorProvider",
229
+ "GeneratorRegistry",
230
+ "MusclesPackage",
231
+ "NoopTelemetry",
232
+ "PackageService",
233
+ "TelemetryProvider",
234
+ "collect_package_capabilities",
235
+ "collect_packages",
236
+ "doctor_application",
237
+ "ensure_container",
238
+ "install_package",
239
+ "resolve_package_config",
240
+ "resolve_telemetry",
241
+ "sanitize_payload",
242
+ "BaseResponse",
243
+ "BytesResponse",
244
+ "FileResponse",
245
+ "JsonResponse",
246
+ "HtmlResponse",
247
+ "NoContentResponse",
248
+ "normalize_response",
249
+ "normalize_problem_payload",
250
+ "CorsMiddleware",
251
+ "cors",
252
+ "Schema",
253
+ "ResponseBody",
254
+ "JsonResponseBody",
255
+ "XmlResponseBody",
256
+ "HtmlResponseBody",
257
+ "TextResponseBody",
258
+ "build_route_aliases",
259
+ "canonical_alias_pairs",
260
+ "normalize_path",
261
+ "CANONICAL_ROUTES",
262
+ "CANONICAL_ALIASES",
263
+ "ResponseBody",
264
+ "BaseSecurity",
265
+ "BasicAuthSecurity",
266
+ "BearerAuthSecurity",
267
+ "BearerJwtAuth",
268
+ "ApiKeyAuthSecurity",
269
+ "RequestBody",
270
+ "JsonRequestBody",
271
+ "XmlRequestBody",
272
+ "FormRequestBody",
273
+ "FileRequestBody",
274
+ "MultipartRequestBody",
275
+ "TextRequestBody",
276
+ "PayloadRequestBody",
277
+ "HeaderParameter",
278
+ "PathParameter",
279
+ "BaseParameter",
280
+ "FormParameter",
281
+ "QueryParameter",
282
+ "CookieParameter",
283
+ "Itinerary",
284
+ "BaseColumn",
285
+ "Column",
286
+ "BaseCollection",
287
+ "Collection",
288
+ "Swagger",
289
+ "BaseModel",
290
+ "Model",
291
+ "BaseUser",
292
+ "RobotUser",
293
+ "SystemUser",
294
+ "GuestUser",
295
+ "User",
296
+ "get_package",
297
+ "set_package",
298
+ "reset_package",
299
+ "ModuleLoader",
300
+ "get_application",
301
+ "set_application",
302
+ "reset_application",
303
+ "application"
304
+ )
@@ -0,0 +1,136 @@
1
+ from .configure import Configurator
2
+ from .context import BaseStrategy, Context
3
+ from .dependency import DependencyStorage, Dependency, inject
4
+ from .container import DependencyContainer, DependencyScope
5
+ from .backend_pipeline import BackendPipeline, RoutePermissionChecker
6
+ from .heandler import ResponseHandler, BaseResponseHandler
7
+ from .self import Self
8
+ from .storage import storageMapper, Storage, StorageStrategy, StorageMapper
9
+ from .instance import Application, ApplicationMeta, PackageMeta
10
+ from .instance import StorageInterface, EventsStorageInterface, EventsStorage
11
+ from .runtime_mode import RuntimeMode
12
+ from .runtime_mode import resolve_runtime_mode
13
+ from .runtime_mode import app_runtime_mode
14
+ from .runtime_mode import is_development
15
+ from .runtime_mode import is_test
16
+ from .runtime_mode import is_production
17
+ from .inspection import inspect_application
18
+ from .generator import GenerationRequest, GeneratorProvider, GeneratorRegistry
19
+ from .registry import ApplicationRegistry, get_application_registry
20
+ from .package_context import get_package, set_package, reset_package
21
+ from .application_proxy import application
22
+ from .application_context import (
23
+ get_application,
24
+ set_application,
25
+ reset_application,
26
+ )
27
+ from .module_loader import ModuleLoader
28
+ from .package_lifecycle import (
29
+ MusclesPackage,
30
+ NoopTelemetry,
31
+ PackageService,
32
+ TelemetryProvider,
33
+ collect_package_capabilities,
34
+ collect_packages,
35
+ doctor_application,
36
+ ensure_container,
37
+ install_package,
38
+ resolve_package_config,
39
+ resolve_telemetry,
40
+ sanitize_payload,
41
+ )
42
+ from .actions import (
43
+ ActionContext,
44
+ ActionContract,
45
+ ActionDispatcher,
46
+ ActionError,
47
+ ActionExecutionError,
48
+ ActionNotFound,
49
+ ActionPermissionDenied,
50
+ ActionResult,
51
+ ActionValidationError,
52
+ ApplicationContract,
53
+ StreamEvent,
54
+ StreamResult,
55
+ coerce_stream_event,
56
+ stream_events,
57
+ action,
58
+ dispatch_action,
59
+ register_action,
60
+ )
61
+
62
+
63
+ __all__ = (
64
+ "StorageInterface",
65
+ "EventsStorageInterface",
66
+ "EventsStorage",
67
+ "Configurator",
68
+ "BaseStrategy",
69
+ "Context",
70
+ "DependencyStorage",
71
+ "Dependency",
72
+ "inject",
73
+ "DependencyContainer",
74
+ "DependencyScope",
75
+ "BackendPipeline",
76
+ "RoutePermissionChecker",
77
+ "BaseResponseHandler",
78
+ "ResponseHandler",
79
+ "Self",
80
+ "Storage",
81
+ "StorageStrategy",
82
+ "StorageMapper",
83
+ "storageMapper",
84
+ "Application",
85
+ "ApplicationMeta",
86
+ "PackageMeta",
87
+ "RuntimeMode",
88
+ "resolve_runtime_mode",
89
+ "app_runtime_mode",
90
+ "is_development",
91
+ "is_test",
92
+ "is_production",
93
+ "inspect_application",
94
+ "ApplicationRegistry",
95
+ "get_application_registry",
96
+ "ActionContext",
97
+ "ActionContract",
98
+ "ActionDispatcher",
99
+ "ActionError",
100
+ "ActionExecutionError",
101
+ "ActionNotFound",
102
+ "ActionPermissionDenied",
103
+ "ActionResult",
104
+ "ActionValidationError",
105
+ "ApplicationContract",
106
+ "StreamEvent",
107
+ "StreamResult",
108
+ "coerce_stream_event",
109
+ "stream_events",
110
+ "action",
111
+ "dispatch_action",
112
+ "register_action",
113
+ "GenerationRequest",
114
+ "GeneratorProvider",
115
+ "GeneratorRegistry",
116
+ "MusclesPackage",
117
+ "NoopTelemetry",
118
+ "PackageService",
119
+ "TelemetryProvider",
120
+ "collect_package_capabilities",
121
+ "collect_packages",
122
+ "doctor_application",
123
+ "ensure_container",
124
+ "install_package",
125
+ "resolve_package_config",
126
+ "resolve_telemetry",
127
+ "sanitize_payload",
128
+ "get_package",
129
+ "set_package",
130
+ "reset_package",
131
+ "ModuleLoader",
132
+ "get_application",
133
+ "set_application",
134
+ "reset_application",
135
+ "application",
136
+ )