ergon-framework-python 0.1.9__py3-none-any.whl → 0.2.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.
- ergon/__init__.py +1 -1
- ergon/connector/__init__.py +144 -57
- ergon/connector/_lazy.py +51 -0
- ergon/connector/ergon_platform/__init__.py +28 -2
- ergon/connector/ergon_platform/_client.py +4 -1
- ergon/connector/excel/__init__.py +28 -2
- ergon/connector/nylas/__init__.py +36 -6
- ergon/connector/pipefy/__init__.py +32 -4
- ergon/connector/postgres/__init__.py +28 -2
- ergon/connector/rabbitmq/__init__.py +32 -4
- ergon/connector/rabbitmq/async_service.py +192 -224
- ergon/connector/rabbitmq/models.py +9 -1
- ergon/connector/sqs/__init__.py +32 -4
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/METADATA +40 -11
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/RECORD +19 -18
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/WHEEL +1 -1
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/entry_points.txt +0 -0
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {ergon_framework_python-0.1.9.dist-info → ergon_framework_python-0.2.0.dist-info}/top_level.txt +0 -0
ergon/__init__.py
CHANGED
ergon/connector/__init__.py
CHANGED
|
@@ -1,63 +1,150 @@
|
|
|
1
|
+
from importlib import import_module
|
|
2
|
+
from typing import TYPE_CHECKING, Any
|
|
3
|
+
|
|
4
|
+
from ._lazy import exported_names, load_export
|
|
1
5
|
from .connector import AsyncConnector, Connector, ConnectorConfig
|
|
2
|
-
from .ergon_platform import (
|
|
3
|
-
AsyncErgonPlatformConnector,
|
|
4
|
-
CreateItemInput,
|
|
5
|
-
ErgonPlatformClient,
|
|
6
|
-
ErgonPlatformConnector,
|
|
7
|
-
ErgonPlatformConsumerConfig,
|
|
8
|
-
ErgonPlatformProducerConfig,
|
|
9
|
-
)
|
|
10
|
-
from .excel import ExcelConnector, ExcelFetchConfig, ExcelRow, ExcelService
|
|
11
|
-
from .nylas import (
|
|
12
|
-
AckActionConfig,
|
|
13
|
-
AsyncNylasAuthService,
|
|
14
|
-
AsyncNylasConnector,
|
|
15
|
-
AsyncNylasService,
|
|
16
|
-
AuthUrlConfig,
|
|
17
|
-
CodeExchangeInput,
|
|
18
|
-
GrantAuthResult,
|
|
19
|
-
MessageQueryFilter,
|
|
20
|
-
NylasAuthClient,
|
|
21
|
-
NylasAuthService,
|
|
22
|
-
NylasClient,
|
|
23
|
-
NylasConnector,
|
|
24
|
-
NylasConsumerConfig,
|
|
25
|
-
NylasProducerConfig,
|
|
26
|
-
NylasService,
|
|
27
|
-
SendMessageInput,
|
|
28
|
-
)
|
|
29
|
-
from .postgres import (
|
|
30
|
-
AsyncPostgresConnector,
|
|
31
|
-
AsyncPostgresService,
|
|
32
|
-
PostgresClient,
|
|
33
|
-
PostgresConsumerConfig,
|
|
34
|
-
PostgresProducerConfig,
|
|
35
|
-
)
|
|
36
|
-
from .rabbitmq import (
|
|
37
|
-
AsyncRabbitmqClient,
|
|
38
|
-
AsyncRabbitMQConnector,
|
|
39
|
-
AsyncRabbitmqConsumerConfig,
|
|
40
|
-
AsyncRabbitmqExchangeBinding,
|
|
41
|
-
AsyncRabbitmqProducerConfig,
|
|
42
|
-
AsyncRabbitmqQueueSubscription,
|
|
43
|
-
AsyncRabbitMQService,
|
|
44
|
-
RabbitmqClient,
|
|
45
|
-
RabbitMQConnector,
|
|
46
|
-
RabbitmqConsumerMessage,
|
|
47
|
-
RabbitmqProducerMessage,
|
|
48
|
-
RabbitMQService,
|
|
49
|
-
)
|
|
50
|
-
from .sqs import (
|
|
51
|
-
AsyncSQSConnector,
|
|
52
|
-
AsyncSQSService,
|
|
53
|
-
SQSClient,
|
|
54
|
-
SQSConnector,
|
|
55
|
-
SQSConsumerConfig,
|
|
56
|
-
SQSProducerConfig,
|
|
57
|
-
SQSService,
|
|
58
|
-
)
|
|
59
6
|
from .transaction import Transaction
|
|
60
7
|
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .ergon_platform import (
|
|
10
|
+
AsyncErgonPlatformConnector,
|
|
11
|
+
CreateItemInput,
|
|
12
|
+
ErgonPlatformClient,
|
|
13
|
+
ErgonPlatformConnector,
|
|
14
|
+
ErgonPlatformConsumerConfig,
|
|
15
|
+
ErgonPlatformProducerConfig,
|
|
16
|
+
)
|
|
17
|
+
from .excel import ExcelConnector, ExcelFetchConfig, ExcelRow, ExcelService
|
|
18
|
+
from .nylas import (
|
|
19
|
+
AckActionConfig,
|
|
20
|
+
AsyncNylasAuthService,
|
|
21
|
+
AsyncNylasConnector,
|
|
22
|
+
AsyncNylasService,
|
|
23
|
+
AuthUrlConfig,
|
|
24
|
+
CodeExchangeInput,
|
|
25
|
+
GrantAuthResult,
|
|
26
|
+
MessageQueryFilter,
|
|
27
|
+
NylasAuthClient,
|
|
28
|
+
NylasAuthService,
|
|
29
|
+
NylasClient,
|
|
30
|
+
NylasConnector,
|
|
31
|
+
NylasConsumerConfig,
|
|
32
|
+
NylasProducerConfig,
|
|
33
|
+
NylasService,
|
|
34
|
+
SendMessageInput,
|
|
35
|
+
)
|
|
36
|
+
from .postgres import (
|
|
37
|
+
AsyncPostgresConnector,
|
|
38
|
+
AsyncPostgresService,
|
|
39
|
+
PostgresClient,
|
|
40
|
+
PostgresConsumerConfig,
|
|
41
|
+
PostgresProducerConfig,
|
|
42
|
+
)
|
|
43
|
+
from .rabbitmq import (
|
|
44
|
+
AsyncRabbitmqClient,
|
|
45
|
+
AsyncRabbitMQConnector,
|
|
46
|
+
AsyncRabbitmqConsumerConfig,
|
|
47
|
+
AsyncRabbitmqExchangeBinding,
|
|
48
|
+
AsyncRabbitmqProducerConfig,
|
|
49
|
+
AsyncRabbitmqQueueSubscription,
|
|
50
|
+
AsyncRabbitMQService,
|
|
51
|
+
RabbitmqClient,
|
|
52
|
+
RabbitMQConnector,
|
|
53
|
+
RabbitmqConsumerMessage,
|
|
54
|
+
RabbitmqProducerMessage,
|
|
55
|
+
RabbitMQService,
|
|
56
|
+
)
|
|
57
|
+
from .sqs import (
|
|
58
|
+
AsyncSQSConnector,
|
|
59
|
+
AsyncSQSService,
|
|
60
|
+
SQSClient,
|
|
61
|
+
SQSConnector,
|
|
62
|
+
SQSConsumerConfig,
|
|
63
|
+
SQSProducerConfig,
|
|
64
|
+
SQSService,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
_CONNECTOR_SUBPACKAGES = (
|
|
68
|
+
"ergon_platform",
|
|
69
|
+
"excel",
|
|
70
|
+
"nylas",
|
|
71
|
+
"pipefy",
|
|
72
|
+
"postgres",
|
|
73
|
+
"rabbitmq",
|
|
74
|
+
"sqs",
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
_LAZY_EXPORTS = {
|
|
78
|
+
"AckActionConfig": "nylas",
|
|
79
|
+
"AsyncErgonPlatformConnector": "ergon_platform",
|
|
80
|
+
"AsyncNylasAuthService": "nylas",
|
|
81
|
+
"AsyncNylasConnector": "nylas",
|
|
82
|
+
"AsyncNylasService": "nylas",
|
|
83
|
+
"AsyncPostgresConnector": "postgres",
|
|
84
|
+
"AsyncPostgresService": "postgres",
|
|
85
|
+
"AsyncRabbitMQConnector": "rabbitmq",
|
|
86
|
+
"AsyncRabbitMQService": "rabbitmq",
|
|
87
|
+
"AsyncRabbitmqClient": "rabbitmq",
|
|
88
|
+
"AsyncRabbitmqConsumerConfig": "rabbitmq",
|
|
89
|
+
"AsyncRabbitmqExchangeBinding": "rabbitmq",
|
|
90
|
+
"AsyncRabbitmqProducerConfig": "rabbitmq",
|
|
91
|
+
"AsyncRabbitmqQueueSubscription": "rabbitmq",
|
|
92
|
+
"AsyncSQSConnector": "sqs",
|
|
93
|
+
"AsyncSQSService": "sqs",
|
|
94
|
+
"AuthUrlConfig": "nylas",
|
|
95
|
+
"CodeExchangeInput": "nylas",
|
|
96
|
+
"CreateItemInput": "ergon_platform",
|
|
97
|
+
"ErgonPlatformClient": "ergon_platform",
|
|
98
|
+
"ErgonPlatformConnector": "ergon_platform",
|
|
99
|
+
"ErgonPlatformConsumerConfig": "ergon_platform",
|
|
100
|
+
"ErgonPlatformProducerConfig": "ergon_platform",
|
|
101
|
+
"ExcelConnector": "excel",
|
|
102
|
+
"ExcelFetchConfig": "excel",
|
|
103
|
+
"ExcelRow": "excel",
|
|
104
|
+
"ExcelService": "excel",
|
|
105
|
+
"GrantAuthResult": "nylas",
|
|
106
|
+
"MessageQueryFilter": "nylas",
|
|
107
|
+
"NylasAuthClient": "nylas",
|
|
108
|
+
"NylasAuthService": "nylas",
|
|
109
|
+
"NylasClient": "nylas",
|
|
110
|
+
"NylasConnector": "nylas",
|
|
111
|
+
"NylasConsumerConfig": "nylas",
|
|
112
|
+
"NylasProducerConfig": "nylas",
|
|
113
|
+
"NylasService": "nylas",
|
|
114
|
+
"PostgresClient": "postgres",
|
|
115
|
+
"PostgresConsumerConfig": "postgres",
|
|
116
|
+
"PostgresProducerConfig": "postgres",
|
|
117
|
+
"RabbitMQConnector": "rabbitmq",
|
|
118
|
+
"RabbitMQService": "rabbitmq",
|
|
119
|
+
"RabbitmqClient": "rabbitmq",
|
|
120
|
+
"RabbitmqConsumerMessage": "rabbitmq",
|
|
121
|
+
"RabbitmqProducerMessage": "rabbitmq",
|
|
122
|
+
"SQSClient": "sqs",
|
|
123
|
+
"SQSConnector": "sqs",
|
|
124
|
+
"SQSConsumerConfig": "sqs",
|
|
125
|
+
"SQSProducerConfig": "sqs",
|
|
126
|
+
"SQSService": "sqs",
|
|
127
|
+
"SendMessageInput": "nylas",
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def __getattr__(name: str) -> Any:
|
|
132
|
+
if name in _CONNECTOR_SUBPACKAGES:
|
|
133
|
+
module = import_module(f".{name}", __name__)
|
|
134
|
+
globals()[name] = module
|
|
135
|
+
return module
|
|
136
|
+
return load_export(
|
|
137
|
+
name=name,
|
|
138
|
+
package=__name__,
|
|
139
|
+
exports=_LAZY_EXPORTS,
|
|
140
|
+
namespace=globals(),
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def __dir__() -> list[str]:
|
|
145
|
+
return sorted(set(exported_names(globals(), _LAZY_EXPORTS)) | set(_CONNECTOR_SUBPACKAGES))
|
|
146
|
+
|
|
147
|
+
|
|
61
148
|
__all__ = [
|
|
62
149
|
"AckActionConfig",
|
|
63
150
|
"AsyncConnector",
|
ergon/connector/_lazy.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Helpers for loading connector implementations only when requested."""
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import Any, Mapping, MutableMapping, Sequence
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def load_export(
|
|
8
|
+
*,
|
|
9
|
+
name: str,
|
|
10
|
+
package: str,
|
|
11
|
+
exports: Mapping[str, str],
|
|
12
|
+
namespace: MutableMapping[str, Any],
|
|
13
|
+
) -> Any:
|
|
14
|
+
"""Load and cache one lazily exported attribute."""
|
|
15
|
+
module_name = exports.get(name)
|
|
16
|
+
if module_name is None:
|
|
17
|
+
raise AttributeError(f"module {package!r} has no attribute {name!r}")
|
|
18
|
+
|
|
19
|
+
module = import_module(f".{module_name}", package)
|
|
20
|
+
value = getattr(module, name)
|
|
21
|
+
namespace[name] = value
|
|
22
|
+
return value
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def load_optional_export(
|
|
26
|
+
*,
|
|
27
|
+
name: str,
|
|
28
|
+
package: str,
|
|
29
|
+
exports: Mapping[str, str],
|
|
30
|
+
namespace: MutableMapping[str, Any],
|
|
31
|
+
extra: str,
|
|
32
|
+
dependencies: Sequence[str],
|
|
33
|
+
) -> Any:
|
|
34
|
+
"""Load a connector export and explain how to install a missing extra."""
|
|
35
|
+
try:
|
|
36
|
+
return load_export(name=name, package=package, exports=exports, namespace=namespace)
|
|
37
|
+
except ModuleNotFoundError as exc:
|
|
38
|
+
missing_module = exc.name or ""
|
|
39
|
+
if not any(
|
|
40
|
+
missing_module == dependency or missing_module.startswith(f"{dependency}.") for dependency in dependencies
|
|
41
|
+
):
|
|
42
|
+
raise
|
|
43
|
+
raise ImportError(
|
|
44
|
+
f"The {extra!r} connector dependencies are not installed. "
|
|
45
|
+
f"Install them with: pip install 'ergon-framework-python[{extra}]'"
|
|
46
|
+
) from exc
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def exported_names(namespace: Mapping[str, Any], exports: Mapping[str, str]) -> list[str]:
|
|
50
|
+
"""Return module names including lazy exports for interactive discovery."""
|
|
51
|
+
return sorted(set(namespace) | set(exports))
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from .._lazy import exported_names, load_optional_export
|
|
3
4
|
from .models import (
|
|
4
5
|
CreateItemInput,
|
|
5
6
|
ErgonPlatformClient,
|
|
@@ -7,6 +8,31 @@ from .models import (
|
|
|
7
8
|
ErgonPlatformProducerConfig,
|
|
8
9
|
)
|
|
9
10
|
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from .async_connector import AsyncErgonPlatformConnector
|
|
13
|
+
from .connector import ErgonPlatformConnector
|
|
14
|
+
|
|
15
|
+
_LAZY_EXPORTS = {
|
|
16
|
+
"AsyncErgonPlatformConnector": "async_connector",
|
|
17
|
+
"ErgonPlatformConnector": "connector",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def __getattr__(name: str) -> Any:
|
|
22
|
+
return load_optional_export(
|
|
23
|
+
name=name,
|
|
24
|
+
package=__name__,
|
|
25
|
+
exports=_LAZY_EXPORTS,
|
|
26
|
+
namespace=globals(),
|
|
27
|
+
extra="ergon-platform",
|
|
28
|
+
dependencies=("ergon_platform", "httpx"),
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def __dir__() -> list[str]:
|
|
33
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
34
|
+
|
|
35
|
+
|
|
10
36
|
__all__ = [
|
|
11
37
|
"AsyncErgonPlatformConnector",
|
|
12
38
|
"CreateItemInput",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from .models import ErgonPlatformClient
|
|
2
2
|
|
|
3
|
-
_ERGON_PLATFORM_IMPORT_ERROR =
|
|
3
|
+
_ERGON_PLATFORM_IMPORT_ERROR = (
|
|
4
|
+
"The 'ergon-platform' connector dependencies are not installed. "
|
|
5
|
+
"Install them with: pip install 'ergon-framework-python[ergon-platform]'"
|
|
6
|
+
)
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
def _get_ergon_client():
|
|
@@ -6,9 +6,35 @@ Provides transaction-based access to Excel files with support for:
|
|
|
6
6
|
- Sharding for parallel processing
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from typing import TYPE_CHECKING, Any
|
|
10
|
+
|
|
11
|
+
from .._lazy import exported_names, load_optional_export
|
|
10
12
|
from .models import ExcelFetchConfig, ExcelRow
|
|
11
|
-
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from .connector import ExcelConnector
|
|
16
|
+
from .service import ExcelService
|
|
17
|
+
|
|
18
|
+
_LAZY_EXPORTS = {
|
|
19
|
+
"ExcelConnector": "connector",
|
|
20
|
+
"ExcelService": "service",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def __getattr__(name: str) -> Any:
|
|
25
|
+
return load_optional_export(
|
|
26
|
+
name=name,
|
|
27
|
+
package=__name__,
|
|
28
|
+
exports=_LAZY_EXPORTS,
|
|
29
|
+
namespace=globals(),
|
|
30
|
+
extra="excel",
|
|
31
|
+
dependencies=("openpyxl",),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def __dir__() -> list[str]:
|
|
36
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
37
|
+
|
|
12
38
|
|
|
13
39
|
__all__ = [
|
|
14
40
|
"ExcelConnector",
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
-
from .auth_service import NylasAuthService
|
|
5
|
-
from .connector import NylasConnector
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from .._lazy import exported_names, load_optional_export
|
|
6
4
|
from .models import (
|
|
7
5
|
AckActionConfig,
|
|
8
6
|
AttachmentInput,
|
|
@@ -19,7 +17,39 @@ from .models import (
|
|
|
19
17
|
NylasProducerConfig,
|
|
20
18
|
SendMessageInput,
|
|
21
19
|
)
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from .async_auth_service import AsyncNylasAuthService
|
|
23
|
+
from .async_connector import AsyncNylasConnector
|
|
24
|
+
from .async_service import AsyncNylasService
|
|
25
|
+
from .auth_service import NylasAuthService
|
|
26
|
+
from .connector import NylasConnector
|
|
27
|
+
from .service import NylasService
|
|
28
|
+
|
|
29
|
+
_LAZY_EXPORTS = {
|
|
30
|
+
"AsyncNylasAuthService": "async_auth_service",
|
|
31
|
+
"AsyncNylasConnector": "async_connector",
|
|
32
|
+
"AsyncNylasService": "async_service",
|
|
33
|
+
"NylasAuthService": "auth_service",
|
|
34
|
+
"NylasConnector": "connector",
|
|
35
|
+
"NylasService": "service",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __getattr__(name: str) -> Any:
|
|
40
|
+
return load_optional_export(
|
|
41
|
+
name=name,
|
|
42
|
+
package=__name__,
|
|
43
|
+
exports=_LAZY_EXPORTS,
|
|
44
|
+
namespace=globals(),
|
|
45
|
+
extra="nylas",
|
|
46
|
+
dependencies=("nylas",),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def __dir__() -> list[str]:
|
|
51
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
52
|
+
|
|
23
53
|
|
|
24
54
|
__all__ = [
|
|
25
55
|
"AckActionConfig",
|
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from .._lazy import exported_names, load_optional_export
|
|
4
4
|
from .models import (
|
|
5
5
|
CreateCardInput,
|
|
6
6
|
FieldFilter,
|
|
7
7
|
FieldFilterOperator,
|
|
8
8
|
PipefyClient,
|
|
9
9
|
)
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from .async_connector import AsyncPipefyConnector
|
|
13
|
+
from .async_service import AsyncPipefyService
|
|
14
|
+
from .connector import PipefyConnector
|
|
15
|
+
from .service import PipefyService
|
|
16
|
+
|
|
17
|
+
_LAZY_EXPORTS = {
|
|
18
|
+
"AsyncPipefyConnector": "async_connector",
|
|
19
|
+
"AsyncPipefyService": "async_service",
|
|
20
|
+
"PipefyConnector": "connector",
|
|
21
|
+
"PipefyService": "service",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def __getattr__(name: str) -> Any:
|
|
26
|
+
return load_optional_export(
|
|
27
|
+
name=name,
|
|
28
|
+
package=__name__,
|
|
29
|
+
exports=_LAZY_EXPORTS,
|
|
30
|
+
namespace=globals(),
|
|
31
|
+
extra="pipefy",
|
|
32
|
+
dependencies=("httpx", "requests"),
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __dir__() -> list[str]:
|
|
37
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
38
|
+
|
|
11
39
|
|
|
12
40
|
__all__ = [
|
|
13
41
|
"AsyncPipefyConnector",
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from .._lazy import exported_names, load_optional_export
|
|
3
4
|
from .models import PostgresClient, PostgresConsumerConfig, PostgresProducerConfig
|
|
4
5
|
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from .async_connector import AsyncPostgresConnector
|
|
8
|
+
from .async_service import AsyncPostgresService
|
|
9
|
+
|
|
10
|
+
_LAZY_EXPORTS = {
|
|
11
|
+
"AsyncPostgresConnector": "async_connector",
|
|
12
|
+
"AsyncPostgresService": "async_service",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def __getattr__(name: str) -> Any:
|
|
17
|
+
return load_optional_export(
|
|
18
|
+
name=name,
|
|
19
|
+
package=__name__,
|
|
20
|
+
exports=_LAZY_EXPORTS,
|
|
21
|
+
namespace=globals(),
|
|
22
|
+
extra="postgres",
|
|
23
|
+
dependencies=("asyncpg",),
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def __dir__() -> list[str]:
|
|
28
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
29
|
+
|
|
30
|
+
|
|
5
31
|
__all__ = [
|
|
6
32
|
"AsyncPostgresConnector",
|
|
7
33
|
"AsyncPostgresService",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from .._lazy import exported_names, load_optional_export
|
|
4
4
|
from .models import (
|
|
5
5
|
AsyncRabbitmqClient,
|
|
6
6
|
AsyncRabbitmqConsumerConfig,
|
|
@@ -11,7 +11,35 @@ from .models import (
|
|
|
11
11
|
RabbitmqConsumerMessage,
|
|
12
12
|
RabbitmqProducerMessage,
|
|
13
13
|
)
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from .async_connector import AsyncRabbitMQConnector
|
|
17
|
+
from .async_service import AsyncRabbitMQService
|
|
18
|
+
from .connector import RabbitMQConnector
|
|
19
|
+
from .service import RabbitMQService
|
|
20
|
+
|
|
21
|
+
_LAZY_EXPORTS = {
|
|
22
|
+
"AsyncRabbitMQConnector": "async_connector",
|
|
23
|
+
"AsyncRabbitMQService": "async_service",
|
|
24
|
+
"RabbitMQConnector": "connector",
|
|
25
|
+
"RabbitMQService": "service",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __getattr__(name: str) -> Any:
|
|
30
|
+
return load_optional_export(
|
|
31
|
+
name=name,
|
|
32
|
+
package=__name__,
|
|
33
|
+
exports=_LAZY_EXPORTS,
|
|
34
|
+
namespace=globals(),
|
|
35
|
+
extra="rabbitmq",
|
|
36
|
+
dependencies=("aio_pika", "aiormq", "pika"),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __dir__() -> list[str]:
|
|
41
|
+
return exported_names(globals(), _LAZY_EXPORTS)
|
|
42
|
+
|
|
15
43
|
|
|
16
44
|
__all__ = [
|
|
17
45
|
"AsyncRabbitMQConnector",
|