GeneralManager 0.15.1__py3-none-any.whl → 0.16.1__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.
Potentially problematic release.
This version of GeneralManager might be problematic. Click here for more details.
- general_manager/__init__.py +7 -29
- general_manager/_types/__init__.py +3 -0
- general_manager/_types/api.py +18 -0
- general_manager/_types/bucket.py +16 -0
- general_manager/_types/cache.py +20 -0
- general_manager/_types/factory.py +44 -0
- general_manager/_types/general_manager.py +28 -0
- general_manager/_types/interface.py +18 -0
- general_manager/_types/manager.py +18 -0
- general_manager/_types/measurement.py +16 -0
- general_manager/_types/permission.py +14 -0
- general_manager/_types/rule.py +12 -0
- general_manager/_types/utils.py +30 -0
- general_manager/api/__init__.py +8 -16
- general_manager/bucket/__init__.py +8 -12
- general_manager/cache/__init__.py +8 -18
- general_manager/factory/__init__.py +8 -14
- general_manager/interface/__init__.py +8 -16
- general_manager/manager/__init__.py +8 -16
- general_manager/measurement/__init__.py +8 -17
- general_manager/permission/__init__.py +8 -12
- general_manager/public_api_registry.py +160 -0
- general_manager/py.typed +0 -0
- general_manager/rule/__init__.py +7 -6
- general_manager/utils/__init__.py +8 -24
- {generalmanager-0.15.1.dist-info → generalmanager-0.16.1.dist-info}/METADATA +50 -84
- {generalmanager-0.15.1.dist-info → generalmanager-0.16.1.dist-info}/RECORD +30 -16
- {generalmanager-0.15.1.dist-info → generalmanager-0.16.1.dist-info}/WHEEL +0 -0
- {generalmanager-0.15.1.dist-info → generalmanager-0.16.1.dist-info}/licenses/LICENSE +0 -0
- {generalmanager-0.15.1.dist-info → generalmanager-0.16.1.dist-info}/top_level.txt +0 -0
general_manager/__init__.py
CHANGED
|
@@ -2,39 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import GENERAL_MANAGER_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
"GraphQL",
|
|
11
|
-
"GeneralManager",
|
|
12
|
-
"GeneralManagerMeta",
|
|
13
|
-
"Input",
|
|
14
|
-
"graphQlProperty",
|
|
15
|
-
"graphQlMutation",
|
|
16
|
-
"Bucket",
|
|
17
|
-
"DatabaseBucket",
|
|
18
|
-
"CalculationBucket",
|
|
19
|
-
"GroupBucket",
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
_MODULE_MAP = {
|
|
23
|
-
"GraphQL": ("general_manager.api.graphql", "GraphQL"),
|
|
24
|
-
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
25
|
-
"graphQlMutation": ("general_manager.api.mutation", "graphQlMutation"),
|
|
26
|
-
"GeneralManager": ("general_manager.manager.generalManager", "GeneralManager"),
|
|
27
|
-
"GeneralManagerMeta": ("general_manager.manager.meta", "GeneralManagerMeta"),
|
|
28
|
-
"Input": ("general_manager.manager.input", "Input"),
|
|
29
|
-
"Bucket": ("general_manager.bucket.baseBucket", "Bucket"),
|
|
30
|
-
"DatabaseBucket": ("general_manager.bucket.databaseBucket", "DatabaseBucket"),
|
|
31
|
-
"CalculationBucket": (
|
|
32
|
-
"general_manager.bucket.calculationBucket",
|
|
33
|
-
"CalculationBucket",
|
|
34
|
-
),
|
|
35
|
-
"GroupBucket": ("general_manager.bucket.groupBucket", "GroupBucket"),
|
|
36
|
-
}
|
|
10
|
+
__all__ = list(GENERAL_MANAGER_EXPORTS)
|
|
37
11
|
|
|
12
|
+
_MODULE_MAP = GENERAL_MANAGER_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.general_manager import * # noqa: F401,F403
|
|
38
16
|
|
|
39
17
|
def __getattr__(name: str) -> Any:
|
|
40
18
|
return resolve_export(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"GraphQL",
|
|
7
|
+
"MeasurementScalar",
|
|
8
|
+
"MeasurementType",
|
|
9
|
+
"graphQlMutation",
|
|
10
|
+
"graphQlProperty",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
from general_manager.api.graphql import GraphQL
|
|
14
|
+
from general_manager.api.graphql import MeasurementScalar
|
|
15
|
+
from general_manager.api.graphql import MeasurementType
|
|
16
|
+
from general_manager.api.mutation import graphQlMutation
|
|
17
|
+
from general_manager.api.property import graphQlProperty
|
|
18
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"Bucket",
|
|
7
|
+
"CalculationBucket",
|
|
8
|
+
"DatabaseBucket",
|
|
9
|
+
"GroupBucket",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
from general_manager.bucket.baseBucket import Bucket
|
|
13
|
+
from general_manager.bucket.calculationBucket import CalculationBucket
|
|
14
|
+
from general_manager.bucket.databaseBucket import DatabaseBucket
|
|
15
|
+
from general_manager.bucket.groupBucket import GroupBucket
|
|
16
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"CacheBackend",
|
|
7
|
+
"DependencyTracker",
|
|
8
|
+
"cached",
|
|
9
|
+
"invalidate_cache_key",
|
|
10
|
+
"record_dependencies",
|
|
11
|
+
"remove_cache_key_from_index",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
from general_manager.cache.cacheDecorator import CacheBackend
|
|
15
|
+
from general_manager.cache.cacheTracker import DependencyTracker
|
|
16
|
+
from general_manager.cache.cacheDecorator import cached
|
|
17
|
+
from general_manager.cache.dependencyIndex import invalidate_cache_key
|
|
18
|
+
from general_manager.cache.dependencyIndex import record_dependencies
|
|
19
|
+
from general_manager.cache.dependencyIndex import remove_cache_key_from_index
|
|
20
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"AutoFactory",
|
|
7
|
+
"LazyBoolean",
|
|
8
|
+
"LazyChoice",
|
|
9
|
+
"LazyDateBetween",
|
|
10
|
+
"LazyDateTimeBetween",
|
|
11
|
+
"LazyDateToday",
|
|
12
|
+
"LazyDecimal",
|
|
13
|
+
"LazyDeltaDate",
|
|
14
|
+
"LazyFakerAddress",
|
|
15
|
+
"LazyFakerEmail",
|
|
16
|
+
"LazyFakerName",
|
|
17
|
+
"LazyFakerSentence",
|
|
18
|
+
"LazyFakerUrl",
|
|
19
|
+
"LazyInteger",
|
|
20
|
+
"LazyMeasurement",
|
|
21
|
+
"LazyProjectName",
|
|
22
|
+
"LazySequence",
|
|
23
|
+
"LazyUUID",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
from general_manager.factory.autoFactory import AutoFactory
|
|
27
|
+
from general_manager.factory.factoryMethods import LazyBoolean
|
|
28
|
+
from general_manager.factory.factoryMethods import LazyChoice
|
|
29
|
+
from general_manager.factory.factoryMethods import LazyDateBetween
|
|
30
|
+
from general_manager.factory.factoryMethods import LazyDateTimeBetween
|
|
31
|
+
from general_manager.factory.factoryMethods import LazyDateToday
|
|
32
|
+
from general_manager.factory.factoryMethods import LazyDecimal
|
|
33
|
+
from general_manager.factory.factoryMethods import LazyDeltaDate
|
|
34
|
+
from general_manager.factory.factoryMethods import LazyFakerAddress
|
|
35
|
+
from general_manager.factory.factoryMethods import LazyFakerEmail
|
|
36
|
+
from general_manager.factory.factoryMethods import LazyFakerName
|
|
37
|
+
from general_manager.factory.factoryMethods import LazyFakerSentence
|
|
38
|
+
from general_manager.factory.factoryMethods import LazyFakerUrl
|
|
39
|
+
from general_manager.factory.factoryMethods import LazyInteger
|
|
40
|
+
from general_manager.factory.factoryMethods import LazyMeasurement
|
|
41
|
+
from general_manager.factory.factoryMethods import LazyProjectName
|
|
42
|
+
from general_manager.factory.factoryMethods import LazySequence
|
|
43
|
+
from general_manager.factory.factoryMethods import LazyUUID
|
|
44
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"CalculationInterface",
|
|
7
|
+
"DatabaseInterface",
|
|
8
|
+
"GeneralManager",
|
|
9
|
+
"GraphQL",
|
|
10
|
+
"Input",
|
|
11
|
+
"ManagerBasedPermission",
|
|
12
|
+
"ReadOnlyInterface",
|
|
13
|
+
"Rule",
|
|
14
|
+
"graphQlMutation",
|
|
15
|
+
"graphQlProperty",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
from general_manager.interface.calculationInterface import CalculationInterface
|
|
19
|
+
from general_manager.interface.databaseInterface import DatabaseInterface
|
|
20
|
+
from general_manager.manager.generalManager import GeneralManager
|
|
21
|
+
from general_manager.api.graphql import GraphQL
|
|
22
|
+
from general_manager.manager.input import Input
|
|
23
|
+
from general_manager.permission.managerBasedPermission import ManagerBasedPermission
|
|
24
|
+
from general_manager.interface.readOnlyInterface import ReadOnlyInterface
|
|
25
|
+
from general_manager.rule.rule import Rule
|
|
26
|
+
from general_manager.api.mutation import graphQlMutation
|
|
27
|
+
from general_manager.api.property import graphQlProperty
|
|
28
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"CalculationInterface",
|
|
7
|
+
"DBBasedInterface",
|
|
8
|
+
"DatabaseInterface",
|
|
9
|
+
"InterfaceBase",
|
|
10
|
+
"ReadOnlyInterface",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
from general_manager.interface.calculationInterface import CalculationInterface
|
|
14
|
+
from general_manager.interface.databaseBasedInterface import DBBasedInterface
|
|
15
|
+
from general_manager.interface.databaseInterface import DatabaseInterface
|
|
16
|
+
from general_manager.interface.baseInterface import InterfaceBase
|
|
17
|
+
from general_manager.interface.readOnlyInterface import ReadOnlyInterface
|
|
18
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"GeneralManager",
|
|
7
|
+
"GeneralManagerMeta",
|
|
8
|
+
"GroupManager",
|
|
9
|
+
"Input",
|
|
10
|
+
"graphQlProperty",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
from general_manager.manager.generalManager import GeneralManager
|
|
14
|
+
from general_manager.manager.meta import GeneralManagerMeta
|
|
15
|
+
from general_manager.manager.groupManager import GroupManager
|
|
16
|
+
from general_manager.manager.input import Input
|
|
17
|
+
from general_manager.api.property import graphQlProperty
|
|
18
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"Measurement",
|
|
7
|
+
"MeasurementField",
|
|
8
|
+
"currency_units",
|
|
9
|
+
"ureg",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
from general_manager.measurement.measurement import Measurement
|
|
13
|
+
from general_manager.measurement.measurementField import MeasurementField
|
|
14
|
+
from general_manager.measurement.measurement import currency_units
|
|
15
|
+
from general_manager.measurement.measurement import ureg
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"BasePermission",
|
|
7
|
+
"ManagerBasedPermission",
|
|
8
|
+
"MutationPermission",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
from general_manager.permission.basePermission import BasePermission
|
|
12
|
+
from general_manager.permission.managerBasedPermission import ManagerBasedPermission
|
|
13
|
+
from general_manager.permission.mutationPermission import MutationPermission
|
|
14
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Type-only imports for public API re-exports."""
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"CustomJSONEncoder",
|
|
7
|
+
"PathMap",
|
|
8
|
+
"args_to_kwargs",
|
|
9
|
+
"camel_to_snake",
|
|
10
|
+
"create_filter_function",
|
|
11
|
+
"make_cache_key",
|
|
12
|
+
"noneToZero",
|
|
13
|
+
"parse_filters",
|
|
14
|
+
"pascal_to_snake",
|
|
15
|
+
"snake_to_camel",
|
|
16
|
+
"snake_to_pascal",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
from general_manager.utils.jsonEncoder import CustomJSONEncoder
|
|
20
|
+
from general_manager.utils.pathMapping import PathMap
|
|
21
|
+
from general_manager.utils.argsToKwargs import args_to_kwargs
|
|
22
|
+
from general_manager.utils.formatString import camel_to_snake
|
|
23
|
+
from general_manager.utils.filterParser import create_filter_function
|
|
24
|
+
from general_manager.utils.makeCacheKey import make_cache_key
|
|
25
|
+
from general_manager.utils.noneToZero import noneToZero
|
|
26
|
+
from general_manager.utils.filterParser import parse_filters
|
|
27
|
+
from general_manager.utils.formatString import pascal_to_snake
|
|
28
|
+
from general_manager.utils.formatString import snake_to_camel
|
|
29
|
+
from general_manager.utils.formatString import snake_to_pascal
|
|
30
|
+
|
general_manager/api/__init__.py
CHANGED
|
@@ -2,25 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import API_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
_MODULE_MAP = {
|
|
18
|
-
"GraphQL": ("general_manager.api.graphql", "GraphQL"),
|
|
19
|
-
"MeasurementType": ("general_manager.api.graphql", "MeasurementType"),
|
|
20
|
-
"MeasurementScalar": ("general_manager.api.graphql", "MeasurementScalar"),
|
|
21
|
-
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
22
|
-
"graphQlMutation": ("general_manager.api.mutation", "graphQlMutation"),
|
|
23
|
-
}
|
|
10
|
+
__all__ = list(API_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = API_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.api import * # noqa: F401,F403
|
|
24
16
|
|
|
25
17
|
|
|
26
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import BUCKET_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
_MODULE_MAP =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"general_manager.bucket.calculationBucket",
|
|
16
|
-
"CalculationBucket",
|
|
17
|
-
),
|
|
18
|
-
"GroupBucket": ("general_manager.bucket.groupBucket", "GroupBucket"),
|
|
19
|
-
}
|
|
10
|
+
__all__ = list(BUCKET_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = BUCKET_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.bucket import * # noqa: F401,F403
|
|
20
16
|
|
|
21
17
|
|
|
22
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,27 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import CACHE_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"invalidate_cache_key",
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
_MODULE_MAP = {
|
|
19
|
-
"cached": ("general_manager.cache.cacheDecorator", "cached"),
|
|
20
|
-
"CacheBackend": ("general_manager.cache.cacheDecorator", "CacheBackend"),
|
|
21
|
-
"DependencyTracker": ("general_manager.cache.cacheTracker", "DependencyTracker"),
|
|
22
|
-
"record_dependencies": ("general_manager.cache.dependencyIndex", "record_dependencies"),
|
|
23
|
-
"remove_cache_key_from_index": ("general_manager.cache.dependencyIndex", "remove_cache_key_from_index"),
|
|
24
|
-
"invalidate_cache_key": ("general_manager.cache.dependencyIndex", "invalidate_cache_key"),
|
|
25
|
-
}
|
|
10
|
+
__all__ = list(CACHE_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = CACHE_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.cache import * # noqa: F401,F403
|
|
26
16
|
|
|
27
17
|
|
|
28
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,23 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import FACTORY_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_MODULE_MAP = {
|
|
17
|
-
"AutoFactory": ("general_manager.factory.autoFactory", "AutoFactory"),
|
|
18
|
-
"LazyMeasurement": ("general_manager.factory.factoryMethods", "LazyMeasurement"),
|
|
19
|
-
"LazyDeltaDate": ("general_manager.factory.factoryMethods", "LazyDeltaDate"),
|
|
20
|
-
"LazyProjectName": ("general_manager.factory.factoryMethods", "LazyProjectName"),
|
|
21
|
-
}
|
|
10
|
+
__all__ = list(FACTORY_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = FACTORY_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.factory import * # noqa: F401,F403
|
|
22
16
|
|
|
23
17
|
|
|
24
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,25 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import INTERFACE_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
_MODULE_MAP = {
|
|
18
|
-
"InterfaceBase": "general_manager.interface.baseInterface",
|
|
19
|
-
"DBBasedInterface": "general_manager.interface.databaseBasedInterface",
|
|
20
|
-
"DatabaseInterface": "general_manager.interface.databaseInterface",
|
|
21
|
-
"ReadOnlyInterface": "general_manager.interface.readOnlyInterface",
|
|
22
|
-
"CalculationInterface": "general_manager.interface.calculationInterface",
|
|
23
|
-
}
|
|
10
|
+
__all__ = list(INTERFACE_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = INTERFACE_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.interface import * # noqa: F401,F403
|
|
24
16
|
|
|
25
17
|
|
|
26
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,25 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import MANAGER_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
_MODULE_MAP = {
|
|
18
|
-
"GeneralManager": ("general_manager.manager.generalManager", "GeneralManager"),
|
|
19
|
-
"GeneralManagerMeta": ("general_manager.manager.meta", "GeneralManagerMeta"),
|
|
20
|
-
"Input": ("general_manager.manager.input", "Input"),
|
|
21
|
-
"GroupManager": ("general_manager.manager.groupManager", "GroupManager"),
|
|
22
|
-
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
23
|
-
}
|
|
10
|
+
__all__ = list(MANAGER_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = MANAGER_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.manager import * # noqa: F401,F403
|
|
24
16
|
|
|
25
17
|
|
|
26
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,26 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import MEASUREMENT_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_MODULE_MAP = {
|
|
17
|
-
"Measurement": ("general_manager.measurement.measurement", "Measurement"),
|
|
18
|
-
"ureg": ("general_manager.measurement.measurement", "ureg"),
|
|
19
|
-
"currency_units": ("general_manager.measurement.measurement", "currency_units"),
|
|
20
|
-
"MeasurementField": (
|
|
21
|
-
"general_manager.measurement.measurementField",
|
|
22
|
-
"MeasurementField",
|
|
23
|
-
),
|
|
24
|
-
}
|
|
10
|
+
__all__ = list(MEASUREMENT_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = MEASUREMENT_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.measurement import * # noqa: F401,F403
|
|
25
16
|
|
|
26
17
|
|
|
27
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import PERMISSION_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_MODULE_MAP = {
|
|
16
|
-
"BasePermission": ("general_manager.permission.basePermission", "BasePermission"),
|
|
17
|
-
"ManagerBasedPermission": ("general_manager.permission.managerBasedPermission", "ManagerBasedPermission"),
|
|
18
|
-
"MutationPermission": ("general_manager.permission.mutationPermission", "MutationPermission"),
|
|
19
|
-
}
|
|
10
|
+
__all__ = list(PERMISSION_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = PERMISSION_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.permission import * # noqa: F401,F403
|
|
20
16
|
|
|
21
17
|
|
|
22
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""Central registry for lazy public API exports.
|
|
2
|
+
|
|
3
|
+
Each entry maps a public name to either the module path string or a
|
|
4
|
+
``(module_path, attribute_name)`` tuple. A plain string means that the public
|
|
5
|
+
name and the attribute name are identical.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import Mapping
|
|
11
|
+
|
|
12
|
+
LazyExportMap = Mapping[str, str | tuple[str, str]]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
GENERAL_MANAGER_EXPORTS: LazyExportMap = {
|
|
16
|
+
"GraphQL": ("general_manager.api.graphql", "GraphQL"),
|
|
17
|
+
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
18
|
+
"graphQlMutation": ("general_manager.api.mutation", "graphQlMutation"),
|
|
19
|
+
"GeneralManager": ("general_manager.manager.generalManager", "GeneralManager"),
|
|
20
|
+
"Input": ("general_manager.manager.input", "Input"),
|
|
21
|
+
"CalculationInterface": ("general_manager.interface.calculationInterface", "CalculationInterface"),
|
|
22
|
+
"DatabaseInterface": ("general_manager.interface.databaseInterface", "DatabaseInterface"),
|
|
23
|
+
"ReadOnlyInterface": ("general_manager.interface.readOnlyInterface", "ReadOnlyInterface"),
|
|
24
|
+
"ManagerBasedPermission": (
|
|
25
|
+
"general_manager.permission.managerBasedPermission",
|
|
26
|
+
"ManagerBasedPermission",
|
|
27
|
+
),
|
|
28
|
+
"Rule": ("general_manager.rule.rule", "Rule"),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
API_EXPORTS: LazyExportMap = {
|
|
33
|
+
"GraphQL": ("general_manager.api.graphql", "GraphQL"),
|
|
34
|
+
"MeasurementType": ("general_manager.api.graphql", "MeasurementType"),
|
|
35
|
+
"MeasurementScalar": ("general_manager.api.graphql", "MeasurementScalar"),
|
|
36
|
+
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
37
|
+
"graphQlMutation": ("general_manager.api.mutation", "graphQlMutation"),
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
FACTORY_EXPORTS: LazyExportMap = {
|
|
42
|
+
"AutoFactory": ("general_manager.factory.autoFactory", "AutoFactory"),
|
|
43
|
+
"LazyMeasurement": ("general_manager.factory.factoryMethods", "LazyMeasurement"),
|
|
44
|
+
"LazyDeltaDate": ("general_manager.factory.factoryMethods", "LazyDeltaDate"),
|
|
45
|
+
"LazyProjectName": ("general_manager.factory.factoryMethods", "LazyProjectName"),
|
|
46
|
+
"LazyDateToday": ("general_manager.factory.factoryMethods", "LazyDateToday"),
|
|
47
|
+
"LazyDateBetween": ("general_manager.factory.factoryMethods", "LazyDateBetween"),
|
|
48
|
+
"LazyDateTimeBetween": ("general_manager.factory.factoryMethods", "LazyDateTimeBetween"),
|
|
49
|
+
"LazyInteger": ("general_manager.factory.factoryMethods", "LazyInteger"),
|
|
50
|
+
"LazyDecimal": ("general_manager.factory.factoryMethods", "LazyDecimal"),
|
|
51
|
+
"LazyChoice": ("general_manager.factory.factoryMethods", "LazyChoice"),
|
|
52
|
+
"LazySequence": ("general_manager.factory.factoryMethods", "LazySequence"),
|
|
53
|
+
"LazyBoolean": ("general_manager.factory.factoryMethods", "LazyBoolean"),
|
|
54
|
+
"LazyUUID": ("general_manager.factory.factoryMethods", "LazyUUID"),
|
|
55
|
+
"LazyFakerName": ("general_manager.factory.factoryMethods", "LazyFakerName"),
|
|
56
|
+
"LazyFakerEmail": ("general_manager.factory.factoryMethods", "LazyFakerEmail"),
|
|
57
|
+
"LazyFakerSentence": ("general_manager.factory.factoryMethods", "LazyFakerSentence"),
|
|
58
|
+
"LazyFakerAddress": ("general_manager.factory.factoryMethods", "LazyFakerAddress"),
|
|
59
|
+
"LazyFakerUrl": ("general_manager.factory.factoryMethods", "LazyFakerUrl"),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
MEASUREMENT_EXPORTS: LazyExportMap = {
|
|
64
|
+
"Measurement": ("general_manager.measurement.measurement", "Measurement"),
|
|
65
|
+
"ureg": ("general_manager.measurement.measurement", "ureg"),
|
|
66
|
+
"currency_units": ("general_manager.measurement.measurement", "currency_units"),
|
|
67
|
+
"MeasurementField": ("general_manager.measurement.measurementField", "MeasurementField"),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
UTILS_EXPORTS: LazyExportMap = {
|
|
72
|
+
"noneToZero": ("general_manager.utils.noneToZero", "noneToZero"),
|
|
73
|
+
"args_to_kwargs": ("general_manager.utils.argsToKwargs", "args_to_kwargs"),
|
|
74
|
+
"make_cache_key": ("general_manager.utils.makeCacheKey", "make_cache_key"),
|
|
75
|
+
"parse_filters": ("general_manager.utils.filterParser", "parse_filters"),
|
|
76
|
+
"create_filter_function": ("general_manager.utils.filterParser", "create_filter_function"),
|
|
77
|
+
"snake_to_pascal": ("general_manager.utils.formatString", "snake_to_pascal"),
|
|
78
|
+
"snake_to_camel": ("general_manager.utils.formatString", "snake_to_camel"),
|
|
79
|
+
"pascal_to_snake": ("general_manager.utils.formatString", "pascal_to_snake"),
|
|
80
|
+
"camel_to_snake": ("general_manager.utils.formatString", "camel_to_snake"),
|
|
81
|
+
"CustomJSONEncoder": ("general_manager.utils.jsonEncoder", "CustomJSONEncoder"),
|
|
82
|
+
"PathMap": ("general_manager.utils.pathMapping", "PathMap"),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
PERMISSION_EXPORTS: LazyExportMap = {
|
|
87
|
+
"BasePermission": ("general_manager.permission.basePermission", "BasePermission"),
|
|
88
|
+
"ManagerBasedPermission": (
|
|
89
|
+
"general_manager.permission.managerBasedPermission",
|
|
90
|
+
"ManagerBasedPermission",
|
|
91
|
+
),
|
|
92
|
+
"MutationPermission": ("general_manager.permission.mutationPermission", "MutationPermission"),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
INTERFACE_EXPORTS: LazyExportMap = {
|
|
97
|
+
"InterfaceBase": "general_manager.interface.baseInterface",
|
|
98
|
+
"DBBasedInterface": "general_manager.interface.databaseBasedInterface",
|
|
99
|
+
"DatabaseInterface": "general_manager.interface.databaseInterface",
|
|
100
|
+
"ReadOnlyInterface": "general_manager.interface.readOnlyInterface",
|
|
101
|
+
"CalculationInterface": "general_manager.interface.calculationInterface",
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
CACHE_EXPORTS: LazyExportMap = {
|
|
106
|
+
"cached": ("general_manager.cache.cacheDecorator", "cached"),
|
|
107
|
+
"CacheBackend": ("general_manager.cache.cacheDecorator", "CacheBackend"),
|
|
108
|
+
"DependencyTracker": ("general_manager.cache.cacheTracker", "DependencyTracker"),
|
|
109
|
+
"record_dependencies": (
|
|
110
|
+
"general_manager.cache.dependencyIndex",
|
|
111
|
+
"record_dependencies",
|
|
112
|
+
),
|
|
113
|
+
"remove_cache_key_from_index": (
|
|
114
|
+
"general_manager.cache.dependencyIndex",
|
|
115
|
+
"remove_cache_key_from_index",
|
|
116
|
+
),
|
|
117
|
+
"invalidate_cache_key": (
|
|
118
|
+
"general_manager.cache.dependencyIndex",
|
|
119
|
+
"invalidate_cache_key",
|
|
120
|
+
),
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
BUCKET_EXPORTS: LazyExportMap = {
|
|
125
|
+
"Bucket": ("general_manager.bucket.baseBucket", "Bucket"),
|
|
126
|
+
"DatabaseBucket": ("general_manager.bucket.databaseBucket", "DatabaseBucket"),
|
|
127
|
+
"CalculationBucket": ("general_manager.bucket.calculationBucket", "CalculationBucket"),
|
|
128
|
+
"GroupBucket": ("general_manager.bucket.groupBucket", "GroupBucket"),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
MANAGER_EXPORTS: LazyExportMap = {
|
|
133
|
+
"GeneralManager": ("general_manager.manager.generalManager", "GeneralManager"),
|
|
134
|
+
"GeneralManagerMeta": ("general_manager.manager.meta", "GeneralManagerMeta"),
|
|
135
|
+
"Input": ("general_manager.manager.input", "Input"),
|
|
136
|
+
"GroupManager": ("general_manager.manager.groupManager", "GroupManager"),
|
|
137
|
+
"graphQlProperty": ("general_manager.api.property", "graphQlProperty"),
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
RULE_EXPORTS: LazyExportMap = {
|
|
142
|
+
"Rule": ("general_manager.rule.rule", "Rule"),
|
|
143
|
+
"BaseRuleHandler": ("general_manager.rule.handler", "BaseRuleHandler"),
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
EXPORT_REGISTRY: Mapping[str, LazyExportMap] = {
|
|
148
|
+
"general_manager": GENERAL_MANAGER_EXPORTS,
|
|
149
|
+
"general_manager.api": API_EXPORTS,
|
|
150
|
+
"general_manager.factory": FACTORY_EXPORTS,
|
|
151
|
+
"general_manager.measurement": MEASUREMENT_EXPORTS,
|
|
152
|
+
"general_manager.utils": UTILS_EXPORTS,
|
|
153
|
+
"general_manager.permission": PERMISSION_EXPORTS,
|
|
154
|
+
"general_manager.interface": INTERFACE_EXPORTS,
|
|
155
|
+
"general_manager.cache": CACHE_EXPORTS,
|
|
156
|
+
"general_manager.bucket": BUCKET_EXPORTS,
|
|
157
|
+
"general_manager.manager": MANAGER_EXPORTS,
|
|
158
|
+
"general_manager.rule": RULE_EXPORTS,
|
|
159
|
+
}
|
|
160
|
+
|
general_manager/py.typed
ADDED
|
File without changes
|
general_manager/rule/__init__.py
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import RULE_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
+
__all__ = list(RULE_EXPORTS)
|
|
10
11
|
|
|
11
|
-
_MODULE_MAP =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
_MODULE_MAP = RULE_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.rule import * # noqa: F401,F403
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -2,33 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
6
|
|
|
7
|
+
from general_manager.public_api_registry import UTILS_EXPORTS
|
|
7
8
|
from general_manager.utils.public_api import build_module_dir, resolve_export
|
|
8
9
|
|
|
9
|
-
__all__ =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"snake_to_pascal",
|
|
16
|
-
"snake_to_camel",
|
|
17
|
-
"pascal_to_snake",
|
|
18
|
-
"camel_to_snake",
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
_MODULE_MAP = {
|
|
22
|
-
"noneToZero": ("general_manager.utils.noneToZero", "noneToZero"),
|
|
23
|
-
"args_to_kwargs": ("general_manager.utils.argsToKwargs", "args_to_kwargs"),
|
|
24
|
-
"make_cache_key": ("general_manager.utils.makeCacheKey", "make_cache_key"),
|
|
25
|
-
"parse_filters": ("general_manager.utils.filterParser", "parse_filters"),
|
|
26
|
-
"create_filter_function": ("general_manager.utils.filterParser", "create_filter_function"),
|
|
27
|
-
"snake_to_pascal": ("general_manager.utils.formatString", "snake_to_pascal"),
|
|
28
|
-
"snake_to_camel": ("general_manager.utils.formatString", "snake_to_camel"),
|
|
29
|
-
"pascal_to_snake": ("general_manager.utils.formatString", "pascal_to_snake"),
|
|
30
|
-
"camel_to_snake": ("general_manager.utils.formatString", "camel_to_snake"),
|
|
31
|
-
}
|
|
10
|
+
__all__ = list(UTILS_EXPORTS)
|
|
11
|
+
|
|
12
|
+
_MODULE_MAP = UTILS_EXPORTS
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from general_manager._types.utils import * # noqa: F401,F403
|
|
32
16
|
|
|
33
17
|
|
|
34
18
|
def __getattr__(name: str) -> Any:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GeneralManager
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.1
|
|
4
4
|
Summary: Modular Django-based data management framework with ORM, GraphQL, fine-grained permissions, rule validation, calculations and caching.
|
|
5
5
|
Author-email: Tim Kleindick <tkleindick@yahoo.de>
|
|
6
6
|
License: MIT License
|
|
@@ -24,6 +24,12 @@ License: MIT License
|
|
|
24
24
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
25
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
26
|
SOFTWARE.
|
|
27
|
+
Project-URL: Homepage, https://github.com/TimKleindick/general_manager
|
|
28
|
+
Project-URL: Documentation, https://timkleindick.github.io/general_manager/
|
|
29
|
+
Project-URL: Repository, https://github.com/TimKleindick/general_manager
|
|
30
|
+
Project-URL: Issues, https://github.com/TimKleindick/general_manager/issues
|
|
31
|
+
Project-URL: Changelog, https://github.com/TimKleindick/general_manager/releases
|
|
32
|
+
Keywords: django,orm,graphql,permissions,validation,caching,framework
|
|
27
33
|
Classifier: License :: OSI Approved :: MIT License
|
|
28
34
|
Classifier: Programming Language :: Python :: 3
|
|
29
35
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -32,6 +38,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
32
38
|
Classifier: Framework :: Django
|
|
33
39
|
Classifier: Intended Audience :: Developers
|
|
34
40
|
Classifier: Operating System :: OS Independent
|
|
41
|
+
Classifier: Typing :: Typed
|
|
35
42
|
Requires-Python: >=3.12
|
|
36
43
|
Description-Content-Type: text/markdown
|
|
37
44
|
License-File: LICENSE
|
|
@@ -54,7 +61,6 @@ Requires-Dist: Pint>=0.24.4
|
|
|
54
61
|
Requires-Dist: platformdirs>=4.3.7
|
|
55
62
|
Requires-Dist: promise>=2.3
|
|
56
63
|
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
57
|
-
Requires-Dist: setuptools==80.0.0
|
|
58
64
|
Requires-Dist: six>=1.17.0
|
|
59
65
|
Requires-Dist: smmap>=5.0.2
|
|
60
66
|
Requires-Dist: sqlparse>=0.5.3
|
|
@@ -73,135 +79,95 @@ Dynamic: license-file
|
|
|
73
79
|
|
|
74
80
|
## Overview
|
|
75
81
|
|
|
76
|
-
GeneralManager
|
|
82
|
+
GeneralManager helps teams ship complex, data-driven products on top of Django without rewriting the same plumbing for every project. It combines domain modelling, GraphQL APIs, calculations, and permission logic in one toolkit so that you can focus on business rules instead of infrastructure.
|
|
77
83
|
|
|
78
|
-
##
|
|
79
|
-
|
|
80
|
-
### 1. **Data Management**
|
|
81
|
-
- **Flexibility**: Supports managing all kinds of data, not just projects and derivatives.
|
|
82
|
-
- **Database Integration**: Seamless integration with the Django ORM for database operations.
|
|
83
|
-
- **External Interfaces**: Support for interfaces to other programs, such as Excel.
|
|
84
|
-
|
|
85
|
-
### 2. **Data Modeling**
|
|
86
|
-
- **Django Models**: The data structure is based on Django models, extended by custom fields like `MeasurementField`.
|
|
87
|
-
- **Rules and Validations**: Define rules for data validation, e.g., ensuring that a project's start date is before its end date.
|
|
84
|
+
## Documentation
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
- Automatic generation of GraphQL interfaces for all models.
|
|
91
|
-
- Support for custom queries and mutations.
|
|
86
|
+
The full documentation is published on GitHub Pages: [GeneralManager Documentation](https://timkleindick.github.io/general_manager/). It covers tutorials, concept guides, API reference, and examples.
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
- **ManagerBasedPermission**: A flexible permission system based on user roles and attributes.
|
|
95
|
-
- Attribute-level CRUD permissions.
|
|
96
|
-
|
|
97
|
-
### 5. **Interfaces**
|
|
98
|
-
- **CalculationInterface**: Allows the implementation of calculation logic.
|
|
99
|
-
- **DatabaseInterface**: Provides a standardized interface for database operations.
|
|
100
|
-
- **ReadOnlyInterface**: For read-only data access.
|
|
88
|
+
## Key Features
|
|
101
89
|
|
|
102
|
-
|
|
103
|
-
- **
|
|
104
|
-
- **
|
|
90
|
+
- **Domain-first modelling**: Describe rich business entities in plain Python and let GeneralManager project them onto the Django ORM.
|
|
91
|
+
- **GraphQL without boilerplate**: Generate a complete API, then extend it with custom queries and mutations when needed.
|
|
92
|
+
- **Attribute-based access control**: Enforce permissions with `ManagerBasedPermission` down to single fields and operations.
|
|
93
|
+
- **Deterministic calculations**: Ship reusable interfaces e.g. for volume distributions, KPI calculations, and derived data.
|
|
94
|
+
- **Factory-powered testing**: Create large, realistic datasets quickly for demos, QA, and load tests.
|
|
95
|
+
- **Composable interfaces**: Connect to databases, spreadsheets, or computed sources with the same consistent abstractions.
|
|
105
96
|
|
|
106
|
-
##
|
|
97
|
+
## Quick Start
|
|
107
98
|
|
|
108
99
|
### Installation
|
|
109
100
|
|
|
110
|
-
Install the
|
|
101
|
+
Install the package from PyPI:
|
|
111
102
|
|
|
112
103
|
```bash
|
|
113
104
|
pip install GeneralManager
|
|
114
105
|
```
|
|
115
106
|
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
-
The following example demonstrates how to create a GeneralManager and generate sample data (in this case 10 projects):
|
|
107
|
+
### Minimal example
|
|
119
108
|
|
|
120
109
|
```python
|
|
110
|
+
from datetime import date
|
|
111
|
+
from typing import Optional
|
|
112
|
+
|
|
113
|
+
from django.db.models import CharField, DateField
|
|
114
|
+
|
|
121
115
|
from general_manager import GeneralManager
|
|
122
116
|
from general_manager.interface.database import DatabaseInterface
|
|
123
|
-
from general_manager.measurement import
|
|
117
|
+
from general_manager.measurement import Measurement, MeasurementField
|
|
124
118
|
from general_manager.permission import ManagerBasedPermission
|
|
125
119
|
|
|
120
|
+
|
|
126
121
|
class Project(GeneralManager):
|
|
127
122
|
name: str
|
|
128
123
|
start_date: Optional[date]
|
|
129
124
|
end_date: Optional[date]
|
|
130
125
|
total_capex: Optional[Measurement]
|
|
131
|
-
derivative_list: DatabaseBucket[Derivative]
|
|
132
126
|
|
|
133
127
|
class Interface(DatabaseInterface):
|
|
134
128
|
name = CharField(max_length=50)
|
|
135
|
-
number = CharField(max_length=7, validators=[RegexValidator(r"^AP\d{4,5}$")])
|
|
136
|
-
description = TextField(null=True, blank=True)
|
|
137
129
|
start_date = DateField(null=True, blank=True)
|
|
138
130
|
end_date = DateField(null=True, blank=True)
|
|
139
131
|
total_capex = MeasurementField(base_unit="EUR", null=True, blank=True)
|
|
140
132
|
|
|
141
|
-
class Meta:
|
|
142
|
-
constraints = [
|
|
143
|
-
constraints.UniqueConstraint(
|
|
144
|
-
fields=["name", "number"], name="unique_booking"
|
|
145
|
-
)
|
|
146
|
-
]
|
|
147
|
-
|
|
148
|
-
rules = [
|
|
149
|
-
Rule["Project"](
|
|
150
|
-
lambda x: cast(date, x.start_date) < cast(date, x.end_date)
|
|
151
|
-
),
|
|
152
|
-
Rule["Project"](lambda x: cast(Measurement, x.total_capex) >= "0 EUR"),
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
class Factory:
|
|
156
|
-
name = LazyProjectName()
|
|
157
|
-
end_date = LazyDeltaDate(365 * 6, "start_date")
|
|
158
|
-
total_capex = LazyMeasurement(75_000, 1_000_000, "EUR")
|
|
159
|
-
|
|
160
133
|
class Permission(ManagerBasedPermission):
|
|
161
|
-
__read__ = ["
|
|
162
|
-
__create__ = ["
|
|
163
|
-
__update__ = ["
|
|
164
|
-
__delete__ = ["admin", "isMatchingKeyAccount", "isProjectTeamMember"]
|
|
134
|
+
__read__ = ["public"]
|
|
135
|
+
__create__ = ["isAdmin"]
|
|
136
|
+
__update__ = ["isAdmin"]
|
|
165
137
|
|
|
166
|
-
total_capex = {"update": ["isSalesResponsible", "isProjectManager"]}
|
|
167
138
|
|
|
168
139
|
Project.Factory.createBatch(10)
|
|
169
140
|
```
|
|
170
141
|
|
|
171
|
-
|
|
142
|
+
The example above defines a project model, exposes it through the auto-generated GraphQL schema, and produces ten sample records with a single call. The full documentation walks through extending this setup with custom rules, interfaces, and queries.
|
|
172
143
|
|
|
173
|
-
|
|
144
|
+
## Core Building Blocks
|
|
174
145
|
|
|
175
|
-
|
|
146
|
+
- **Entities & interfaces**: Compose domain entities with database-backed or computed interfaces to control persistence and data flows.
|
|
147
|
+
- **Rules & validation**: Protect your data with declarative constraints and business rules that run automatically.
|
|
148
|
+
- **Permissions**: Implement attribute-based access control with reusable policies that match your organisation’s roles.
|
|
149
|
+
- **GraphQL layer**: Serve a typed schema that mirrors your models and stays in sync as you iterate.
|
|
150
|
+
- **Caching & calculations**: Use the built-in caching decorator and calculation helpers to keep derived data fast and reliable.
|
|
176
151
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
totalCapex {
|
|
184
|
-
value
|
|
185
|
-
unit
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
```
|
|
152
|
+
## Production-Ready Extras
|
|
153
|
+
|
|
154
|
+
- Works with Postgres, SQLite, and any database supported by Django.
|
|
155
|
+
- Plays nicely with CI thanks to deterministic factories, typing, and code coverage.
|
|
156
|
+
- Ships with MkDocs documentation, auto-generated API reference, and a growing cookbook of recipes.
|
|
157
|
+
- Designed for teams: opinionated defaults without blocking custom extensions or overrides.
|
|
190
158
|
|
|
191
|
-
##
|
|
159
|
+
## Use Cases
|
|
192
160
|
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
- **Data Validation**: Automatic validation of data through rules and constraints.
|
|
198
|
-
- **Caching**: Automatic cache generation with the `@cached` decorator to improve performance.
|
|
161
|
+
- Internal tooling that mirrors real-world workflows, pricing models, or asset hierarchies.
|
|
162
|
+
- Customer-facing platforms that combine transactional data with live calculations.
|
|
163
|
+
- Analytics products that need controlled data sharing between teams or clients.
|
|
164
|
+
- Proof-of-concept projects that must scale into production without a rewrite.
|
|
199
165
|
|
|
200
166
|
## Requirements
|
|
201
167
|
|
|
202
168
|
- Python >= 3.12
|
|
203
169
|
- Django >= 5.2
|
|
204
|
-
- Additional dependencies (see `requirements.txt`):
|
|
170
|
+
- Additional dependencies (see `requirements/base.txt`):
|
|
205
171
|
- `graphene`
|
|
206
172
|
- `numpy`
|
|
207
173
|
- `Pint`
|
|
@@ -1,40 +1,54 @@
|
|
|
1
|
-
general_manager/__init__.py,sha256=
|
|
1
|
+
general_manager/__init__.py,sha256=OmRYpjg3N9w0yX1eAq32WdLtcf8I55M3sqhO-Qrawjo,742
|
|
2
2
|
general_manager/apps.py,sha256=On2nTp2-QwNcOpYfIzjNE0Xnum4BMk_5YHbEloBIM-U,10351
|
|
3
|
-
general_manager/
|
|
3
|
+
general_manager/public_api_registry.py,sha256=xKfgbyvXB_oZZku9ksLNzOGQbmL5QfWuRGE2qH2FOtc,7338
|
|
4
|
+
general_manager/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
general_manager/_types/__init__.py,sha256=RmS0Ok-1-CwWOZL_socLWksEk9MfsshL9eQx879I4mU,60
|
|
6
|
+
general_manager/_types/api.py,sha256=EnEUKCr24Ac2klzZJvx17dJNxDRyfI9zEx9I0vCfpio,489
|
|
7
|
+
general_manager/_types/bucket.py,sha256=-kK46YX7mGwv3OVEjZTnmMqR9qpq8fT09Ez-wMF80nc,432
|
|
8
|
+
general_manager/_types/cache.py,sha256=KfHr6Pdg9WpWKs5iyNLA4vq9S9GRMGwDCjLe7zgIMRw,655
|
|
9
|
+
general_manager/_types/factory.py,sha256=2QZTc9jDbH55Jj-DuuuiWEdgqAFmlCqchsKB0EAwD5E,1653
|
|
10
|
+
general_manager/_types/general_manager.py,sha256=mImHmBX39Al2q9Uqkmzrrvcdk3b-DzfEbyaTxc_Qiyw,952
|
|
11
|
+
general_manager/_types/interface.py,sha256=mjrifUJyixgkjCVjcJokEs-pzxlssEJSXu7DsTK5Nzc,599
|
|
12
|
+
general_manager/_types/manager.py,sha256=hjmV5gtWDhy_XAaZ6jIRVLCWVwps90tL8SqnC2oS8OQ,501
|
|
13
|
+
general_manager/_types/measurement.py,sha256=5ZAsmjULrSe6Zh4-NyV1CXCAYJ75qqO_YWWQeeTao-Y,443
|
|
14
|
+
general_manager/_types/permission.py,sha256=BG-RMsGgVCRVHyJgns9a1VTcwtqS9WzbG2HOrXaBNaI,413
|
|
15
|
+
general_manager/_types/rule.py,sha256=Ju5t7NhGO76KnqwOElXk2cMI6cIYyMW5sEPayXExJPM,239
|
|
16
|
+
general_manager/_types/utils.py,sha256=jze1yRZQw_OKVOmJNMv4MEu92rP01CVtjLBCEMqxCqk,1026
|
|
17
|
+
general_manager/api/__init__.py,sha256=6Usf6aEc5RalaOE4xzqqSp7KChxi9W4Nts4nFIFHtt4,677
|
|
4
18
|
general_manager/api/graphql.py,sha256=4pox3eRXWtZG9VshSgCJVrJ_9ONUUuzWhmXwetV5EgI,42798
|
|
5
19
|
general_manager/api/mutation.py,sha256=6T-UHElnTxWubG99-Svy7AeFlHuXaKc8nKvRPADmI0E,7347
|
|
6
20
|
general_manager/api/property.py,sha256=tT-eAKcuPhy0q_v0fKL4gPXcCVASC5M15_DYWMCQXjc,4358
|
|
7
|
-
general_manager/bucket/__init__.py,sha256=
|
|
21
|
+
general_manager/bucket/__init__.py,sha256=Ay3kVmdxWC8nt3jYx3FFnND89ysD_z0GaD5rIr-v7Ec,690
|
|
8
22
|
general_manager/bucket/baseBucket.py,sha256=wSQijZrs1joA-8IGh2AwD4KARSgYqSL4AxXq3KwOz6A,8126
|
|
9
23
|
general_manager/bucket/calculationBucket.py,sha256=nH2VATcS3z07LGpKiWUEf3CiYnPjNeJPYhYo6ZSBNqk,25996
|
|
10
24
|
general_manager/bucket/databaseBucket.py,sha256=5k0Q7iDJUgnOqQMg2SG35nM16C7_E5TzNMGJc0BVzXM,17127
|
|
11
25
|
general_manager/bucket/groupBucket.py,sha256=-cN9jA_AOsnrpwmjiy6jTB_TFoUqLMeM1SdJ6DlSXag,12103
|
|
12
|
-
general_manager/cache/__init__.py,sha256=
|
|
26
|
+
general_manager/cache/__init__.py,sha256=_jwrpqGzlwaL1moqG1B9XL9V-QW08VVdtDbkVDfN_sU,698
|
|
13
27
|
general_manager/cache/cacheDecorator.py,sha256=kgUvJHcC8tilqf1JH2QvyG-158AT_rmuKf6pgUy1IBs,3406
|
|
14
28
|
general_manager/cache/cacheTracker.py,sha256=rb637hGHOe79sehpTZLhfO979qrYLw3ATufo7kr_VvM,2991
|
|
15
29
|
general_manager/cache/dependencyIndex.py,sha256=gaSbEpw9qdIMgf_5jRryuTAvq9x3hwMxP2bi5S4xj84,13206
|
|
16
30
|
general_manager/cache/modelDependencyCollector.py,sha256=iFiuuQKO3-sEcUxbpA1svxL2TMkr8F6afAtRXK5fUBk,2645
|
|
17
31
|
general_manager/cache/signals.py,sha256=pKibv1EL7fYL4KB7O13TpqVTKZLnqo6A620vKlXaNkg,2015
|
|
18
|
-
general_manager/factory/__init__.py,sha256=
|
|
32
|
+
general_manager/factory/__init__.py,sha256=t9RLlp_ZPU_0Xu5I7hg-xwo3yy1eSwnvfXMYvpGCFtE,714
|
|
19
33
|
general_manager/factory/autoFactory.py,sha256=j5jy5FASG8xhToE1yCwQ8c53XLsKBtPLFYPWS17K9Fk,8441
|
|
20
34
|
general_manager/factory/factories.py,sha256=7rmO7tIBDiBpRoXUbPleNHYuXs0owAMGcoOsFTKr3KA,8475
|
|
21
35
|
general_manager/factory/factoryMethods.py,sha256=gFHctepxvdNJKASuNvj5RrDCheIpBYQHh3D0n7OeIsM,5018
|
|
22
|
-
general_manager/interface/__init__.py,sha256=
|
|
36
|
+
general_manager/interface/__init__.py,sha256=kLcHRvDb9_lxNgNEp4GXZ3qCZc5tHwruEt1tz3nDgtA,726
|
|
23
37
|
general_manager/interface/baseInterface.py,sha256=Gg1r1rzgn2AM2IC4lDUg2Q5m8AwlX-c_9RVKgALeGa4,10797
|
|
24
38
|
general_manager/interface/calculationInterface.py,sha256=5xr4pnn3XNYXlEBgsI9YbSjCXBGeVA11x7pgicPqgW8,5079
|
|
25
39
|
general_manager/interface/databaseBasedInterface.py,sha256=lRAmjaTUHKk250S4F2WKe--52xvYiip3pfIrG1mfB-g,24096
|
|
26
40
|
general_manager/interface/databaseInterface.py,sha256=vDj2mgWnIrsvcu1_HBq018303WndhqUL0o2qnNsQ6hM,8356
|
|
27
41
|
general_manager/interface/models.py,sha256=rtuhOKeSgD2DboeZIMAQU99JyCOT7SuiuGqWvDjAQqk,3576
|
|
28
42
|
general_manager/interface/readOnlyInterface.py,sha256=UcaCClVJv8IT-EBm__IN4jU6td_sXRRCN_Y_OKngs_4,11392
|
|
29
|
-
general_manager/manager/__init__.py,sha256=
|
|
43
|
+
general_manager/manager/__init__.py,sha256=UwvLs13_UpYsq5igSY78cbyg11C6iTrHlr-rtDql43I,703
|
|
30
44
|
general_manager/manager/generalManager.py,sha256=A6kYjM2duxT0AAeN0er87gRWjLmcPmEjPmNHTQgACgs,9577
|
|
31
45
|
general_manager/manager/groupManager.py,sha256=3Wl40cBRc1hL35zBCQDi8V2AIERh_dtbUeL1h1ZCnak,6428
|
|
32
46
|
general_manager/manager/input.py,sha256=UoVU0FDXHDEmuOk7mppx63DuwbPK2_qolcILar2Kk6U,3031
|
|
33
47
|
general_manager/manager/meta.py,sha256=iGYwuVrM0SWyvzVPLTS0typ8VT38QoxFuWhA1b1FBnA,5032
|
|
34
|
-
general_manager/measurement/__init__.py,sha256=
|
|
48
|
+
general_manager/measurement/__init__.py,sha256=Tt2Es7J-dGWcd8bFK4PR2m4AKBlRoj2WGXcKy64fOTY,711
|
|
35
49
|
general_manager/measurement/measurement.py,sha256=FOtnOASNV6qhYsIsN-VX9JuGWwvpmJqusMgYxkEHhqE,16876
|
|
36
50
|
general_manager/measurement/measurementField.py,sha256=4W12etl4OukuQOf2K016KZ9K7LtzgEE1FEIW2jySzRM,13227
|
|
37
|
-
general_manager/permission/__init__.py,sha256=
|
|
51
|
+
general_manager/permission/__init__.py,sha256=myUSLuG30I4OQa7CvKFuloKAAEJCir6ew27Tlc6653Q,730
|
|
38
52
|
general_manager/permission/basePermission.py,sha256=Gv-6HkX_MXqm1RZxKvK_J-9cuSOEOYn5yYWAzL8PjlA,6728
|
|
39
53
|
general_manager/permission/fileBasedPermission.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
54
|
general_manager/permission/managerBasedPermission.py,sha256=KgTUl7_oDjCuQlPrgTkjoduA9w04TWAK1jWZ1T0PiwE,7795
|
|
@@ -42,10 +56,10 @@ general_manager/permission/mutationPermission.py,sha256=QuGpdX8lyM-_xxclYXXwDVxJ
|
|
|
42
56
|
general_manager/permission/permissionChecks.py,sha256=l09zokWPwZKUTlJOxtE5r_ZdPDDIDxGoAbydL4wHmII,2253
|
|
43
57
|
general_manager/permission/permissionDataManager.py,sha256=Jf5JiqKH4CdnxeNGqfB3NnkjL5qzERaYvj7qprw_05c,3190
|
|
44
58
|
general_manager/permission/utils.py,sha256=gnKSSiet5U5Zm9o7E5-QdN29tX_VX6sv82K5evGVzPk,1629
|
|
45
|
-
general_manager/rule/__init__.py,sha256=
|
|
59
|
+
general_manager/rule/__init__.py,sha256=BHTtPyZ6sCXBeJgToL5VGoxsGCdwEi5R5qcT4xMYL_k,690
|
|
46
60
|
general_manager/rule/handler.py,sha256=h85-Oazhc4gpWNl8ieR4pDEtu8a8lTeJcbiEj11C4Nw,11349
|
|
47
61
|
general_manager/rule/rule.py,sha256=uo1XT_5lN11t5AmFg5v5AsIC1-JkmqannQvAPHmyQXY,11303
|
|
48
|
-
general_manager/utils/__init__.py,sha256=
|
|
62
|
+
general_manager/utils/__init__.py,sha256=BADJHiMBYpT1MKtnls3P0V6sdmd2UX8VgEAlQu_KliI,700
|
|
49
63
|
general_manager/utils/argsToKwargs.py,sha256=XYIEgPBeIvJoNWeqmO6djRrqo3IcnPcoSUbfWrUByI0,1294
|
|
50
64
|
general_manager/utils/filterParser.py,sha256=6GzcpCzMRkmJkNs6SttJqS4DQHa_-nYheyhSWDrhIrg,5100
|
|
51
65
|
general_manager/utils/formatString.py,sha256=McmsBaB1DnA4YVKswXn5rqNRPHUEiX6dID69YBzfoh0,1511
|
|
@@ -55,8 +69,8 @@ general_manager/utils/noneToZero.py,sha256=e3zk8Ofh3AsYW8spYmZWiv7FjOsr0jvfB9AOQ
|
|
|
55
69
|
general_manager/utils/pathMapping.py,sha256=3BWRUM1EimUKeh8i_UK6nYsKtOJDykgmZgCA9dgYjqU,9531
|
|
56
70
|
general_manager/utils/public_api.py,sha256=SNTI_tRMcbv0qMttm-wMBoAEkqSEFMTI6ZHMajOnDlg,1437
|
|
57
71
|
general_manager/utils/testing.py,sha256=BCquJ5RNiLbRFdcrgYP227TxSRfQKgpkvmWvsJqJAjk,13276
|
|
58
|
-
generalmanager-0.
|
|
59
|
-
generalmanager-0.
|
|
60
|
-
generalmanager-0.
|
|
61
|
-
generalmanager-0.
|
|
62
|
-
generalmanager-0.
|
|
72
|
+
generalmanager-0.16.1.dist-info/licenses/LICENSE,sha256=OezwCA4X2-xXmRDvMaqHvHCeUmGtyCYjZ8F3XUxSGwc,1069
|
|
73
|
+
generalmanager-0.16.1.dist-info/METADATA,sha256=YHfoHcCYb9AdJH0_XkWeVXHmfmW6vzZ5AnBaral6Jrk,8175
|
|
74
|
+
generalmanager-0.16.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
75
|
+
generalmanager-0.16.1.dist-info/top_level.txt,sha256=sTDtExP9ga-YP3h3h42yivUY-A2Q23C2nw6LNKOho4I,16
|
|
76
|
+
generalmanager-0.16.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|