mtcli 3.7.0.dev3__tar.gz → 3.7.0.dev5__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.
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/PKG-INFO +1 -1
- mtcli-3.7.0.dev5/mtcli/plugin_loader - Copia.py +98 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugin_loader.py +4 -4
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/pyproject.toml +1 -1
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/LICENSE +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/README.md +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/cli.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/commands/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/commands/bars.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/commands/conf.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/conecta.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/conf.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/config_registre.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/data/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/data/base.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/data/csv.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/data/mt5.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/database.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/domain/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/domain/timeframe.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/logger.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/marketdata/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/marketdata/tick_cache.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/marketdata/tick_repository.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/bar_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/bars_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/chart_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/conf_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/consecutive_bars_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/rates_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/signals_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/models/unconsecutive_bar_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/mt5_context.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugin.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugin_manager.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/exemplo.py-dist +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/cli.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/conf.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/models/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/models/model_media_movel.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/tests/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/tests/test_mm.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/tests/test_model_media_movel.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/cli.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/conf.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/models/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/models/average_range_model.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/tests/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/tests/test_rm.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/cli.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/conf.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/models/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/models/model_average_volume.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/tests/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/tests/test_vm.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/__init__.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/close_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/full_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/high_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/low_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/min_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/open_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/ranges_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/rates_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/vars_view.py +0 -0
- {mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/views/volumes_view.py +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Sistema de carregamento de plugins do mtcli.
|
|
3
|
+
|
|
4
|
+
Este módulo carrega automaticamente:
|
|
5
|
+
|
|
6
|
+
1. Plugins internos localizados em `mtcli.plugins`
|
|
7
|
+
2. Plugins externos registrados via entry points `mtcli.plugins`
|
|
8
|
+
|
|
9
|
+
Plugins devem expor uma função:
|
|
10
|
+
|
|
11
|
+
register(cli)
|
|
12
|
+
|
|
13
|
+
onde `cli` é o grupo principal do Click.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import importlib
|
|
17
|
+
import pkgutil
|
|
18
|
+
|
|
19
|
+
import click
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
from importlib.metadata import entry_points
|
|
23
|
+
except ImportError: # Python < 3.10
|
|
24
|
+
from importlib_metadata import entry_points
|
|
25
|
+
|
|
26
|
+
import mtcli.plugins
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def load_internal_plugins(cli: click.Group) -> None:
|
|
30
|
+
"""
|
|
31
|
+
Carrega plugins internos do pacote `mtcli.plugins`.
|
|
32
|
+
|
|
33
|
+
Cada módulo encontrado deve expor a função:
|
|
34
|
+
|
|
35
|
+
register(cli)
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
cli: grupo principal do Click.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
for module_info in pkgutil.iter_modules(mtcli.plugins.__path__):
|
|
42
|
+
|
|
43
|
+
module_name = f"mtcli.plugins.{module_info.name}"
|
|
44
|
+
|
|
45
|
+
module = importlib.import_module(module_name)
|
|
46
|
+
|
|
47
|
+
if hasattr(module, "register"):
|
|
48
|
+
module.register(cli)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def load_external_plugins(cli: click.Group) -> None:
|
|
52
|
+
"""
|
|
53
|
+
Carrega plugins externos instalados via entry points.
|
|
54
|
+
|
|
55
|
+
Os plugins devem declarar no pyproject.toml:
|
|
56
|
+
|
|
57
|
+
[project.entry-points."mtcli.plugins"]
|
|
58
|
+
nome = "pacote.plugin:register"
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
cli: grupo principal do Click.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
eps = entry_points()
|
|
65
|
+
|
|
66
|
+
plugins = (
|
|
67
|
+
eps.select(group="mtcli.plugins")
|
|
68
|
+
if hasattr(eps, "select")
|
|
69
|
+
else eps.get("mtcli.plugins", [])
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
for ep in plugins:
|
|
73
|
+
|
|
74
|
+
plugin = ep.load()
|
|
75
|
+
|
|
76
|
+
if callable(plugin) and not isinstance(plugin, click.Command):
|
|
77
|
+
plugin(cli)
|
|
78
|
+
|
|
79
|
+
elif isinstance(plugin, click.Command):
|
|
80
|
+
cli.add_command(plugin)
|
|
81
|
+
|
|
82
|
+
else:
|
|
83
|
+
raise TypeError(
|
|
84
|
+
f"Plugin {ep.name} inválido: deve ser um comando Click ou função register."
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def load_plugins(cli: click.Group) -> None:
|
|
89
|
+
"""
|
|
90
|
+
Carrega todos os plugins (internos e externos).
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
cli: grupo principal do Click.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
load_internal_plugins(cli)
|
|
97
|
+
load_external_plugins(cli)
|
|
98
|
+
|
|
@@ -8,8 +8,8 @@ Este módulo descobre e registra plugins de duas fontes:
|
|
|
8
8
|
|
|
9
9
|
Plugins podem expor:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
função ``register(cli)``
|
|
12
|
+
objeto ``click.Command``
|
|
13
13
|
|
|
14
14
|
Entry point exemplo:
|
|
15
15
|
|
|
@@ -78,8 +78,8 @@ def register_plugin(cli: click.Group, plugin, name: str) -> None:
|
|
|
78
78
|
|
|
79
79
|
O plugin pode ser:
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
função ``register(cli)``
|
|
82
|
+
objeto ``click.Command``
|
|
83
83
|
|
|
84
84
|
Parameters
|
|
85
85
|
----------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/media_movel/tests/test_model_media_movel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/range_medio/models/average_range_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mtcli-3.7.0.dev3 → mtcli-3.7.0.dev5}/mtcli/plugins/volume_medio/models/model_average_volume.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|