argenta 0.5.0b2__py3-none-any.whl → 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.
- argenta/app/autocompleter/entity.py +57 -13
- argenta/app/defaults.py +7 -4
- argenta/app/dividing_line/models.py +55 -13
- argenta/app/models.py +376 -175
- argenta/app/registered_routers/entity.py +20 -7
- argenta/command/__init__.py +1 -1
- argenta/command/exceptions.py +22 -3
- argenta/command/flag/__init__.py +2 -2
- argenta/command/flag/defaults.py +21 -11
- argenta/command/flag/models.py +73 -92
- argenta/command/flags/__init__.py +16 -0
- argenta/command/flags/models.py +90 -0
- argenta/command/models.py +124 -39
- argenta/orchestrator/__init__.py +4 -0
- argenta/orchestrator/argparser/__init__.py +4 -0
- argenta/orchestrator/argparser/arguments/__init__.py +8 -0
- argenta/orchestrator/argparser/arguments/models.py +56 -0
- argenta/orchestrator/argparser/entity.py +59 -0
- argenta/orchestrator/entity.py +35 -0
- argenta/response/__init__.py +5 -0
- argenta/response/entity.py +29 -0
- argenta/response/status.py +8 -0
- argenta/router/__init__.py +1 -1
- argenta/router/command_handler/entity.py +57 -11
- argenta/router/defaults.py +1 -2
- argenta/router/entity.py +181 -92
- argenta/router/exceptions.py +17 -6
- argenta-1.0.0.dist-info/METADATA +70 -0
- argenta-1.0.0.dist-info/RECORD +37 -0
- {argenta-0.5.0b2.dist-info → argenta-1.0.0.dist-info}/WHEEL +1 -1
- argenta/app/exceptions.py +0 -10
- argenta/router/command_handlers/__init__.py +0 -0
- argenta/router/command_handlers/entity.py +0 -21
- argenta-0.5.0b2.dist-info/METADATA +0 -601
- argenta-0.5.0b2.dist-info/RECORD +0 -29
- {argenta-0.5.0b2.dist-info → argenta-1.0.0.dist-info/licenses}/LICENSE +0 -0
argenta/router/exceptions.py
CHANGED
@@ -1,23 +1,34 @@
|
|
1
1
|
class RepeatedFlagNameException(Exception):
|
2
|
+
"""
|
3
|
+
Private. Raised when a repeated flag name is registered
|
4
|
+
"""
|
5
|
+
|
2
6
|
def __str__(self):
|
3
|
-
return "Repeated
|
7
|
+
return "Repeated registered flag names in register command"
|
4
8
|
|
5
9
|
|
6
10
|
class TooManyTransferredArgsException(Exception):
|
11
|
+
"""
|
12
|
+
Private. Raised when too many arguments are passed
|
13
|
+
"""
|
14
|
+
|
7
15
|
def __str__(self):
|
8
16
|
return "Too many transferred arguments"
|
9
17
|
|
10
18
|
|
11
19
|
class RequiredArgumentNotPassedException(Exception):
|
20
|
+
"""
|
21
|
+
Private. Raised when a required argument is not passed
|
22
|
+
"""
|
23
|
+
|
12
24
|
def __str__(self):
|
13
25
|
return "Required argument not passed"
|
14
26
|
|
15
27
|
|
16
|
-
class
|
17
|
-
|
18
|
-
|
19
|
-
|
28
|
+
class TriggerContainSpacesException(Exception):
|
29
|
+
"""
|
30
|
+
Private. Raised when there is a space in the trigger being registered
|
31
|
+
"""
|
20
32
|
|
21
|
-
class TriggerCannotContainSpacesException(Exception):
|
22
33
|
def __str__(self):
|
23
34
|
return "Command trigger cannot contain spaces"
|
@@ -0,0 +1,70 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: argenta
|
3
|
+
Version: 1.0.0
|
4
|
+
Summary: Python library for building modular CLI applications
|
5
|
+
Author-email: kolo <kolo.is.main@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
License-File: LICENSE
|
8
|
+
Requires-Python: <4.0,>=3.11
|
9
|
+
Requires-Dist: art<7.0,>=6.4
|
10
|
+
Requires-Dist: pyreadline3>=3.5.4
|
11
|
+
Requires-Dist: rich<15.0.0,>=14.0.0
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# Argenta
|
15
|
+
|
16
|
+
### Библиотека для создания модульных CLI приложeний
|
17
|
+
|
18
|
+

|
19
|
+
|
20
|
+
---
|
21
|
+
|
22
|
+
# Установка
|
23
|
+
```bash
|
24
|
+
pip install argenta
|
25
|
+
```
|
26
|
+
or
|
27
|
+
```bash
|
28
|
+
poetry add argenta
|
29
|
+
```
|
30
|
+
|
31
|
+
---
|
32
|
+
|
33
|
+
# Быстрый старт
|
34
|
+
|
35
|
+
Пример простейшего приложения
|
36
|
+
```python
|
37
|
+
# routers.py
|
38
|
+
from argenta.router import Router
|
39
|
+
from argenta.command import Command
|
40
|
+
|
41
|
+
|
42
|
+
router = Router()
|
43
|
+
|
44
|
+
@router.command(Command("hello"))
|
45
|
+
def handler():
|
46
|
+
print("Hello, world!")
|
47
|
+
```
|
48
|
+
|
49
|
+
```python
|
50
|
+
# main.py
|
51
|
+
from argenta.app import App
|
52
|
+
from argenta.orchestrator import Orchestrator
|
53
|
+
from routers import router
|
54
|
+
|
55
|
+
app: App = App()
|
56
|
+
orchestrator: Orchestrator = Orchestrator()
|
57
|
+
|
58
|
+
|
59
|
+
def main() -> None:
|
60
|
+
app.include_router(router)
|
61
|
+
orchestrator.start_polling(app)
|
62
|
+
|
63
|
+
|
64
|
+
if __name__ == '__main__':
|
65
|
+
main()
|
66
|
+
```
|
67
|
+
## Полная [документация](https://argenta-docs.vercel.app) | MIT 2025 kolo | made by [kolo](https://t.me/kolo_id)
|
68
|
+
|
69
|
+
|
70
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
argenta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
argenta/app/__init__.py,sha256=I8FTXU17ajDI-hbC6Rw0LxLmvDYipdQaos3v1pmu14E,57
|
3
|
+
argenta/app/defaults.py,sha256=z65HUXd1ogTk95-IWwluPDPz4MkZk1_3jfaSjdTZ4ME,393
|
4
|
+
argenta/app/models.py,sha256=yG3IhR9IrEd2YwrtqoZni6wht2rDOyocfoe5SmPv6cw,19153
|
5
|
+
argenta/app/autocompleter/__init__.py,sha256=VT_p3QA78UnczV7pYR2NnwQ0Atd8mnDUnLazvUQNqJk,93
|
6
|
+
argenta/app/autocompleter/entity.py,sha256=QgEZ2Tzfp9liWBCd-BdRpUE-ELUOxAhPpW7KBLVcPRE,3556
|
7
|
+
argenta/app/dividing_line/__init__.py,sha256=jJZDDZix8XYCAUWW4FzGJH0JmJlchYcx0FPWifjgv1I,147
|
8
|
+
argenta/app/dividing_line/models.py,sha256=syBTrzcIIt6E6RiaKC9QH3kdAuWLBDNIX0cH7Bnn0mk,2265
|
9
|
+
argenta/app/registered_routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
argenta/app/registered_routers/entity.py,sha256=OH7plYfjQrlyVliXE6OLVD2ftOAd5U1VO6SlyvLNikk,1078
|
11
|
+
argenta/command/__init__.py,sha256=RvacrM84ZwBdVDy4MUwjLTyzQdDQrjjoikZxwh5ov-0,69
|
12
|
+
argenta/command/exceptions.py,sha256=86Gs_9-NutmbSkduEMljtxQHWHhDRFcqyyOKDhQ440o,1060
|
13
|
+
argenta/command/models.py,sha256=9zzOEJt-jn1ke9HcQGnTOIvNZYrXn347rDzVzm2Ve5Y,7180
|
14
|
+
argenta/command/flag/__init__.py,sha256=4MOxfv8f2SkBzIfVo5LAZUTu4iH1jcs5WzPq60PhFMs,94
|
15
|
+
argenta/command/flag/defaults.py,sha256=1F9bEngv6tB_yn5lLQg5pxWZSuinryfGGdXnWD7EvuY,1035
|
16
|
+
argenta/command/flag/models.py,sha256=KAzyoNWVOVLiIT4f8auI15D0TCHosGXHGw_xXRuEtgY,3875
|
17
|
+
argenta/command/flags/__init__.py,sha256=XFi7_xYjpjnet7FGO93PTcUexeTQ9QwFHuUg_19Ferk,289
|
18
|
+
argenta/command/flags/models.py,sha256=U4nOwCqsCOURGigTKiQx07zBUKj0EoY0fCwgTNq4GIg,2332
|
19
|
+
argenta/orchestrator/__init__.py,sha256=vFtJEJTjFfoYP3DZx0gNlhoa0Tk8u-yzkGIUN3SiABA,86
|
20
|
+
argenta/orchestrator/entity.py,sha256=kgTHGrbWdsTDR7aAKv2Bvm8pO7LKFv7v8Dv1LDsdrTo,1093
|
21
|
+
argenta/orchestrator/argparser/__init__.py,sha256=akbTPC5CfNrgJTVVu1A2E9KeI8KPN4JnMM8M8U21jc8,90
|
22
|
+
argenta/orchestrator/argparser/entity.py,sha256=i3lCsCr_8JT09OosvxRuRD7KKP1MgeNFYz5kTTTqu9Q,2087
|
23
|
+
argenta/orchestrator/argparser/arguments/__init__.py,sha256=lRsKyJeiibPYhFZoeB3BRfIYM4mlUFp6nZpy9RdbgYg,213
|
24
|
+
argenta/orchestrator/argparser/arguments/models.py,sha256=wF4rIaEAx9Rt-c6rAeq6kZLfNPTn4v9WBNt9JHzJ0RA,1548
|
25
|
+
argenta/response/__init__.py,sha256=u4NuwUQkWa55aX67hTQs_B_gIaZ9Dn4Fe7xhSFQ_Rpw,128
|
26
|
+
argenta/response/entity.py,sha256=YcuKLnr7iiFewNqUH7bsdv-PccHfpitq-sm06tmSCjE,1042
|
27
|
+
argenta/response/status.py,sha256=bWFMHvyIHpOA4LxUQFoSpld-F8gu183M9nY-zN-MiZM,244
|
28
|
+
argenta/router/__init__.py,sha256=rvqAx80IXHFdVw7cWBRGaTtb94a4OQQEsMJ5f7YA1gU,68
|
29
|
+
argenta/router/defaults.py,sha256=vvkwFYCQdwjtMntfyrJuisxFX8XxeyhDMA-RwteHZGg,87
|
30
|
+
argenta/router/entity.py,sha256=Z3QZpntlZgt2bkJCb3zUsQ1_a05c61iN59-PBG0r7wg,9656
|
31
|
+
argenta/router/exceptions.py,sha256=5k0mTHYYItWHzGC0NU5oHHYrHxU0M5fEbO5wne_wFg8,860
|
32
|
+
argenta/router/command_handler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
+
argenta/router/command_handler/entity.py,sha256=xmHgbXBvD_-JMLpUPc5w3VVe-upTJ-y4lR13rUiiygo,2387
|
34
|
+
argenta-1.0.0.dist-info/METADATA,sha256=4BqurK6bCI6XM6KtNv4pyV3uvGcykxfkNz8EYjhiTfw,1392
|
35
|
+
argenta-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
36
|
+
argenta-1.0.0.dist-info/licenses/LICENSE,sha256=zmqoGh2n5rReBv4s8wPxF_gZEZDgauJYSPMuPczgOiU,1082
|
37
|
+
argenta-1.0.0.dist-info/RECORD,,
|
argenta/app/exceptions.py
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
class NoRegisteredRoutersException(Exception):
|
2
|
-
def __str__(self):
|
3
|
-
return "No Registered Router Found"
|
4
|
-
|
5
|
-
|
6
|
-
class NoRegisteredHandlersException(Exception):
|
7
|
-
def __init__(self, router_name):
|
8
|
-
self.router_name = router_name
|
9
|
-
def __str__(self):
|
10
|
-
return f"No Registered Handlers Found For '{self.router_name}'"
|
File without changes
|
@@ -1,21 +0,0 @@
|
|
1
|
-
from argenta.router.command_handler.entity import CommandHandler
|
2
|
-
|
3
|
-
|
4
|
-
class CommandHandlers:
|
5
|
-
def __init__(self, command_handlers: list[CommandHandler] = None):
|
6
|
-
self.command_handlers = command_handlers if command_handlers else []
|
7
|
-
|
8
|
-
def get_command_handlers(self) -> list[CommandHandler]:
|
9
|
-
return self.command_handlers
|
10
|
-
|
11
|
-
def add_command_handler(self, command_handler: CommandHandler):
|
12
|
-
self.command_handlers.append(command_handler)
|
13
|
-
|
14
|
-
def add_command_handlers(self, *command_handlers: CommandHandler):
|
15
|
-
self.command_handlers.extend(command_handlers)
|
16
|
-
|
17
|
-
def __iter__(self):
|
18
|
-
return iter(self.command_handlers)
|
19
|
-
|
20
|
-
def __next__(self):
|
21
|
-
return next(iter(self.command_handlers))
|